Skip to content

Commit

Permalink
Merge pull request #466 from h2o/kazuho/unused-code-in-openssl-aead-init
Browse files Browse the repository at this point in the history
[openssl backend] remove unnecessary check
  • Loading branch information
kazuho authored Feb 10, 2023
2 parents 0fd05a6 + 0896865 commit e905c95
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit e905c95

Please sign in to comment.