diff options
-rw-r--r-- | unit-tests.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/unit-tests.py b/unit-tests.py index f0f5fb2..a3e4282 100644 --- a/unit-tests.py +++ b/unit-tests.py @@ -905,11 +905,19 @@ class TestPKeyBackup(TestCaseLoggedIn): encryptedPrivateKeyInfo = DerSequence() encryptedPrivateKeyInfo.decode(der) encryptionAlgorithm = DerSequence() - encryptionAlgorithm.decode(encryptedPrivateKeyInfo[0]) algorithm = DerObjectId() - algorithm.decode(encryptionAlgorithm[0]) encryptedData = DerOctetString() - encryptedData.decode(encryptedPrivateKeyInfo[1]) + encryptionAlgorithm.decode(encryptedPrivateKeyInfo[0]) + # <kludge> + # Sigh, bugs in PyCrypto ASN.1 code. Should do: + # + #algorithm.decode(encryptionAlgorithm[0]) + #encryptedData.decode(encryptedPrivateKeyInfo[1]) + # + # but due to bugs in those methods we must instead do: + DerObject.decode(algorithm, encryptionAlgorithm[0]) + DerObject.decode(encryptedData, encryptedPrivateKeyInfo[1]) + # </kludge> if algorithm.payload != oid: raise ValueError return encryptedData.payload |