summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dsa/dsa_prn.c
diff options
context:
space:
mode:
authortb <>2022-04-28 17:31:29 +0000
committertb <>2022-04-28 17:31:29 +0000
commitcaf53398e438071d59fcb00cac3a6c9f153493a8 (patch)
tree715cc192d9f3581fab42d3cd24d344dd2697d0f7 /src/lib/libcrypto/dsa/dsa_prn.c
parenta4b8bbdad8f29f4bf82c5f38334d81a878b42e1a (diff)
downloadopenbsd-caf53398e438071d59fcb00cac3a6c9f153493a8.tar.gz
openbsd-caf53398e438071d59fcb00cac3a6c9f153493a8.tar.bz2
openbsd-caf53398e438071d59fcb00cac3a6c9f153493a8.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/dsa/dsa_prn.c')
0 files changed, 0 insertions, 0 deletions