]> WPIA git - cassiopeia.git/commitdiff
chg: Replace ASN1_UTCTIME by ASN1_TIME
authorFelix Dörre <felix@dogcraft.de>
Fri, 9 Jan 2015 23:37:34 +0000 (00:37 +0100)
committerBenny Baumann <BenBE@geshi.org>
Sat, 24 Jan 2015 17:33:29 +0000 (18:33 +0100)
src/crypto/CRL.cpp
src/crypto/CRL.h
src/crypto/remoteSigner.cpp

index b7a69fe80fee40dde9f3dba19587c4860ff5c27a..7c3eb866dfff7be87521bb1ec349a4c0bd471104 100644 (file)
@@ -38,17 +38,17 @@ std::string CRL::revoke( std::string serial, std::string time ) {
 
     if( time != "" ) {
         const unsigned char* data = ( unsigned char* )( time.data() );
-        d2i_ASN1_UTCTIME( &rev->revocationDate, &data, time.size() );
+        d2i_ASN1_TIME( &rev->revocationDate, &data, time.size() );
     } else {
         X509_REVOKED_set_revocationDate( rev, tmptm.get() );
     }
 
     X509_CRL_add0_revoked( crl.get(), rev );
 
-    int len = i2d_ASN1_UTCTIME( tmptm.get(), NULL );
+    int len = i2d_ASN1_TIME( tmptm.get(), NULL );
     unsigned char* buffer = ( unsigned char* ) OPENSSL_malloc( len );
     unsigned char* pos = buffer;
-    i2d_ASN1_UTCTIME( tmptm.get(), &pos );
+    i2d_ASN1_TIME( tmptm.get(), &pos );
     std::string rettime = std::string( ( char* ) buffer, len );
     OPENSSL_free( buffer );
     return rettime;
@@ -99,15 +99,15 @@ std::string CRL::toString() {
 std::string CRL::getSignature() {
     int len = i2d_X509_ALGOR( crl->sig_alg, NULL );
     len += i2d_ASN1_BIT_STRING( crl->signature, NULL );
-    len += i2d_ASN1_UTCTIME( crl->crl->lastUpdate, NULL );
-    len += i2d_ASN1_UTCTIME( crl->crl->nextUpdate, NULL );
+    len += i2d_ASN1_TIME( crl->crl->lastUpdate, NULL );
+    len += i2d_ASN1_TIME( crl->crl->nextUpdate, NULL );
 
     unsigned char* buffer = ( unsigned char* ) OPENSSL_malloc( len );
     unsigned char* pos = buffer;
     i2d_X509_ALGOR( crl->sig_alg, &pos );
     i2d_ASN1_BIT_STRING( crl->signature, &pos );
-    i2d_ASN1_UTCTIME( crl->crl->lastUpdate, &pos );
-    i2d_ASN1_UTCTIME( crl->crl->nextUpdate, &pos );
+    i2d_ASN1_TIME( crl->crl->lastUpdate, &pos );
+    i2d_ASN1_TIME( crl->crl->nextUpdate, &pos );
     std::string res = std::string( ( char* ) buffer, len );
     OPENSSL_free( buffer );
 
@@ -119,6 +119,6 @@ void CRL::setSignature( std::string signature ) {
     const unsigned char* buffer = data;
     d2i_X509_ALGOR( &crl->sig_alg, &buffer, signature.size() );
     d2i_ASN1_BIT_STRING( &crl->signature, &buffer, signature.size() + data - buffer );
-    d2i_ASN1_UTCTIME( &crl->crl->lastUpdate, &buffer, signature.size() + data - buffer );
-    d2i_ASN1_UTCTIME( &crl->crl->nextUpdate, &buffer, signature.size() + data - buffer );
+    d2i_ASN1_TIME( &crl->crl->lastUpdate, &buffer, signature.size() + data - buffer );
+    d2i_ASN1_TIME( &crl->crl->nextUpdate, &buffer, signature.size() + data - buffer );
 }
index 4e3deb76e58cb7e2605ffc684d4ef23e06c32406..55c2c3faf5b8f74a0a89b6aaa2c3a4f4d4ef03bb 100644 (file)
@@ -15,7 +15,7 @@ public:
      * Adds the serial to this serial.
      * @param serial the serial to remove (as hex string)
      * @param time the "revokation time" (der-encoded)
-     * @returns DER-encoded UTCTIME of the revoked time
+     * @returns DER-encoded TIME of the revoked time
      */
     std::string revoke( std::string serial, std::string time );
 
index bad2065b2c435bc39516e57026183c0c5136a461..60739866d56364fdfe4e8d6591aa641ea05c7181 100644 (file)
@@ -177,8 +177,8 @@ std::pair<std::shared_ptr<CRL>, std::string> RemoteSigner::revoke( std::shared_p
     case RecordHeader::SignerResult::REVOKED: {
         const unsigned char* buffer2 = ( const unsigned char* ) payload.data();
         const unsigned char* pos = buffer2;
-        ASN1_UTCTIME* time = d2i_ASN1_UTCTIME( NULL, &pos, payload.size() );
-        ASN1_UTCTIME_free( time );
+        ASN1_TIME* time = d2i_ASN1_TIME( NULL, &pos, payload.size() );
+        ASN1_TIME_free( time );
         std::string rest = payload.substr( pos - buffer2 );
         crl->revoke( serial, payload.substr( 0, pos - buffer2 ) );
         crl->setSignature( rest );