~ubuntu-branches/ubuntu/wily/openssl/wily

« back to all changes in this revision

Viewing changes to engines/e_sureware.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2015-06-15 08:17:16 UTC
  • mfrom: (11.1.62 sid)
  • Revision ID: package-import@ubuntu.com-20150615081716-ssoiott2b3v1emou
Tags: 1.0.2c-1ubuntu1
* Merge with Debian, remaining changes.
  - debian/libssl1.0.0.postinst:
    + Display a system restart required notification on libssl1.0.0
      upgrade on servers.
    + Use a different priority for libssl1.0.0/restart-services depending
      on whether a desktop, or server dist-upgrade is being performed.
  - debian/{libssl1.0.0-udeb.dirs, control, rules}: Create
    libssl1.0.0-udeb, for the benefit of wget-udeb (no wget-udeb package
    in Debian).
  - debian/{libcrypto1.0.0-udeb.dirs, libssl1.0.0.dirs, libssl1.0.0.files,
    rules}: Move runtime libraries to /lib, for the benefit of
    wpasupplicant.
  - debian/patches/perlpath-quilt.patch: Don't change perl #! paths under
    .pc.
  - debian/rules:
    + Don't run 'make test' when cross-building.
    + Use host compiler when cross-building.  Patch from Neil Williams.
    + Don't build for processors no longer supported: i586 (on i386)
    + Fix Makefile to properly clean up libs/ dirs in clean target.
    + Replace duplicate files in the doc directory with symlinks.
  - debian/control: Mark Debian Vcs-* as XS-Debian-Vcs-*
  - debian/rules: Enable optimized 64bit elliptic curve code contributed
    by Google.

Show diffs side-by-side

added added

removed removed

Lines of Context:
712
712
        /* set public big nums */
713
713
        rsatmp->e = BN_new();
714
714
        rsatmp->n = BN_new();
 
715
        if(!rsatmp->e || !rsatmp->n)
 
716
            goto err;
715
717
        bn_expand2(rsatmp->e, el / sizeof(BN_ULONG));
716
718
        bn_expand2(rsatmp->n, el / sizeof(BN_ULONG));
717
 
        if (!rsatmp->e || rsatmp->e->dmax != (int)(el / sizeof(BN_ULONG)) ||
718
 
            !rsatmp->n || rsatmp->n->dmax != (int)(el / sizeof(BN_ULONG)))
 
719
        if (rsatmp->e->dmax != (int)(el / sizeof(BN_ULONG)) ||
 
720
            rsatmp->n->dmax != (int)(el / sizeof(BN_ULONG)))
719
721
            goto err;
720
722
        ret = p_surewarehk_Load_Rsa_Pubkey(msg, key_id, el,
721
723
                                           (unsigned long *)rsatmp->n->d,
752
754
        dsatmp->p = BN_new();
753
755
        dsatmp->q = BN_new();
754
756
        dsatmp->g = BN_new();
 
757
        if(!dsatmp->pub_key || !dsatmp->p || !dsatmp->q || !dsatmp->g)
 
758
            goto err;
755
759
        bn_expand2(dsatmp->pub_key, el / sizeof(BN_ULONG));
756
760
        bn_expand2(dsatmp->p, el / sizeof(BN_ULONG));
757
761
        bn_expand2(dsatmp->q, 20 / sizeof(BN_ULONG));
758
762
        bn_expand2(dsatmp->g, el / sizeof(BN_ULONG));
759
 
        if (!dsatmp->pub_key
760
 
            || dsatmp->pub_key->dmax != (int)(el / sizeof(BN_ULONG))
761
 
            || !dsatmp->p || dsatmp->p->dmax != (int)(el / sizeof(BN_ULONG))
762
 
            || !dsatmp->q || dsatmp->q->dmax != 20 / sizeof(BN_ULONG)
763
 
            || !dsatmp->g || dsatmp->g->dmax != (int)(el / sizeof(BN_ULONG)))
 
763
        if (dsatmp->pub_key->dmax != (int)(el / sizeof(BN_ULONG))
 
764
            || dsatmp->p->dmax != (int)(el / sizeof(BN_ULONG))
 
765
            || dsatmp->q->dmax != 20 / sizeof(BN_ULONG)
 
766
            || dsatmp->g->dmax != (int)(el / sizeof(BN_ULONG)))
764
767
            goto err;
765
768
 
766
769
        ret = p_surewarehk_Load_Dsa_Pubkey(msg, key_id, el,
1038
1041
        }
1039
1042
        psign->r = BN_new();
1040
1043
        psign->s = BN_new();
 
1044
        if(!psign->r || !psign->s)
 
1045
            goto err;
1041
1046
        bn_expand2(psign->r, 20 / sizeof(BN_ULONG));
1042
1047
        bn_expand2(psign->s, 20 / sizeof(BN_ULONG));
1043
 
        if (!psign->r || psign->r->dmax != 20 / sizeof(BN_ULONG) ||
1044
 
            !psign->s || psign->s->dmax != 20 / sizeof(BN_ULONG))
 
1048
        if (psign->r->dmax != 20 / sizeof(BN_ULONG) ||
 
1049
            psign->s->dmax != 20 / sizeof(BN_ULONG))
1045
1050
            goto err;
1046
1051
        ret = p_surewarehk_Dsa_Sign(msg, flen, from,
1047
1052
                                    (unsigned long *)psign->r->d,
1070
1075
    char msg[64] = "ENGINE_modexp";
1071
1076
    if (!p_surewarehk_Mod_Exp) {
1072
1077
        SUREWAREerr(SUREWARE_F_SUREWAREHK_MODEXP, ENGINE_R_NOT_INITIALISED);
1073
 
    } else {
 
1078
    } else if (r) {
1074
1079
        bn_expand2(r, m->top);
1075
 
        if (r && r->dmax == m->top) {
 
1080
        if (r->dmax == m->top) {
1076
1081
            /* do it */
1077
1082
            ret = p_surewarehk_Mod_Exp(msg,
1078
1083
                                       m->top * sizeof(BN_ULONG),