[Commits] (heikki) Setting notBefore and notAfter now works.

commits at osafoundation.org commits at osafoundation.org
Fri Mar 5 16:17:10 PST 2004


Commit by: heikki
Modified files:
osaf/chandler/m2crypto/SWIG/_x509.i 1.2 1.3
osaf/chandler/m2crypto/demo/x509/ca.py 1.1 1.2

Log message:
Setting notBefore and notAfter now works.


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/osaf/chandler/m2crypto/SWIG/_x509.i.diff?r1=text&tr1=1.2&r2=text&tr2=1.3
http://cvs.osafoundation.org/index.cgi/osaf/chandler/m2crypto/demo/x509/ca.py.diff?r1=text&tr1=1.1&r2=text&tr2=1.2

Index: osaf/chandler/m2crypto/SWIG/_x509.i
diff -u osaf/chandler/m2crypto/SWIG/_x509.i:1.2 osaf/chandler/m2crypto/SWIG/_x509.i:1.3
--- osaf/chandler/m2crypto/SWIG/_x509.i:1.2	Fri Mar  5 15:02:12 2004
+++ osaf/chandler/m2crypto/SWIG/_x509.i	Fri Mar  5 16:16:39 2004
@@ -7,7 +7,7 @@
 ** Author: Heikki Toivonen
 */
 
-/* $Id: _x509.i,v 1.2 2004/03/05 23:02:12 heikki Exp $   */
+/* $Id: _x509.i,v 1.3 2004/03/06 00:16:39 heikki Exp $   */
 
 %{
 #include <openssl/x509.h>
@@ -127,7 +127,8 @@
     return X509_get_notAfter(x);
 }
 
-ASN1_TIME *x509_gmtime_adj(ASN1_TIME *s, long adj) {
+/* XXX The first parameter is really ASN1_TIME, does it matter? */
+ASN1_TIME *x509_gmtime_adj(ASN1_UTCTIME *s, long adj) {
     return X509_gmtime_adj(s, adj);
 }
 

Index: osaf/chandler/m2crypto/demo/x509/ca.py
diff -u osaf/chandler/m2crypto/demo/x509/ca.py:1.1 osaf/chandler/m2crypto/demo/x509/ca.py:1.2
--- osaf/chandler/m2crypto/demo/x509/ca.py:1.1	Fri Mar  5 15:02:13 2004
+++ osaf/chandler/m2crypto/demo/x509/ca.py	Fri Mar  5 16:16:39 2004
@@ -35,17 +35,11 @@
 # XXX Set subjectName
 # XXX Set issuerName
 cert.set_pubkey(pkey)
-# XXX Set notBefore
-# XXX Set notAfter
-
-# This does not work, gmtime_adj not recognized
-#print m2.x509_get_not_before(cert.x509)
-#print cert.get_not_before()
-#print m2.gmtime_adj
-#print "notBefore adj: ", m2.gmtime_adj(m2.x509_get_not_before(cert.x509), 0)
-#days = 30
-#print "notAfter adj: ", m2.gmtime_adj(m2.x509_get_not_after(cert.x509),
-#                                      60*60*24*days)
+notBefore = m2.x509_get_not_before(cert.x509)
+notAfter  = m2.x509_get_not_after(cert.x509)
+m2.x509_gmtime_adj(notBefore, 0)
+days = 30
+m2.x509_gmtime_adj(notAfter, 60*60*24*days)
 
 # XXX extensions
 



More information about the Commits mailing list