From 5ab6d6a5c05572bd1c75f05baf264a2d0001894a Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Fri, 13 Feb 2015 19:19:16 -0600 Subject: update buffer length for OBJ_obj2txt --- src/cryptography/hazmat/backends/openssl/x509.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cryptography/hazmat/backends/openssl/x509.py b/src/cryptography/hazmat/backends/openssl/x509.py index 6bc7137c..ebfbf331 100644 --- a/src/cryptography/hazmat/backends/openssl/x509.py +++ b/src/cryptography/hazmat/backends/openssl/x509.py @@ -120,7 +120,9 @@ class _Certificate(object): buf, lambda buf: self._backend._lib.OPENSSL_free(buf[0]) ) value = self._backend._ffi.buffer(buf[0], res)[:].decode('utf8') - buf_len = 50 + # Set to 80 on the recommendation of + # https://www.openssl.org/docs/crypto/OBJ_nid2ln.html + buf_len = 80 buf = self._backend._ffi.new("char[]", buf_len) res = self._backend._lib.OBJ_obj2txt(buf, buf_len, obj, 1) assert res > 0 -- cgit v1.2.3