Skip to content

Commit 74b026f

Browse files
committed
Add runtime checking for DECLASSIFY flag
1 parent 5e2e6fc commit 74b026f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/secp256k1.c

+6
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ size_t secp256k1_context_preallocated_size(unsigned int flags) {
9999
return 0;
100100
}
101101

102+
if (EXPECT(!SECP256K1_CHECKMEM_RUNNING() && (flags & SECP256K1_FLAGS_BIT_CONTEXT_DECLASSIFY), 0)) {
103+
secp256k1_callback_call(&default_illegal_callback,
104+
"Declassify flag requires running with memory checking");
105+
return 0;
106+
}
107+
102108
return ret;
103109
}
104110

0 commit comments

Comments
 (0)