diff options
author | tb <> | 2022-04-28 17:31:29 +0000 |
---|---|---|
committer | tb <> | 2022-04-28 17:31:29 +0000 |
commit | 7e4a5a70be4f9de72ee5cafeda9f8966ced355f5 (patch) | |
tree | 715cc192d9f3581fab42d3cd24d344dd2697d0f7 /src/lib/libcrypto/asn1/asn1_lib.c | |
parent | f686519965413d293f61576b7a8fac15ead41dc7 (diff) | |
download | openbsd-7e4a5a70be4f9de72ee5cafeda9f8966ced355f5.tar.gz openbsd-7e4a5a70be4f9de72ee5cafeda9f8966ced355f5.tar.bz2 openbsd-7e4a5a70be4f9de72ee5cafeda9f8966ced355f5.zip |
Refactor ASN1_TIME_adj_internal()
ASN1_TIME_adj_internal() does some strange dances with remembering
allocations in a boolean and using strlen(p) to deduce what happened
inside *_string_from_tm(). It also (mis)translates a NULL p to an
illegal time value error.
This can be streamlined by converting directly from a struct tm into an
ASN1_TIME and setting the errors when they occur instead of trying to
deduce them from a NULL return. This is made a bit uglier than necessary
due to the reuse-or-allocate semantics of the public API.
At the cost of a little code duplication, ASN1_TIME_adj_internal()
becomes very easy and ASN1_TIME_to_generalizedtime() is also simplified
somewhat.
ok inoguchi jsing
Diffstat (limited to 'src/lib/libcrypto/asn1/asn1_lib.c')
0 files changed, 0 insertions, 0 deletions