Merge pull request #466 from h2o/kazuho/unused-code-in-openssl-aead-init
[openssl backend] remove unnecessary check
diff --git a/lib/openssl.c b/lib/openssl.c
index 71b33ae..3278f3d 100644
--- a/lib/openssl.c
+++ b/lib/openssl.c
@@ -1095,10 +1095,6 @@
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 @@
goto Error;
}
+ memcpy(ctx->static_iv, iv, ctx->super.algo->iv_size);
+
return 0;
Error: