From 8b21a4a34a82ca0e73ca67bd3f148b25d6c7bdc6 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 14 Feb 2015 07:56:36 -0600 Subject: simplify things based on review feedback --- src/cryptography/hazmat/backends/openssl/x509.py | 1 + src/cryptography/x509.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cryptography/hazmat/backends/openssl/x509.py b/src/cryptography/hazmat/backends/openssl/x509.py index ebfbf331..76dcf32f 100644 --- a/src/cryptography/hazmat/backends/openssl/x509.py +++ b/src/cryptography/hazmat/backends/openssl/x509.py @@ -115,6 +115,7 @@ class _Certificate(object): assert data != self._backend._ffi.NULL buf = self._backend._ffi.new("unsigned char **") res = self._backend._lib.ASN1_STRING_to_UTF8(buf, data) + assert res >= 0 assert buf[0] != self._backend._ffi.NULL buf = self._backend._ffi.gc( buf, lambda buf: self._backend._lib.OPENSSL_free(buf[0]) diff --git a/src/cryptography/x509.py b/src/cryptography/x509.py index 21693ed4..8a888d2a 100644 --- a/src/cryptography/x509.py +++ b/src/cryptography/x509.py @@ -121,7 +121,7 @@ class Name(object): return not self == other def __iter__(self): - return iter(self._attributes[:]) + return iter(self._attributes) def __len__(self): return len(self._attributes) -- cgit v1.2.3