Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Nettle
nettle
Commits
11540d02
Commit
11540d02
authored
Jan 03, 2017
by
Nikos Mavrogiannopoulos
Committed by
Niels Möller
Jan 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ecdsa_verify: eliminated memory leak on error path
parent
f8ad54fa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
ecdsa-verify.c
ecdsa-verify.c
+3
-1
No files found.
ecdsa-verify.c
View file @
11540d02
...
@@ -52,7 +52,7 @@ ecdsa_verify (const struct ecc_point *pub,
...
@@ -52,7 +52,7 @@ ecdsa_verify (const struct ecc_point *pub,
/* For ECC_MUL_A_WBITS == 0, at most 1512 bytes. With
/* For ECC_MUL_A_WBITS == 0, at most 1512 bytes. With
ECC_MUL_A_WBITS == 4, currently needs 67 * ecc->size, at most
ECC_MUL_A_WBITS == 4, currently needs 67 * ecc->size, at most
4824 bytes. Don't use stack allocation for this. */
4824 bytes. Don't use stack allocation for this. */
mp_limb_t
*
scratch
=
gmp_alloc_limbs
(
itch
)
;
mp_limb_t
*
scratch
;
int
res
;
int
res
;
#define rp scratch
#define rp scratch
...
@@ -63,6 +63,8 @@ ecdsa_verify (const struct ecc_point *pub,
...
@@ -63,6 +63,8 @@ ecdsa_verify (const struct ecc_point *pub,
||
mpz_sgn
(
signature
->
s
)
<=
0
||
mpz_size
(
signature
->
s
)
>
size
)
||
mpz_sgn
(
signature
->
s
)
<=
0
||
mpz_size
(
signature
->
s
)
>
size
)
return
0
;
return
0
;
scratch
=
gmp_alloc_limbs
(
itch
);
mpz_limbs_copy
(
rp
,
signature
->
r
,
size
);
mpz_limbs_copy
(
rp
,
signature
->
r
,
size
);
mpz_limbs_copy
(
sp
,
signature
->
s
,
size
);
mpz_limbs_copy
(
sp
,
signature
->
s
,
size
);
...
...
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