Improve description of algorithm NIDs in doc/man3/OSSL_CMP_CTX_new.pod
[openssl.git] / crypto / packet.c
index 661b59e84217acfd98bed7b2d9c4f1bab3114bec..6db97a5434444369d89db1a0f07e3f29dfd2cbdd 100644 (file)
@@ -265,7 +265,10 @@ static int wpacket_intern_close(WPACKET *pkt, WPACKET_SUB *sub, int doclose)
                 && !put_value(&buf[sub->packet_len], packlen,
                               sub->lenbytes))
             return 0;
-    } else if (pkt->endfirst && sub->parent != NULL) {
+    } else if (pkt->endfirst && sub->parent != NULL
+               && (packlen != 0
+                   || (sub->flags
+                       & WPACKET_FLAGS_ABANDON_ON_ZERO_LENGTH) == 0)) {
         size_t tmplen = packlen;
         size_t numlenbytes = 1;