projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix broken build
[openssl.git]
/
engines
/
e_cswift.c
diff --git
a/engines/e_cswift.c
b/engines/e_cswift.c
index d5f1d4e05f86b9490ecb0307f545d8679026cd9e..2e64ff32770dbf130d3dda10e7e465db88226045 100644
(file)
--- a/
engines/e_cswift.c
+++ b/
engines/e_cswift.c
@@
-744,6
+744,12
@@
static int cswift_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx
int to_return = 0;
const RSA_METHOD * def_rsa_method;
int to_return = 0;
const RSA_METHOD * def_rsa_method;
+ if(!rsa->p || !rsa->q || !rsa->dmp1 || !rsa->dmq1 || !rsa->iqmp)
+ {
+ CSWIFTerr(CSWIFT_F_CSWIFT_RSA_MOD_EXP,CSWIFT_R_MISSING_KEY_COMPONENTS);
+ goto err;
+ }
+
/* Try the limits of RSA (2048 bits) */
if(BN_num_bytes(rsa->p) > 128 ||
BN_num_bytes(rsa->q) > 128 ||
/* Try the limits of RSA (2048 bits) */
if(BN_num_bytes(rsa->p) > 128 ||
BN_num_bytes(rsa->q) > 128 ||
@@
-764,11
+770,6
@@
static int cswift_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx
return def_rsa_method->rsa_mod_exp(r0, I, rsa, ctx);
}
return def_rsa_method->rsa_mod_exp(r0, I, rsa, ctx);
}
- if(!rsa->p || !rsa->q || !rsa->dmp1 || !rsa->dmq1 || !rsa->iqmp)
- {
- CSWIFTerr(CSWIFT_F_CSWIFT_RSA_MOD_EXP,CSWIFT_R_MISSING_KEY_COMPONENTS);
- goto err;
- }
to_return = cswift_mod_exp_crt(r0, I, rsa->p, rsa->q, rsa->dmp1,
rsa->dmq1, rsa->iqmp, ctx);
err:
to_return = cswift_mod_exp_crt(r0, I, rsa->p, rsa->q, rsa->dmp1,
rsa->dmq1, rsa->iqmp, ctx);
err:
@@
-810,7
+811,6
@@
static DSA_SIG *cswift_dsa_sign(const unsigned char *dgst, int dlen, DSA *dsa)
SW_PARAM sw_param;
SW_STATUS sw_status;
SW_LARGENUMBER arg, res;
SW_PARAM sw_param;
SW_STATUS sw_status;
SW_LARGENUMBER arg, res;
- unsigned char *ptr;
BN_CTX *ctx;
BIGNUM *dsa_p = NULL;
BIGNUM *dsa_q = NULL;
BN_CTX *ctx;
BIGNUM *dsa_p = NULL;
BIGNUM *dsa_q = NULL;
@@
-898,7
+898,6
@@
static DSA_SIG *cswift_dsa_sign(const unsigned char *dgst, int dlen, DSA *dsa)
goto err;
}
/* Convert the response */
goto err;
}
/* Convert the response */
- ptr = (unsigned char *)result->d;
if((to_return = DSA_SIG_new()) == NULL)
goto err;
to_return->r = BN_bin2bn((unsigned char *)result->d, 20, NULL);
if((to_return = DSA_SIG_new()) == NULL)
goto err;
to_return->r = BN_bin2bn((unsigned char *)result->d, 20, NULL);
@@
-1089,7
+1088,7
@@
static int cswift_rand_bytes(unsigned char *buf, int num)
if (swrc != SW_OK)
{
char tmpbuf[20];
if (swrc != SW_OK)
{
char tmpbuf[20];
- CSWIFTerr(CSWIFT_F_CSWIFT_
CTRL
, CSWIFT_R_REQUEST_FAILED);
+ CSWIFTerr(CSWIFT_F_CSWIFT_
RAND_BYTES
, CSWIFT_R_REQUEST_FAILED);
sprintf(tmpbuf, "%ld", swrc);
ERR_add_error_data(2, "CryptoSwift error number is ", tmpbuf);
goto err;
sprintf(tmpbuf, "%ld", swrc);
ERR_add_error_data(2, "CryptoSwift error number is ", tmpbuf);
goto err;