Signed overshift all across the library
guidovranken opened this issue · comments
I reported this to secure@microsoft.com (per your explicit request to report potential security bugs there, I personally don't care), but they don't understand what I'm talking about.
The problem is that you don't perform the necessary casting:
SymCrypt/inc/symcrypt_internal.h
Line 524 in 263e3e6
/mnt/2tb/cf-symcrypt/SymCrypt/lib/3des.c:207:10: runtime error: left shift of 241 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/3des.c:208:10: runtime error: left shift of 253 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/3des.c:366:9: runtime error: left shift of 225 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/3des.c:367:9: runtime error: left shift of 236 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/3des.c:486:9: runtime error: left shift of 187 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/3des.c:487:9: runtime error: left shift of 232 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-c.c:206:64: runtime error: left shift of 204 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-c.c:212:65: runtime error: left shift of 150 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-c.c:218:65: runtime error: left shift of 160 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-c.c:224:65: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-c.c:327:51: runtime error: left shift of 247 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-c.c:333:52: runtime error: left shift of 167 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-c.c:339:52: runtime error: left shift of 144 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-c.c:345:52: runtime error: left shift of 185 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-key.c:122:17: runtime error: left shift of 216 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-key.c:122:57: runtime error: left shift of 212 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-key.c:153:17: runtime error: left shift of 129 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-key.c:153:57: runtime error: left shift of 207 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-key.c:173:13: runtime error: left shift of 226 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-key.c:173:53: runtime error: left shift of 156 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-key.c:93:17: runtime error: left shift of 251 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aes-key.c:93:57: runtime error: left shift of 201 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/aescmac.c:193:47: runtime error: null pointer passed as argument 2, which is declared to never be null
/mnt/2tb/cf-symcrypt/SymCrypt/lib/blockciphermodes.c:296:9: runtime error: left shift of 163 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/blockciphermodes.c:296:9: runtime error: left shift of 250 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:220:9: runtime error: left shift of 192 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:221:9: runtime error: left shift of 167 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:222:9: runtime error: left shift of 141 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:223:9: runtime error: left shift of 164 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:224:9: runtime error: left shift of 166 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:225:9: runtime error: left shift of 143 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:226:9: runtime error: left shift of 191 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:227:9: runtime error: left shift of 135 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:228:9: runtime error: left shift of 232 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:229:9: runtime error: left shift of 189 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:230:9: runtime error: left shift of 217 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:231:9: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:232:9: runtime error: left shift of 237 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:233:9: runtime error: left shift of 201 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:234:9: runtime error: left shift of 145 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/chacha20.c:235:9: runtime error: left shift of 249 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/gcm.c:246:14: runtime error: left shift of 220 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/ghash.c:47:10: runtime error: left shift of 147 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/ghash.c:47:10: runtime error: left shift of 210 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/ghash.c:48:10: runtime error: left shift of 140 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/ghash.c:48:10: runtime error: left shift of 236 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/ghash.c:96:17: runtime error: left shift of 133 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/hkdf.c:114:12: runtime error: null pointer passed as argument 1, which is declared to never be null
/mnt/2tb/cf-symcrypt/SymCrypt/lib/hmac_pattern.c:63:25: runtime error: null pointer passed as argument 2, which is declared to never be null
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:255:9: runtime error: left shift of 234 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:256:9: runtime error: left shift of 155 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:257:9: runtime error: left shift of 170 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:258:9: runtime error: left shift of 145 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:259:9: runtime error: left shift of 234 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:260:9: runtime error: left shift of 163 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:261:9: runtime error: left shift of 147 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:262:9: runtime error: left shift of 134 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:263:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:264:9: runtime error: left shift of 154 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:265:9: runtime error: left shift of 246 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:266:9: runtime error: left shift of 154 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:267:9: runtime error: left shift of 215 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:268:9: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:269:9: runtime error: left shift of 223 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md4.c:270:9: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:316:9: runtime error: left shift of 251 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:317:9: runtime error: left shift of 214 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:318:9: runtime error: left shift of 186 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:319:9: runtime error: left shift of 142 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:320:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:321:9: runtime error: left shift of 133 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:322:9: runtime error: left shift of 225 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:323:9: runtime error: left shift of 254 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:324:9: runtime error: left shift of 212 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:325:9: runtime error: left shift of 229 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:326:9: runtime error: left shift of 251 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:327:9: runtime error: left shift of 254 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:328:9: runtime error: left shift of 203 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:329:9: runtime error: left shift of 229 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:330:9: runtime error: left shift of 237 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/md5.c:331:9: runtime error: left shift of 186 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sc_lib.h:424:21: runtime error: left shift of 194 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:252:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:253:9: runtime error: left shift of 180 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:254:9: runtime error: left shift of 236 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:255:9: runtime error: left shift of 142 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:256:9: runtime error: left shift of 154 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:257:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:258:9: runtime error: left shift of 200 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:259:9: runtime error: left shift of 189 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:260:9: runtime error: left shift of 253 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:261:9: runtime error: left shift of 226 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:262:9: runtime error: left shift of 132 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:263:9: runtime error: left shift of 200 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:264:9: runtime error: left shift of 227 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:265:9: runtime error: left shift of 253 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:266:9: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha1.c:267:9: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:596:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:597:9: runtime error: left shift of 237 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:598:9: runtime error: left shift of 168 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:599:9: runtime error: left shift of 242 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:600:9: runtime error: left shift of 176 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:601:9: runtime error: left shift of 165 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:602:9: runtime error: left shift of 240 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:603:9: runtime error: left shift of 240 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:604:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:605:9: runtime error: left shift of 134 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:606:9: runtime error: left shift of 178 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:607:9: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:608:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:609:9: runtime error: left shift of 148 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:610:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha256.c:611:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:657:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:657:9: runtime error: left shift of 201 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:658:9: runtime error: left shift of 213 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:658:9: runtime error: left shift of 226 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:659:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:659:9: runtime error: left shift of 189 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:660:9: runtime error: left shift of 141 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:660:9: runtime error: left shift of 232 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:661:9: runtime error: left shift of 151 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:661:9: runtime error: left shift of 252 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:662:9: runtime error: left shift of 158 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:662:9: runtime error: left shift of 171 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:663:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:663:9: runtime error: left shift of 200 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:664:9: runtime error: left shift of 180 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:664:9: runtime error: left shift of 254 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:665:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:666:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:666:9: runtime error: left shift of 212 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:667:9: runtime error: left shift of 253 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:667:9: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:668:9: runtime error: left shift of 212 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:669:9: runtime error: left shift of 154 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:669:9: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:670:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:670:9: runtime error: left shift of 159 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:671:9: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:671:9: runtime error: left shift of 133 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:672:9: runtime error: left shift of 147 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/sha512.c:672:9: runtime error: left shift of 236 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/tlsprf.c:334:19: runtime error: null pointer passed as argument 2, which is declared to never be null
/mnt/2tb/cf-symcrypt/SymCrypt/lib/tlsprf.c:336:19: runtime error: null pointer passed as argument 2, which is declared to never be null
/mnt/2tb/cf-symcrypt/SymCrypt/lib/xtsaes.c:784:17: runtime error: left shift of 224 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/xtsaes.c:784:17: runtime error: left shift of 244 by 24 places cannot be represented in type 'int'
/mnt/2tb/cf-symcrypt/SymCrypt/lib/xtsaes.c:785:17: runtime error: left shift of 225 by 24 places cannot be represented in type 'int'
Thank you for this report. This is not a security issue, which is probably why the people at secure@microsoft.com<mailto:secure@microsoft.com> didn’t know what to do.
Looking at the specs of the C language, I see that the byte value is promoted to an int, and the left shift by 24 of a byte value >= 128 makes the value larger than can be represented in a signed int, it would need an unsigned int. In fact, C only guarantees that int is 16 bits long, so this code is even more flawed.
The right fix will be to insert casts to UINT32; the shift operations are well-defined on unsigned 32-bit values.
I don’t think this is urgent, so I’ll fix it the next time I’m changing things.
Thanks again,
Niels
I believe this is resolved in the latest push.