diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2022-02-13 11:44:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-13 06:44:30 -1000 |
commit | bcb20110134379bcea9a0cb5c7a3d986afaa8ea5 (patch) | |
tree | b050c4a30f1da5af0e146c0b2e528b42fbf81bf5 | |
parent | 05d580d3ca5f6e3b66d9a3e9868f8262e4240d57 (diff) | |
download | pyopenssl-bcb20110134379bcea9a0cb5c7a3d986afaa8ea5.tar.gz |
Use a non-deprecated OpeNSSL function (#1093)
-rw-r--r-- | src/OpenSSL/crypto.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py index 8d24742..b71de57 100644 --- a/src/OpenSSL/crypto.py +++ b/src/OpenSSL/crypto.py @@ -174,7 +174,7 @@ def _get_asn1_time(timestamp): elif ( _lib.ASN1_STRING_type(string_timestamp) == _lib.V_ASN1_GENERALIZEDTIME ): - return _ffi.string(_lib.ASN1_STRING_data(string_timestamp)) + return _ffi.string(_lib.ASN1_STRING_get0_data(string_timestamp)) else: generalized_timestamp = _ffi.new("ASN1_GENERALIZEDTIME**") _lib.ASN1_TIME_to_generalizedtime(timestamp, generalized_timestamp) @@ -193,7 +193,7 @@ def _get_asn1_time(timestamp): string_timestamp = _ffi.cast( "ASN1_STRING*", generalized_timestamp[0] ) - string_data = _lib.ASN1_STRING_data(string_timestamp) + string_data = _lib.ASN1_STRING_get0_data(string_timestamp) string_result = _ffi.string(string_data) _lib.ASN1_GENERALIZEDTIME_free(generalized_timestamp[0]) return string_result @@ -715,7 +715,7 @@ class X509Name: # ffi.string does not handle strings containing NULL bytes # (which may have been generated by old, broken software) value = _ffi.buffer( - _lib.ASN1_STRING_data(fval), _lib.ASN1_STRING_length(fval) + _lib.ASN1_STRING_get0_data(fval), _lib.ASN1_STRING_length(fval) )[:] result.append((_ffi.string(name), value)) @@ -869,7 +869,7 @@ class X509Extension: """ octet_result = _lib.X509_EXTENSION_get_data(self._extension) string_result = _ffi.cast("ASN1_STRING*", octet_result) - char_result = _lib.ASN1_STRING_data(string_result) + char_result = _lib.ASN1_STRING_get0_data(string_result) result_length = _lib.ASN1_STRING_length(string_result) return _ffi.buffer(char_result, result_length)[:] |