Skip to content

Commit 43a23a3

Browse files
authored
Switch to new notBefore/After APIs (#843)
Signed-off-by: Rosen Penev <[email protected]>
1 parent 79b9c79 commit 43a23a3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/OpenSSL/crypto.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ def gmtime_adj_notAfter(self, amount):
13301330
if not isinstance(amount, int):
13311331
raise TypeError("amount must be an integer")
13321332

1333-
notAfter = _lib.X509_get_notAfter(self._x509)
1333+
notAfter = _lib.X509_getm_notAfter(self._x509)
13341334
_lib.X509_gmtime_adj(notAfter, amount)
13351335

13361336
def gmtime_adj_notBefore(self, amount):
@@ -1343,7 +1343,7 @@ def gmtime_adj_notBefore(self, amount):
13431343
if not isinstance(amount, int):
13441344
raise TypeError("amount must be an integer")
13451345

1346-
notBefore = _lib.X509_get_notBefore(self._x509)
1346+
notBefore = _lib.X509_getm_notBefore(self._x509)
13471347
_lib.X509_gmtime_adj(notBefore, amount)
13481348

13491349
def has_expired(self):
@@ -1372,7 +1372,7 @@ def get_notBefore(self):
13721372
:return: A timestamp string, or ``None`` if there is none.
13731373
:rtype: bytes or NoneType
13741374
"""
1375-
return self._get_boundary_time(_lib.X509_get_notBefore)
1375+
return self._get_boundary_time(_lib.X509_getm_notBefore)
13761376

13771377
def _set_boundary_time(self, which, when):
13781378
return _set_asn1_time(which(self._x509), when)
@@ -1388,7 +1388,7 @@ def set_notBefore(self, when):
13881388
:param bytes when: A timestamp string.
13891389
:return: ``None``
13901390
"""
1391-
return self._set_boundary_time(_lib.X509_get_notBefore, when)
1391+
return self._set_boundary_time(_lib.X509_getm_notBefore, when)
13921392

13931393
def get_notAfter(self):
13941394
"""
@@ -1401,7 +1401,7 @@ def get_notAfter(self):
14011401
:return: A timestamp string, or ``None`` if there is none.
14021402
:rtype: bytes or NoneType
14031403
"""
1404-
return self._get_boundary_time(_lib.X509_get_notAfter)
1404+
return self._get_boundary_time(_lib.X509_getm_notAfter)
14051405

14061406
def set_notAfter(self, when):
14071407
"""
@@ -1414,7 +1414,7 @@ def set_notAfter(self, when):
14141414
:param bytes when: A timestamp string.
14151415
:return: ``None``
14161416
"""
1417-
return self._set_boundary_time(_lib.X509_get_notAfter, when)
1417+
return self._set_boundary_time(_lib.X509_getm_notAfter, when)
14181418

14191419
def _get_name(self, which):
14201420
name = X509Name.__new__(X509Name)

0 commit comments

Comments
 (0)