diff options
author | sevan <sevan@pkgsrc.org> | 2017-03-08 01:09:00 +0000 |
---|---|---|
committer | sevan <sevan@pkgsrc.org> | 2017-03-08 01:09:00 +0000 |
commit | d16fee0de2d21d48bd0d78e8c52da41b4446274f (patch) | |
tree | 0489f0ff60b0f9ebffa849175f102abe54c3cef8 | |
parent | 54dee6a67ecaf886cd3713c0d45011d7962af285 (diff) | |
download | pkgsrc-d16fee0de2d21d48bd0d78e8c52da41b4446274f.tar.gz |
Tabs vs spaces!
Unbreak with the Python 3 versions of the package.
Heads up by Daniel Jakots.
-rw-r--r-- | security/py-crypto/distinfo | 4 | ||||
-rw-r--r-- | security/py-crypto/patches/patch-lib_Crypto_SelfTest_Cipher_common.py | 38 |
2 files changed, 21 insertions, 21 deletions
diff --git a/security/py-crypto/distinfo b/security/py-crypto/distinfo index be7742a424c..9cbbff3c30a 100644 --- a/security/py-crypto/distinfo +++ b/security/py-crypto/distinfo @@ -1,9 +1,9 @@ -$NetBSD: distinfo,v 1.12 2017/03/07 23:17:51 sevan Exp $ +$NetBSD: distinfo,v 1.13 2017/03/08 01:09:00 sevan Exp $ SHA1 (pycrypto-2.6.1.tar.gz) = aeda3ed41caf1766409d4efc689b9ca30ad6aeb2 RMD160 (pycrypto-2.6.1.tar.gz) = ac0db079e5e4be9daf739e094c10e96291dbc009 SHA512 (pycrypto-2.6.1.tar.gz) = 20a4aed4dac4e9e61d773ebc1d48ea577e9870c33f396be53d075a9bf8487d93e75e200179882d81e452efd0f6751789bac434f6f431b3e7c1c8ef9dba392847 Size (pycrypto-2.6.1.tar.gz) = 446240 bytes SHA1 (patch-ab) = 2c72b0e70fdebd2e62aff28284afd919e935de08 -SHA1 (patch-lib_Crypto_SelfTest_Cipher_common.py) = 4e4f3c0a705ceb8fbc922c5d44bd33fce347ac83 +SHA1 (patch-lib_Crypto_SelfTest_Cipher_common.py) = d505f84217614a5a0065addcebab46da15c204e7 SHA1 (patch-src_block_template.c) = 646bb15e41290922c417a2104e401c82379e97dd diff --git a/security/py-crypto/patches/patch-lib_Crypto_SelfTest_Cipher_common.py b/security/py-crypto/patches/patch-lib_Crypto_SelfTest_Cipher_common.py index 7c8b20ddb9a..6d25d42cfc4 100644 --- a/security/py-crypto/patches/patch-lib_Crypto_SelfTest_Cipher_common.py +++ b/security/py-crypto/patches/patch-lib_Crypto_SelfTest_Cipher_common.py @@ -1,4 +1,4 @@ -$NetBSD: patch-lib_Crypto_SelfTest_Cipher_common.py,v 1.1 2017/03/07 23:17:51 sevan Exp $ +$NetBSD: patch-lib_Crypto_SelfTest_Cipher_common.py,v 1.2 2017/03/08 01:09:00 sevan Exp $ CVE-2013-7459 backport https://github.com/dlitz/pycrypto/commit/8dbe0dc3eea5c689d4f76b37b93fe216cf1f00d4 @@ -11,25 +11,25 @@ https://github.com/dlitz/pycrypto/commit/8dbe0dc3eea5c689d4f76b37b93fe216cf1f00d def runTest(self): - for mode in (self.module.MODE_ECB, self.module.MODE_CBC, self.module.MODE_CFB, self.module.MODE_OFB, self.module.MODE_OPENPGP): + ## ECB mode -+ mode = self.module.MODE_ECB -+ encryption_cipher = self.module.new(a2b_hex(self.key), mode) -+ ciphertext = encryption_cipher.encrypt(self.plaintext) -+ decryption_cipher = self.module.new(a2b_hex(self.key), mode) -+ decrypted_plaintext = decryption_cipher.decrypt(ciphertext) -+ self.assertEqual(self.plaintext, decrypted_plaintext) ++ mode = self.module.MODE_ECB ++ encryption_cipher = self.module.new(a2b_hex(self.key), mode) ++ ciphertext = encryption_cipher.encrypt(self.plaintext) ++ decryption_cipher = self.module.new(a2b_hex(self.key), mode) ++ decrypted_plaintext = decryption_cipher.decrypt(ciphertext) ++ self.assertEqual(self.plaintext, decrypted_plaintext) + -+ ## OPENPGP mode -+ mode = self.module.MODE_OPENPGP -+ encryption_cipher = self.module.new(a2b_hex(self.key), mode, self.iv) -+ eiv_ciphertext = encryption_cipher.encrypt(self.plaintext) -+ eiv = eiv_ciphertext[:self.module.block_size+2] -+ ciphertext = eiv_ciphertext[self.module.block_size+2:] -+ decryption_cipher = self.module.new(a2b_hex(self.key), mode, eiv) -+ decrypted_plaintext = decryption_cipher.decrypt(ciphertext) -+ self.assertEqual(self.plaintext, decrypted_plaintext) ++ ## OPENPGP mode ++ mode = self.module.MODE_OPENPGP ++ encryption_cipher = self.module.new(a2b_hex(self.key), mode, self.iv) ++ eiv_ciphertext = encryption_cipher.encrypt(self.plaintext) ++ eiv = eiv_ciphertext[:self.module.block_size+2] ++ ciphertext = eiv_ciphertext[self.module.block_size+2:] ++ decryption_cipher = self.module.new(a2b_hex(self.key), mode, eiv) ++ decrypted_plaintext = decryption_cipher.decrypt(ciphertext) ++ self.assertEqual(self.plaintext, decrypted_plaintext) + -+ ## All other non-AEAD modes (but CTR) -+ for mode in (self.module.MODE_CBC, self.module.MODE_CFB, self.module.MODE_OFB): ++ ## All other non-AEAD modes (but CTR) ++ for mode in (self.module.MODE_CBC, self.module.MODE_CFB, self.module.MODE_OFB): encryption_cipher = self.module.new(a2b_hex(self.key), mode, self.iv) ciphertext = encryption_cipher.encrypt(self.plaintext) - @@ -39,7 +39,7 @@ https://github.com/dlitz/pycrypto/commit/8dbe0dc3eea5c689d4f76b37b93fe216cf1f00d - eiv = ciphertext[:self.module.block_size+2] - ciphertext = ciphertext[self.module.block_size+2:] - decryption_cipher = self.module.new(a2b_hex(self.key), mode, eiv) -+ decryption_cipher = self.module.new(a2b_hex(self.key), mode, self.iv) ++ decryption_cipher = self.module.new(a2b_hex(self.key), mode, self.iv) decrypted_plaintext = decryption_cipher.decrypt(ciphertext) self.assertEqual(self.plaintext, decrypted_plaintext) |