summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2014-06-09 18:05:36 +0200
committerMatěj Cepl <mcepl@cepl.eu>2015-10-13 15:23:20 +0200
commit4c606090a51c54caadda8a6f0090ccb6737408f0 (patch)
treeb9647d0172ab006db642a7b020af22b609193508
parentf7f231b1e56d64a74d9ec4855f2324d9d526f3bb (diff)
downloadm2crypto-4c606090a51c54caadda8a6f0090ccb6737408f0.tar.gz
Accommodate change of global mask in crypto/asn1/a_strnid.c
A X509_name_hash_old() return value differs because the DER encoding of a X509_NAME differs because global_mask in crypto/asn1/a_strnid.c changed from 0xFFFFFFFFL to B_ASN1_UTF8STRING between OpenSSL 1.0.1e and 1.0.1h. See https://bugzilla.redhat.com/show_bug.cgi?id=1106146 for more information. Fixes https://github.com/martinpaljak/M2Crypto/issues/42
-rw-r--r--tests/test_x509.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py
index 8c281a3..a6714a4 100644
--- a/tests/test_x509.py
+++ b/tests/test_x509.py
@@ -146,7 +146,9 @@ class X509TestCase(unittest.TestCase):
cn.set_data("Hello There!")
assert cn.get_data().as_text() == "Hello There!", cn.get_data().as_text()
- assert n.as_hash() == 1697185131
+ # OpenSSL 1.0.1h switched from encoding strings as PRINTABLESTRING (the
+ # first hash value) to UTF8STRING (the second one)
+ assert n.as_hash() in (1697185131, 1370641112), n.as_hash()
self.assertRaises(IndexError, lambda: n[100])
self.assert_(n[10])