projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check for selftest failure in various places.
[openssl.git]
/
crypto
/
ecdsa
/
ecs_sign.c
diff --git
a/crypto/ecdsa/ecs_sign.c
b/crypto/ecdsa/ecs_sign.c
index 4667c8cfcc4e7ca5849d7814310d23ac7707b786..353d5af5146def603242fb1af0090c67fc714842 100644
(file)
--- a/
crypto/ecdsa/ecs_sign.c
+++ b/
crypto/ecdsa/ecs_sign.c
@@
-53,32
+53,47
@@
*
*/
*
*/
-#include "ec
dsa
.h"
+#include "ec
s_locl
.h"
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
#endif
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
#endif
+#include <openssl/rand.h>
-ECDSA_SIG * ECDSA_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey)
+ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey)
+{
+ return ECDSA_do_sign_ex(dgst, dlen, NULL, NULL, eckey);
+}
+
+ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst, int dlen,
+ const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey)
{
ECDSA_DATA *ecdsa = ecdsa_check(eckey);
if (ecdsa == NULL)
return NULL;
{
ECDSA_DATA *ecdsa = ecdsa_check(eckey);
if (ecdsa == NULL)
return NULL;
- return ecdsa->meth->ecdsa_do_sign(dgst, dlen, eckey);
+ return ecdsa->meth->ecdsa_do_sign(dgst, dlen,
kinv, rp,
eckey);
}
int ECDSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char
*sig, unsigned int *siglen, EC_KEY *eckey)
}
int ECDSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char
*sig, unsigned int *siglen, EC_KEY *eckey)
+{
+ return ECDSA_sign_ex(type, dgst, dlen, sig, siglen, NULL, NULL, eckey);
+}
+
+int ECDSA_sign_ex(int type, const unsigned char *dgst, int dlen, unsigned char
+ *sig, unsigned int *siglen, const BIGNUM *kinv, const BIGNUM *r,
+ EC_KEY *eckey)
{
ECDSA_SIG *s;
{
ECDSA_SIG *s;
- s=ECDSA_do_sign(dgst,dlen,eckey);
+ RAND_seed(dgst, dlen);
+ s = ECDSA_do_sign_ex(dgst, dlen, kinv, r, eckey);
if (s == NULL)
{
*siglen=0;
if (s == NULL)
{
*siglen=0;
- return
(0)
;
+ return
0
;
}
}
- *siglen
=i2d_ECDSA_SIG(s,
&sig);
+ *siglen
= i2d_ECDSA_SIG(s,
&sig);
ECDSA_SIG_free(s);
ECDSA_SIG_free(s);
- return
(1)
;
+ return
1
;
}
int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,
}
int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,