summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2020-08-13 12:07:12 -0700
committerGitHub <noreply@github.com>2020-08-13 14:07:12 -0500
commit43a23a313ae475310ee0e9734e083de145893c7a (patch)
tree7eab299fd6709c545f81b601426a170737e120eb
parent79b9c79148f51fc9321ab4450947b259cb5804fb (diff)
downloadpyopenssl-git-43a23a313ae475310ee0e9734e083de145893c7a.tar.gz
Switch to new notBefore/After APIs (#843)
Signed-off-by: Rosen Penev <rosenp@gmail.com>
-rw-r--r--src/OpenSSL/crypto.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/OpenSSL/crypto.py b/src/OpenSSL/crypto.py
index 79307b8..fee5259 100644
--- a/src/OpenSSL/crypto.py
+++ b/src/OpenSSL/crypto.py
@@ -1330,7 +1330,7 @@ class X509(object):
if not isinstance(amount, int):
raise TypeError("amount must be an integer")
- notAfter = _lib.X509_get_notAfter(self._x509)
+ notAfter = _lib.X509_getm_notAfter(self._x509)
_lib.X509_gmtime_adj(notAfter, amount)
def gmtime_adj_notBefore(self, amount):
@@ -1343,7 +1343,7 @@ class X509(object):
if not isinstance(amount, int):
raise TypeError("amount must be an integer")
- notBefore = _lib.X509_get_notBefore(self._x509)
+ notBefore = _lib.X509_getm_notBefore(self._x509)
_lib.X509_gmtime_adj(notBefore, amount)
def has_expired(self):
@@ -1372,7 +1372,7 @@ class X509(object):
:return: A timestamp string, or ``None`` if there is none.
:rtype: bytes or NoneType
"""
- return self._get_boundary_time(_lib.X509_get_notBefore)
+ return self._get_boundary_time(_lib.X509_getm_notBefore)
def _set_boundary_time(self, which, when):
return _set_asn1_time(which(self._x509), when)
@@ -1388,7 +1388,7 @@ class X509(object):
:param bytes when: A timestamp string.
:return: ``None``
"""
- return self._set_boundary_time(_lib.X509_get_notBefore, when)
+ return self._set_boundary_time(_lib.X509_getm_notBefore, when)
def get_notAfter(self):
"""
@@ -1401,7 +1401,7 @@ class X509(object):
:return: A timestamp string, or ``None`` if there is none.
:rtype: bytes or NoneType
"""
- return self._get_boundary_time(_lib.X509_get_notAfter)
+ return self._get_boundary_time(_lib.X509_getm_notAfter)
def set_notAfter(self, when):
"""
@@ -1414,7 +1414,7 @@ class X509(object):
:param bytes when: A timestamp string.
:return: ``None``
"""
- return self._set_boundary_time(_lib.X509_get_notAfter, when)
+ return self._set_boundary_time(_lib.X509_getm_notAfter, when)
def _get_name(self, which):
name = X509Name.__new__(X509Name)