aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-12-18 21:47:20 +0100
committerDr. David von Oheimb <dev@ddvo.net>2021-01-20 15:55:58 +0100
commitb09aa550d3d9af269f9551a5a95a3d8408d9098d (patch)
tree7cfcb3e10b4ee022e7dae8d0bb4242180cfc3bd3 /crypto
parent9495cfbc22393aee87aa877e9e2e726c2cc441f1 (diff)
downloadopenssl-b09aa550d3d9af269f9551a5a95a3d8408d9098d.zip
openssl-b09aa550d3d9af269f9551a5a95a3d8408d9098d.tar.gz
openssl-b09aa550d3d9af269f9551a5a95a3d8408d9098d.tar.bz2
ASN1_TIME_print() etc.: Improve doc and add comment on handling invalid time input
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13714)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/asn1/a_time.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c
index c34b028..7bd97c6 100644
--- a/crypto/asn1/a_time.c
+++ b/crypto/asn1/a_time.c
@@ -476,7 +476,9 @@ int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)
if (!asn1_time_to_tm(&stm, tm)) {
/* asn1_time_to_tm will check the time type */
- goto err;
+ (void)BIO_write(bp, "Bad time value", 14);
+ return 0;
+ /* It would have been more consistent to return BIO_write(...) */
}
l = tm->length;
@@ -509,9 +511,6 @@ int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)
stm.tm_min, stm.tm_sec, stm.tm_year + 1900,
(gmt ? " GMT" : "")) > 0;
}
- err:
- BIO_write(bp, "Bad time value", 14);
- return 0;
}
int ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t)