diff options
author | Nils Larsch <nils@openssl.org> | 2006-02-08 19:16:33 +0000 |
---|---|---|
committer | Nils Larsch <nils@openssl.org> | 2006-02-08 19:16:33 +0000 |
commit | 22d1087e16cff731d27c890f84757652d98303c1 (patch) | |
tree | 5a788aea06a917bd9913bc6d14546dc8e62ed576 /engines/e_cswift.c | |
parent | 9f85fcefdce92ea8746937f20f9f2fbe384c2095 (diff) |
backport recent changes from the cvs head
Diffstat (limited to 'engines/e_cswift.c')
-rw-r--r-- | engines/e_cswift.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/engines/e_cswift.c b/engines/e_cswift.c index e67379e23e..bc65179846 100644 --- 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; + 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 || @@ -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); } - 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: |