newpass_p12(): factor for loop body into helpers
authortb <tb@openbsd.org>
Thu, 25 Jan 2024 09:40:09 +0000 (09:40 +0000)
committertb <tb@openbsd.org>
Thu, 25 Jan 2024 09:40:09 +0000 (09:40 +0000)
commit34fdb39bd01f7e2e2d36a3c121da3a77f005cc65
treed1acbc08a82420f0c37eed46c5bea78ab7015afb
parent21faacacf503df921161fe64cef80b9328e04bb4
newpass_p12(): factor for loop body into helpers

Since newpass_bags() and sk_PKCS7_push() could be shared between two
otherwise entirely unrelated code paths, it was decided to dedup the
code in about the ugliest possible way. Untangle the spaghetti and
split the code paths into helper functions, so we can easily error
check and avoid a bunch of leaks.

ok jsing
lib/libcrypto/pkcs12/p12_npas.c