Make sure we handle input NULL with length 0
[openssl.git] / providers / implementations / ciphers / cipher_aes_wrp.c
index 028676943e33308e5f9870c8d11510de041d0ff2..5dedde748a65efef705eeedeccf1a9960fc6a307 100644 (file)
@@ -164,6 +164,11 @@ static int aes_wrap_cipher(void *vctx,
     PROV_AES_WRAP_CTX *ctx = (PROV_AES_WRAP_CTX *)vctx;
     size_t len;
 
+    if (inl == 0) {
+        *outl = 0;
+        return 1;
+    }
+
     if (outsize < inl) {
         ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
         return -1;