X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=providers%2Fimplementations%2Fciphers%2Fcipher_aes_wrp.c;h=0de2a5f651f1f7b5d2451e5aaf9a817a00ea860e;hb=2888fc1590ad31633be7a99e7288dcecd35e800c;hp=9eaec163187337a2c464fc8f8ee530a3aac71185;hpb=ddd21319e94636f308e115fd05cc48e7a8eadc55;p=oweals%2Fopenssl.git diff --git a/providers/implementations/ciphers/cipher_aes_wrp.c b/providers/implementations/ciphers/cipher_aes_wrp.c index 9eaec16318..0de2a5f651 100644 --- a/providers/implementations/ciphers/cipher_aes_wrp.c +++ b/providers/implementations/ciphers/cipher_aes_wrp.c @@ -7,6 +7,12 @@ * https://www.openssl.org/source/license.html */ +/* + * This file uses the low level AES functions (which are deprecated for + * non-internal use) in order to implement provider AES ciphers. + */ +#include "internal/deprecated.h" + #include "cipher_aes.h" #include "prov/providercommonerr.h" #include "prov/implementations.h" @@ -16,9 +22,8 @@ #define AES_WRAP_NOPAD_IVLEN 8 /* TODO(3.0) Figure out what flags need to be passed */ -#define WRAP_FLAGS (EVP_CIPH_WRAP_MODE \ - | EVP_CIPH_CUSTOM_IV | EVP_CIPH_FLAG_CUSTOM_CIPHER \ - | EVP_CIPH_ALWAYS_CALL_INIT) +#define WRAP_FLAGS (EVP_CIPH_WRAP_MODE | EVP_CIPH_CUSTOM_IV \ + | EVP_CIPH_ALWAYS_CALL_INIT) typedef size_t (*aeswrap_fn)(void *key, const unsigned char *iv, unsigned char *out, const unsigned char *in, @@ -165,6 +170,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;