diff options
author | inoguchi <> | 2022-01-22 00:43:41 +0000 |
---|---|---|
committer | inoguchi <> | 2022-01-22 00:43:41 +0000 |
commit | 8e35a088e29e2c33fce87a0ec3c3d397e101b1a1 (patch) | |
tree | 4dc8493110471719d5cb61df68ee60d53eb7f44f /src | |
parent | 82c2915a4ef786e8c35c893eeb49a303ae7ee490 (diff) | |
download | openbsd-8e35a088e29e2c33fce87a0ec3c3d397e101b1a1.tar.gz openbsd-8e35a088e29e2c33fce87a0ec3c3d397e101b1a1.tar.bz2 openbsd-8e35a088e29e2c33fce87a0ec3c3d397e101b1a1.zip |
Use memmove instead of memcpy for overlapping memory
CID 250936 251103
OK beck@ jsing@ millert@ tb@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/aes/aes_ige.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/aes/aes_ige.c b/src/lib/libcrypto/aes/aes_ige.c index 16ef5612eb..244a5a36bd 100644 --- a/src/lib/libcrypto/aes/aes_ige.c +++ b/src/lib/libcrypto/aes/aes_ige.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: aes_ige.c,v 1.7 2015/02/10 09:46:30 miod Exp $ */ | 1 | /* $OpenBSD: aes_ige.c,v 1.8 2022/01/22 00:43:41 inoguchi Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2006 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2006 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -109,8 +109,8 @@ AES_ige_encrypt(const unsigned char *in, unsigned char *out, size_t length, | |||
109 | in += AES_BLOCK_SIZE; | 109 | in += AES_BLOCK_SIZE; |
110 | out += AES_BLOCK_SIZE; | 110 | out += AES_BLOCK_SIZE; |
111 | } | 111 | } |
112 | memcpy(ivec, ivp->data, AES_BLOCK_SIZE); | 112 | memmove(ivec, ivp->data, AES_BLOCK_SIZE); |
113 | memcpy(ivec + AES_BLOCK_SIZE, iv2p->data, AES_BLOCK_SIZE); | 113 | memmove(ivec + AES_BLOCK_SIZE, iv2p->data, AES_BLOCK_SIZE); |
114 | } else { | 114 | } else { |
115 | aes_block_t tmp, tmp2; | 115 | aes_block_t tmp, tmp2; |
116 | aes_block_t iv; | 116 | aes_block_t iv; |
@@ -161,8 +161,8 @@ AES_ige_encrypt(const unsigned char *in, unsigned char *out, size_t length, | |||
161 | in += AES_BLOCK_SIZE; | 161 | in += AES_BLOCK_SIZE; |
162 | out += AES_BLOCK_SIZE; | 162 | out += AES_BLOCK_SIZE; |
163 | } | 163 | } |
164 | memcpy(ivec, ivp->data, AES_BLOCK_SIZE); | 164 | memmove(ivec, ivp->data, AES_BLOCK_SIZE); |
165 | memcpy(ivec + AES_BLOCK_SIZE, iv2p->data, AES_BLOCK_SIZE); | 165 | memmove(ivec + AES_BLOCK_SIZE, iv2p->data, AES_BLOCK_SIZE); |
166 | } else { | 166 | } else { |
167 | aes_block_t tmp, tmp2; | 167 | aes_block_t tmp, tmp2; |
168 | aes_block_t iv; | 168 | aes_block_t iv; |