From 0896865a33becf87a974a1e9c2422608d205a362 Mon Sep 17 00:00:00 2001 From: Kazuho Oku Date: Fri, 10 Feb 2023 09:28:38 +0900 Subject: [PATCH] since #310, only the openssl backend has been added the capability to detect supplied `key` being NULL, but how is that intended to work? --- lib/openssl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/openssl.c b/lib/openssl.c index 71b33aeff..3278f3dbc 100644 --- a/lib/openssl.c +++ b/lib/openssl.c @@ -1095,10 +1095,6 @@ static int aead_setup_crypto(ptls_aead_context_t *_ctx, int is_enc, const void * struct aead_crypto_context_t *ctx = (struct aead_crypto_context_t *)_ctx; int ret; - memcpy(ctx->static_iv, iv, ctx->super.algo->iv_size); - if (key == NULL) - return 0; - ctx->super.dispose_crypto = aead_dispose_crypto; ctx->super.do_xor_iv = aead_xor_iv; if (is_enc) { @@ -1138,6 +1134,8 @@ static int aead_setup_crypto(ptls_aead_context_t *_ctx, int is_enc, const void * goto Error; } + memcpy(ctx->static_iv, iv, ctx->super.algo->iv_size); + return 0; Error: