Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
defunctec
crown-core
Commits
fafcbf0d
Commit
fafcbf0d
authored
13 years ago
by
Pieter Wuille
Browse files
Options
Download
Email Patches
Plain Diff
Fix #650: CKey::SetSecret BIGNUM leak
parent
de1a4d95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/key.h
+4
-1
src/key.h
with
4 additions
and
1 deletion
+4
-1
src/key.h
View file @
fafcbf0d
...
...
@@ -141,10 +141,13 @@ public:
if
(
vchSecret
.
size
()
!=
32
)
throw
key_error
(
"CKey::SetSecret() : secret must be 32 bytes"
);
BIGNUM
*
bn
=
BN_bin2bn
(
&
vchSecret
[
0
],
32
,
BN_new
());
if
(
bn
==
NULL
)
if
(
bn
==
NULL
)
throw
key_error
(
"CKey::SetSecret() : BN_bin2bn failed"
);
if
(
!
EC_KEY_regenerate_key
(
pkey
,
bn
))
{
BN_clear_free
(
bn
);
throw
key_error
(
"CKey::SetSecret() : EC_KEY_regenerate_key failed"
);
}
BN_clear_free
(
bn
);
fSet
=
true
;
if
(
fCompressed
||
fCompressedPubKey
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help