summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2021-11-04 19:35:09 +0800
committerGitHub <noreply@github.com>2021-11-04 07:35:09 -0400
commita52d5e3f84bd6471bee0e1b83b71697105adcd14 (patch)
treefddd38966fc7898ac6c1233f996d46ba69a6eb1b
parentc8fe4dd5e91b00a5817db283c6198ef7031da825 (diff)
downloadpyopenssl-a52d5e3f84bd6471bee0e1b83b71697105adcd14.tar.gz
use more functions guaranteed available in cryptography 35.0 (#1060)
* use more functions guaranteed available in cryptography 35.0 * these are also guaranteed
-rw-r--r--src/OpenSSL/crypto.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py
index 151d7d1..e395ee3 100644
--- a/src/OpenSSL/crypto.py
+++ b/src/OpenSSL/crypto.py
@@ -2315,7 +2315,7 @@ class CRL(object):
revoked_stack = _lib.X509_CRL_get_REVOKED(self._crl)
for i in range(_lib.sk_X509_REVOKED_num(revoked_stack)):
revoked = _lib.sk_X509_REVOKED_value(revoked_stack, i)
- revoked_copy = _lib.Cryptography_X509_REVOKED_dup(revoked)
+ revoked_copy = _lib.X509_REVOKED_dup(revoked)
pyrev = Revoked.__new__(Revoked)
pyrev._revoked = _ffi.gc(revoked_copy, _lib.X509_REVOKED_free)
results.append(pyrev)
@@ -2333,7 +2333,7 @@ class CRL(object):
:param Revoked revoked: The new revocation.
:return: ``None``
"""
- copy = _lib.Cryptography_X509_REVOKED_dup(revoked._revoked)
+ copy = _lib.X509_REVOKED_dup(revoked._revoked)
_openssl_assert(copy != _ffi.NULL)
add_result = _lib.X509_CRL_add0_revoked(self._crl, copy)
@@ -2381,7 +2381,7 @@ class CRL(object):
:param bytes when: A timestamp string.
:return: ``None``
"""
- return self._set_boundary_time(_lib.X509_CRL_get_lastUpdate, when)
+ return self._set_boundary_time(_lib.X509_CRL_get0_lastUpdate, when)
def set_nextUpdate(self, when):
"""
@@ -2396,7 +2396,7 @@ class CRL(object):
:param bytes when: A timestamp string.
:return: ``None``
"""
- return self._set_boundary_time(_lib.X509_CRL_get_nextUpdate, when)
+ return self._set_boundary_time(_lib.X509_CRL_get0_nextUpdate, when)
def sign(self, issuer_cert, issuer_key, digest):
"""
@@ -2463,10 +2463,10 @@ class CRL(object):
_openssl_assert(sometime != _ffi.NULL)
_lib.X509_gmtime_adj(sometime, 0)
- _lib.X509_CRL_set_lastUpdate(self._crl, sometime)
+ _lib.X509_CRL_set1_lastUpdate(self._crl, sometime)
_lib.X509_gmtime_adj(sometime, days * 24 * 60 * 60)
- _lib.X509_CRL_set_nextUpdate(self._crl, sometime)
+ _lib.X509_CRL_set1_nextUpdate(self._crl, sometime)
_lib.X509_CRL_set_issuer_name(
self._crl, _lib.X509_get_subject_name(cert._x509)
@@ -3008,8 +3008,8 @@ def sign(pkey, data, digest):
if digest_obj == _ffi.NULL:
raise ValueError("No such digest method")
- md_ctx = _lib.Cryptography_EVP_MD_CTX_new()
- md_ctx = _ffi.gc(md_ctx, _lib.Cryptography_EVP_MD_CTX_free)
+ md_ctx = _lib.EVP_MD_CTX_new()
+ md_ctx = _ffi.gc(md_ctx, _lib.EVP_MD_CTX_free)
_lib.EVP_SignInit(md_ctx, digest_obj)
_lib.EVP_SignUpdate(md_ctx, data, len(data))
@@ -3049,8 +3049,8 @@ def verify(cert, signature, data, digest):
_openssl_assert(pkey != _ffi.NULL)
pkey = _ffi.gc(pkey, _lib.EVP_PKEY_free)
- md_ctx = _lib.Cryptography_EVP_MD_CTX_new()
- md_ctx = _ffi.gc(md_ctx, _lib.Cryptography_EVP_MD_CTX_free)
+ md_ctx = _lib.EVP_MD_CTX_new()
+ md_ctx = _ffi.gc(md_ctx, _lib.EVP_MD_CTX_free)
_lib.EVP_VerifyInit(md_ctx, digest_obj)
_lib.EVP_VerifyUpdate(md_ctx, data, len(data))