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

« back to all changes in this revision

Viewing changes to crypto/cms/cms_pwri.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:
231
231
        return 0;
232
232
    }
233
233
    tmp = OPENSSL_malloc(inlen);
234
 
    if(!tmp)
 
234
    if (!tmp)
235
235
        return 0;
236
236
    /* setup IV by decrypting last two blocks */
237
237
    EVP_DecryptUpdate(ctx, tmp + inlen - 2 * blocklen, &outl,
297
297
        out[3] = in[2] ^ 0xFF;
298
298
        memcpy(out + 4, in, inlen);
299
299
        /* Add random padding to end */
300
 
        if (olen > inlen + 4)
301
 
            RAND_pseudo_bytes(out + 4 + inlen, olen - 4 - inlen);
 
300
        if (olen > inlen + 4
 
301
            && RAND_pseudo_bytes(out + 4 + inlen, olen - 4 - inlen) < 0)
 
302
            return 0;
302
303
        /* Encrypt twice */
303
304
        EVP_EncryptUpdate(ctx, out, &dummy, out, olen);
304
305
        EVP_EncryptUpdate(ctx, out, &dummy, out, olen);