WPACKET: don't write DER length when we don't want to
authorRichard Levitte <levitte@openssl.org>
Fri, 1 May 2020 16:06:18 +0000 (18:06 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 4 May 2020 03:50:06 +0000 (05:50 +0200)
commit12cbb8e0497bc4990cfb02f1b9ebe23df9b53a2c
treeeee0c28f466cde273b6e1f4600ab7144ee6449bf
parent200e5ee5a4493906b307bf23117630b7caff0694
WPACKET: don't write DER length when we don't want to

With endfirst writing, it could be that we want to abandon any zero
length sub-packet.  That's what WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH
was supposed to make happen, but the DER length writing code didn't
look at that flag.  Now it does.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/11703)
crypto/packet.c
test/wpackettest.c