Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dmitry Baryshkov
nettle
Commits
4045691d
Commit
4045691d
authored
Oct 30, 2001
by
Niels Möller
Browse files
Bug fixes.
Rev: src/nettle/rsa-compat.c:1.2
parent
68f53d70
Changes
1
Hide whitespace changes
Inline
Side-by-side
rsa-compat.c
View file @
4045691d
...
...
@@ -25,6 +25,7 @@
#include
"rsa-compat.h"
#include
"bignum.h"
#include
"md5.h"
int
...
...
@@ -75,10 +76,10 @@ R_SignFinal(R_SIGNATURE_CTX *ctx,
nettle_mpz_init_set_str_256
(
k
.
c
,
MAX_RSA_MODULUS_LEN
,
key
->
coefficient
);
if
(
rsa_init_private_key
(
&
k
)
&&
(
k
.
size
<=
MAX_RSA_MODULUS_LEN
))
if
(
rsa_init_private_key
(
&
k
)
&&
(
k
.
pub
.
size
<=
MAX_RSA_MODULUS_LEN
))
{
*
length
=
k
->
size
;
rsa_md5_sign
(
&
k
ey
,
&
ctx
->
hash
,
signature
);
*
length
=
k
.
pub
.
size
;
rsa_md5_sign
(
&
k
,
&
ctx
->
hash
,
signature
);
res
=
RE_SUCCESS
;
}
else
...
...
@@ -124,9 +125,9 @@ R_VerifyFinal(R_SIGNATURE_CTX *ctx,
nettle_mpz_init_set_str_256
(
k
.
n
,
MAX_RSA_MODULUS_LEN
,
key
->
modulus
);
nettle_mpz_init_set_str_256
(
k
.
e
,
MAX_RSA_MODULUS_LEN
,
key
->
publicE
xponent
);
MAX_RSA_MODULUS_LEN
,
key
->
e
xponent
);
if
(
rsa_init_p
rivate
_key
(
&
k
)
&&
(
k
.
size
==
length
))
if
(
rsa_init_p
ublic
_key
(
&
k
)
&&
(
k
.
size
==
length
))
res
=
rsa_md5_verify
(
&
k
,
&
ctx
->
hash
,
signature
)
?
RE_SUCCESS
:
RE_SIGNATURE
;
else
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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