summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/asn1_lib.c
diff options
context:
space:
mode:
authortb <>2022-04-28 17:31:29 +0000
committertb <>2022-04-28 17:31:29 +0000
commit7e4a5a70be4f9de72ee5cafeda9f8966ced355f5 (patch)
tree715cc192d9f3581fab42d3cd24d344dd2697d0f7 /src/lib/libcrypto/asn1/asn1_lib.c
parentf686519965413d293f61576b7a8fac15ead41dc7 (diff)
downloadopenbsd-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