Fix ASN1_TIME_to_generalizedtime to take a const ASN1_TIME
authorMatt Caswell <matt@openssl.org>
Tue, 2 May 2017 10:08:33 +0000 (11:08 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 19 May 2017 08:01:07 +0000 (09:01 +0100)
Fixes #1526

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3360)
(cherry picked from commit 9bfeeef8ee2220339e601a028fa991c30d296ed4)

crypto/asn1/a_time.c
include/openssl/asn1.h

index db82d297d27bd68fbda3030a141f24a3e42c0a95..46f539cb8d776cb30404ec2f903caf26f4ef98a3 100644 (file)
@@ -59,7 +59,7 @@ int ASN1_TIME_check(const ASN1_TIME *t)
 }
 
 /* Convert an ASN1_TIME structure to GeneralizedTime */
-ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t,
+ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t,
                                                    ASN1_GENERALIZEDTIME **out)
 {
     ASN1_GENERALIZEDTIME *ret = NULL;
index df764c5f9fbc699e820dd5e1db7aaf0f1fc2e1fe..35637ccbdbe74946e0787b3aded3c69a098bd733 100644 (file)
@@ -625,8 +625,8 @@ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t);
 ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t,
                          int offset_day, long offset_sec);
 int ASN1_TIME_check(const ASN1_TIME *t);
-ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME
-                                                   **out);
+ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t,
+                                                   ASN1_GENERALIZEDTIME **out);
 int ASN1_TIME_set_string(ASN1_TIME *s, const char *str);
 
 int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a);