Make sure we handle input NULL with length 0
[openssl.git] / providers / implementations / ciphers / cipher_aes_ocb.c
index ba4e4f29f83e31616ef9ada3a4cb1444d402b26c..6b07caaa52e875677d43aff2b198c391b1e51ca3 100644 (file)
@@ -214,6 +214,11 @@ static int aes_ocb_block_update(void *vctx, unsigned char *out, size_t *outl,
     if (!ctx->key_set || !update_iv(ctx))
         return 0;
 
+    if (inl == 0) {
+        *outl = 0;
+        return 1;
+    }
+
     /* Are we dealing with AAD or normal data here? */
     if (out == NULL) {
         buf = ctx->aad_buf;