Use key_from_input as originally intended

This commit is contained in:
Stephen Paul Weber
2013-02-24 18:10:46 -05:00
parent 778c83dbc3
commit 1ecb990a02
2 changed files with 6 additions and 24 deletions

View File

@@ -93,14 +93,9 @@ class OpenPGP_Crypt_AES_TripleDES {
$packet->s2k_useage = 0;
$packet->symmetric_algorithm = 0;
$packet->encrypted_data = NULL;
foreach($packet::$secret_key_fields[$packet->algorithm] as $f) {
$length = unpack('n', substr($material, 0, 2)); // in bits
$length = (int)floor((reset($length) + 7) / 8); // in bytes
$packet->key[$f] = substr($material, 2, $length);
$material = substr($material, 2 + $length);
}
$packet->input = $material;
$packet->key_from_input();
unset($packet->input);
return $packet;
}