~ubuntu-branches/ubuntu/maverick/openssl/maverick

« back to all changes in this revision

Viewing changes to engines/e_cswift.c

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2006-05-15 16:00:58 UTC
  • mto: (11.1.1 lenny)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20060515160058-pg6lnbkkpkwpdj2e
Tags: upstream-0.9.8b
ImportĀ upstreamĀ versionĀ 0.9.8b

Show diffs side-by-side

added added

removed removed

Lines of Context:
744
744
        int to_return = 0;
745
745
        const RSA_METHOD * def_rsa_method;
746
746
 
 
747
        if(!rsa->p || !rsa->q || !rsa->dmp1 || !rsa->dmq1 || !rsa->iqmp)
 
748
                {
 
749
                CSWIFTerr(CSWIFT_F_CSWIFT_RSA_MOD_EXP,CSWIFT_R_MISSING_KEY_COMPONENTS);
 
750
                goto err;
 
751
                }
 
752
 
747
753
        /* Try the limits of RSA (2048 bits) */
748
754
        if(BN_num_bytes(rsa->p) > 128 ||
749
755
                BN_num_bytes(rsa->q) > 128 ||
764
770
                        return def_rsa_method->rsa_mod_exp(r0, I, rsa, ctx);
765
771
        }
766
772
 
767
 
        if(!rsa->p || !rsa->q || !rsa->dmp1 || !rsa->dmq1 || !rsa->iqmp)
768
 
                {
769
 
                CSWIFTerr(CSWIFT_F_CSWIFT_RSA_MOD_EXP,CSWIFT_R_MISSING_KEY_COMPONENTS);
770
 
                goto err;
771
 
                }
772
773
        to_return = cswift_mod_exp_crt(r0, I, rsa->p, rsa->q, rsa->dmp1,
773
774
                rsa->dmq1, rsa->iqmp, ctx);
774
775
err:
1089
1090
                if (swrc != SW_OK)
1090
1091
                {
1091
1092
                        char tmpbuf[20];
1092
 
                        CSWIFTerr(CSWIFT_F_CSWIFT_CTRL, CSWIFT_R_REQUEST_FAILED);
 
1093
                        CSWIFTerr(CSWIFT_F_CSWIFT_RAND_BYTES, CSWIFT_R_REQUEST_FAILED);
1093
1094
                        sprintf(tmpbuf, "%ld", swrc);
1094
1095
                        ERR_add_error_data(2, "CryptoSwift error number is ", tmpbuf);
1095
1096
                        goto err;