Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[openssl backend] remove unnecessary check #466

Merged
merged 1 commit into from
Feb 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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