projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update from 0.9.8 stable. Eliminate duplicate error codes.
[oweals/openssl.git]
/
crypto
/
ecdsa
/
ecs_sign.c
diff --git
a/crypto/ecdsa/ecs_sign.c
b/crypto/ecdsa/ecs_sign.c
index 215da1211a4610ba80f9c99f7926ad4a34fb8e68..74b1fe8caff4d9816a3088dde7627113c1af742f 100644
(file)
--- a/
crypto/ecdsa/ecs_sign.c
+++ b/
crypto/ecdsa/ecs_sign.c
@@
-53,30
+53,45
@@
*
*/
*
*/
-#include "ecdsa.h"
+#include "ecs_locl.h"
+#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
#include <openssl/engine.h>
+#endif
-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);
+ 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,