Skip to content

Commit

Permalink
Add runtime checking for DECLASSIFY flag
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa committed Jan 11, 2023
1 parent 5e2e6fc commit 74b026f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/secp256k1.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ size_t secp256k1_context_preallocated_size(unsigned int flags) {
return 0;
}

if (EXPECT(!SECP256K1_CHECKMEM_RUNNING() && (flags & SECP256K1_FLAGS_BIT_CONTEXT_DECLASSIFY), 0)) {
secp256k1_callback_call(&default_illegal_callback,
"Declassify flag requires running with memory checking");
return 0;
}

return ret;
}

Expand Down

0 comments on commit 74b026f

Please sign in to comment.