We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0395b6b commit 60d5d5bCopy full SHA for 60d5d5b
1 file changed
crypto/rand_extra/getentropy_test.cc
@@ -54,12 +54,16 @@ TEST(GetEntropyTest, NotObviouslyBroken) {
54
memcpy(buf3, buf1, sizeof(buf3));
55
EXPECT_EQ(getentropy(buf1, sizeof(buf1)), 0);
56
EXPECT_NE(Bytes(buf1), Bytes(buf3));
57
- errno = 0;
58
- uint8_t toobig[257];
59
// getentropy should fail returning -1 and setting errno to EIO if you request
60
// more than 256 bytes of entropy. macOS's man page says EIO but it actually
61
// returns EINVAL, so we accept either.
+ // Note: Emscripten's getentropy implementation does not enforce the 256-byte
+ // limit, so we skip this check on WASM.
62
+#if !defined(OPENSSL_WASM)
63
+ errno = 0;
64
+ uint8_t toobig[257];
65
EXPECT_EQ(getentropy(toobig, 257), -1);
66
EXPECT_TRUE(errno == EIO || errno == EINVAL);
67
+#endif
68
}
69
#endif
0 commit comments