diff options
| author | jsing <> | 2015-06-20 12:01:14 +0000 |
|---|---|---|
| committer | jsing <> | 2015-06-20 12:01:14 +0000 |
| commit | 4fbad15f23f9774fc485f5683eaed15955f59a37 (patch) | |
| tree | d277b5bd406ae47b77e084fa58edf42d3d2d2acc /src/lib/libcrypto/evp/e_chacha20poly1305.c | |
| parent | 0e59c6900776389d4ff50bcad5b47b2b9b8b8912 (diff) | |
| download | openbsd-4fbad15f23f9774fc485f5683eaed15955f59a37.tar.gz openbsd-4fbad15f23f9774fc485f5683eaed15955f59a37.tar.bz2 openbsd-4fbad15f23f9774fc485f5683eaed15955f59a37.zip | |
Replace remaining CRYPTO_memcmp() calls with timingsafe_memcmp().
ok doug@ deraadt@
Diffstat (limited to 'src/lib/libcrypto/evp/e_chacha20poly1305.c')
| -rw-r--r-- | src/lib/libcrypto/evp/e_chacha20poly1305.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/e_chacha20poly1305.c b/src/lib/libcrypto/evp/e_chacha20poly1305.c index da1e036668..c003b0ba7f 100644 --- a/src/lib/libcrypto/evp/e_chacha20poly1305.c +++ b/src/lib/libcrypto/evp/e_chacha20poly1305.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: e_chacha20poly1305.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ | 1 | /* $OpenBSD: e_chacha20poly1305.c,v 1.9 2015/06/20 12:01:14 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014, Google Inc. | 3 | * Copyright (c) 2014, Google Inc. |
| 4 | * | 4 | * |
| @@ -200,7 +200,7 @@ aead_chacha20_poly1305_open(const EVP_AEAD_CTX *ctx, unsigned char *out, | |||
| 200 | poly1305_update_with_length(&poly1305, in, plaintext_len); | 200 | poly1305_update_with_length(&poly1305, in, plaintext_len); |
| 201 | CRYPTO_poly1305_finish(&poly1305, mac); | 201 | CRYPTO_poly1305_finish(&poly1305, mac); |
| 202 | 202 | ||
| 203 | if (CRYPTO_memcmp(mac, in + plaintext_len, c20_ctx->tag_len) != 0) { | 203 | if (timingsafe_memcmp(mac, in + plaintext_len, c20_ctx->tag_len) != 0) { |
| 204 | EVPerr(EVP_F_AEAD_CHACHA20_POLY1305_OPEN, EVP_R_BAD_DECRYPT); | 204 | EVPerr(EVP_F_AEAD_CHACHA20_POLY1305_OPEN, EVP_R_BAD_DECRYPT); |
| 205 | return 0; | 205 | return 0; |
| 206 | } | 206 | } |
