~ubuntu-branches/ubuntu/utopic/openssl/utopic

« back to all changes in this revision

Viewing changes to .pc/valgrind.patch/crypto/rand/md_rand.c

  • Committer: Package Import Robot
  • Author(s): Kurt Roeckx
  • Date: 2012-03-19 18:23:32 UTC
  • mfrom: (1.2.6)
  • mto: This revision was merged to the branch mainline in revision 64.
  • Revision ID: package-import@ubuntu.com-20120319182332-q4zgqvw51ahauk27
Tags: 1.0.1-1
* New upstream version
  - Remove kfreebsd-pipe.patch, fixed upstream
  - Update pic.patch, openssl-pod-misspell.patch and make-targets.patch
  - Add OPENSSL_1.0.1 to version-script.patch and libssl1.0.0.symbols for
    the new functions.
  - AES-NI support (Closes: #644743)
* pic.patch: upstream made OPENSSL_ia32cap_P and OPENSSL_cpuid_setup
  hidden on amd64, no need to access it PIC anymore.
* pic.patch: Make OPENSSL_ia32cap_P hidden on i386 too (Closes: #663977)
* Enable hardening using dpkg-buildflags (Closes: #653495)
* s_client and s_server were forcing SSLv3 only connection when SSLv2 was
  disabled instead of the SSLv2 with upgrade method.  (Closes: #664454)
* Add Beaks on openssh < 1:5.9p1-4, it has a too strict version check.

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
 *
110
110
 */
111
111
 
 
112
#define OPENSSL_FIPSEVP
 
113
 
112
114
#ifdef MD_RAND_DEBUG
113
115
# ifndef NDEBUG
114
116
#   define NDEBUG
157
159
static void ssleay_rand_cleanup(void);
158
160
static void ssleay_rand_seed(const void *buf, int num);
159
161
static void ssleay_rand_add(const void *buf, int num, double add_entropy);
160
 
static int ssleay_rand_bytes(unsigned char *buf, int num);
 
162
static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo);
 
163
static int ssleay_rand_nopseudo_bytes(unsigned char *buf, int num);
161
164
static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num);
162
165
static int ssleay_rand_status(void);
163
166
 
164
167
RAND_METHOD rand_ssleay_meth={
165
168
        ssleay_rand_seed,
166
 
        ssleay_rand_bytes,
 
169
        ssleay_rand_nopseudo_bytes,
167
170
        ssleay_rand_cleanup,
168
171
        ssleay_rand_add,
169
172
        ssleay_rand_pseudo_bytes,
328
331
        ssleay_rand_add(buf, num, (double)num);
329
332
        }
330
333
 
331
 
static int ssleay_rand_bytes(unsigned char *buf, int num)
 
334
static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo)
332
335
        {
333
336
        static volatile int stirred_pool = 0;
334
337
        int i,j,k,st_num,st_idx;
517
520
        EVP_MD_CTX_cleanup(&m);
518
521
        if (ok)
519
522
                return(1);
520
 
        else
 
523
        else if (pseudo)
 
524
                return 0;
 
525
        else 
521
526
                {
522
527
                RANDerr(RAND_F_SSLEAY_RAND_BYTES,RAND_R_PRNG_NOT_SEEDED);
523
528
                ERR_add_error_data(1, "You need to read the OpenSSL FAQ, "
526
531
                }
527
532
        }
528
533
 
 
534
static int ssleay_rand_nopseudo_bytes(unsigned char *buf, int num)
 
535
        {
 
536
        return ssleay_rand_bytes(buf, num, 0);
 
537
        }
 
538
 
529
539
/* pseudo-random bytes that are guaranteed to be unique but not
530
540
   unpredictable */
531
541
static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num) 
532
542
        {
533
 
        int ret;
534
 
        unsigned long err;
535
 
 
536
 
        ret = RAND_bytes(buf, num);
537
 
        if (ret == 0)
538
 
                {
539
 
                err = ERR_peek_error();
540
 
                if (ERR_GET_LIB(err) == ERR_LIB_RAND &&
541
 
                    ERR_GET_REASON(err) == RAND_R_PRNG_NOT_SEEDED)
542
 
                        ERR_clear_error();
543
 
                }
544
 
        return (ret);
 
543
        return ssleay_rand_bytes(buf, num, 1);
545
544
        }
546
545
 
547
546
static int ssleay_rand_status(void)