[pypy-commit] pypy py3.5: consider GEN_RID while extracting the get_peer_alt_names (change in stdlib 3.5.3)

plan_rich pypy.commits at gmail.com
Mon Feb 20 06:02:52 EST 2017


Author: Richard Plangger <planrichi at gmail.com>
Branch: py3.5
Changeset: r90225:dd295fcef6cb
Date: 2017-02-20 12:02 +0100
http://bitbucket.org/pypy/pypy/changeset/dd295fcef6cb/

Log:	consider GEN_RID while extracting the get_peer_alt_names (change in
	stdlib 3.5.3)

diff --git a/lib_pypy/_cffi_ssl/_stdssl/certificate.py b/lib_pypy/_cffi_ssl/_stdssl/certificate.py
--- a/lib_pypy/_cffi_ssl/_stdssl/certificate.py
+++ b/lib_pypy/_cffi_ssl/_stdssl/certificate.py
@@ -109,6 +109,19 @@
             elif _type == lib.GEN_URI:
                 v = _string_from_asn1(name.d.uniformResourceIdentifier)
                 peer_alt_names.append(("URI", v))
+            elif _type == lib.GEN_RID:
+                v = "Registered ID"
+                buf = ffi.new("char[2048]")
+
+                length = lib.i2t_ASN1_OBJECT(buf, 2047, name.d.rid);
+                if length < 0:
+                    # TODO _setSSLError(NULL, 0, __FILE__, __LINE__);
+                    raise NotImplementedError
+                elif length >= 2048:
+                    v = "<INVALID>"
+                else:
+                    v = _str_with_len(buf, length)
+                peer_alt_names.append(("Registered ID", v))
             else:
                 # for everything else, we use the OpenSSL print form
                 if _type not in (lib.GEN_OTHERNAME, lib.GEN_X400, \


More information about the pypy-commit mailing list