diff options
Diffstat (limited to 'providers/implementations/ciphers/cipher_des.c')
-rw-r--r-- | providers/implementations/ciphers/cipher_des.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/providers/implementations/ciphers/cipher_des.c b/providers/implementations/ciphers/cipher_des.c index 32cab17b3e..9010ce9099 100644 --- a/providers/implementations/ciphers/cipher_des.c +++ b/providers/implementations/ciphers/cipher_des.c @@ -71,7 +71,8 @@ static void des_freectx(void *vctx) } static int des_init(void *vctx, const unsigned char *key, size_t keylen, - const unsigned char *iv, size_t ivlen, int enc) + const unsigned char *iv, size_t ivlen, + const OSSL_PARAM params[], int enc) { PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx; @@ -92,21 +93,24 @@ static int des_init(void *vctx, const unsigned char *key, size_t keylen, ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH); return 0; } - return ctx->hw->init(ctx, key, keylen); + if (!ctx->hw->init(ctx, key, keylen)) + return 0; } - return 1; + return ossl_cipher_generic_set_ctx_params(ctx, params); } static int des_einit(void *vctx, const unsigned char *key, size_t keylen, - const unsigned char *iv, size_t ivlen) + const unsigned char *iv, size_t ivlen, + const OSSL_PARAM params[]) { - return des_init(vctx, key, keylen, iv, ivlen, 1); + return des_init(vctx, key, keylen, iv, ivlen, params, 1); } static int des_dinit(void *vctx, const unsigned char *key, size_t keylen, - const unsigned char *iv, size_t ivlen) + const unsigned char *iv, size_t ivlen, + const OSSL_PARAM params[]) { - return des_init(vctx, key, keylen, iv, ivlen, 0); + return des_init(vctx, key, keylen, iv, ivlen, params, 0); } static int des_generatekey(PROV_CIPHER_CTX *ctx, void *ptr) |