From 2dd6cc89f6822ede162ef402f270493b2263d829 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 27 Dec 2013 16:50:56 -0500 Subject: expand the explanation for this workaround and switch XXX to TODO --- cryptography/hazmat/backends/openssl/asn1.py | 14 ++++++++++++-- cryptography/hazmat/backends/openssl/bignum.py | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/cryptography/hazmat/backends/openssl/asn1.py b/cryptography/hazmat/backends/openssl/asn1.py index e7c18a52..fa336cf3 100644 --- a/cryptography/hazmat/backends/openssl/asn1.py +++ b/cryptography/hazmat/backends/openssl/asn1.py @@ -17,9 +17,19 @@ INCLUDES = """ TYPES = """ /* - * XXX This typedef is wrong. - * https://bitbucket.org/cffi/cffi/issue/69 + * TODO: This typedef is wrong. + * + * This is due to limitations of cffi. + * See https://bitbucket.org/cffi/cffi/issue/69 + * + * For another possible work-around (not used here because it involves more + * complicated use of the cffi API which falls outside the general pattern used + * by this package), see * http://paste.pound-python.org/show/iJcTUMkKeBeS6yXpZWUU/ + * + * The work-around used here is to just be sure to declare a type that is at + * least as large as the real type. Maciej explains: + * * I think you want to declare your value too large (e.g. long) * that way you'll never pass garbage */ diff --git a/cryptography/hazmat/backends/openssl/bignum.py b/cryptography/hazmat/backends/openssl/bignum.py index a5ba07b1..599eadc8 100644 --- a/cryptography/hazmat/backends/openssl/bignum.py +++ b/cryptography/hazmat/backends/openssl/bignum.py @@ -18,9 +18,19 @@ INCLUDES = """ TYPES = """ typedef ... BIGNUM; /* - * XXX This typedef is wrong. - * https://bitbucket.org/cffi/cffi/issue/69 + * TODO: This typedef is wrong. + * + * This is due to limitations of cffi. + * See https://bitbucket.org/cffi/cffi/issue/69 + * + * For another possible work-around (not used here because it involves more + * complicated use of the cffi API which falls outside the general pattern used + * by this package), see * http://paste.pound-python.org/show/iJcTUMkKeBeS6yXpZWUU/ + * + * The work-around used here is to just be sure to declare a type that is at + * least as large as the real type. Maciej explains: + * * I think you want to declare your value too large (e.g. long) * that way you'll never pass garbage */ -- cgit v1.2.3