Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/bls/bls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ void CBLSSecretKey::MakeNewKey()
GetStrongRandBytes({buf, sizeof(buf)});
try {
impl = bls::PrivateKey::FromBytes(bls::Bytes(reinterpret_cast<const uint8_t*>(buf), SerSize));
if (impl == bls::PrivateKey()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I don't think that's quite possible situation even, should it still be here?

continue;
}
break;
} catch (...) {
}
Expand Down
5 changes: 5 additions & 0 deletions src/bls/bls.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ class CBLSWrapper
} else {
try {
impl = ImplType::FromBytes(bls::Bytes(vecBytes.data(), vecBytes.size()), specificLegacyScheme);
if (impl == ImplType()) {
Reset();
cachedHash.SetNull();
return;
}
fValid = true;
} catch (...) {
Reset();
Expand Down
Loading