Commit 7aee873
committed
cmac.c: optimize make_kn and move zero_iv to const segment.
Backport
openssl/openssl@03cf7e7
to fix the following k1 stringop-overflow:
In function 'make_kn',
inlined from 'make_kn' at crypto/cmac/cmac.c:81:13,
inlined from 'CMAC_Init' at crypto/cmac/cmac.c:205:9:
crypto/cmac/cmac.c:92:20: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
92 | k1[bl - 1] ^= bl == 16 ? 0x87 : 0x1b;
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
crypto/cmac/cmac.c: In function 'CMAC_Init':
crypto/cmac/cmac.c:69:19: note: at offset [-2147483649, -1] into destination object 'k1' of size 32
69 | unsigned char k1[EVP_MAX_BLOCK_LENGTH];
| ^~
Fixes:
- http://autobuild.buildroot.org/results/97b6333cdc7bad24aba7af1b04890679e0058299
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>1 parent 126a07e commit 7aee873
1 file changed
+8
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
90 | 90 | | |
91 | | - | |
92 | | - | |
| 91 | + | |
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
| |||
151 | 150 | | |
152 | 151 | | |
153 | 152 | | |
154 | | - | |
| 153 | + | |
155 | 154 | | |
156 | 155 | | |
157 | 156 | | |
| |||
0 commit comments