~ubuntu-branches/ubuntu/hardy/nss/hardy-security

« back to all changes in this revision

Viewing changes to mozilla/security/nss/lib/freebl/drbg.c

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2010-05-18 14:50:36 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20100518145036-t5o0kz9yr83e4jjk
Tags: 3.12.6-0ubuntu0.8.04.1
* New upstream release 3.12.6 RTM (NSS_3_12_6_RTM)
  - fixes CVE-2009-3555 aka US-CERT VU#120541
* Adjust patches to changed upstream code base
  - update debian/patches/38_mips64_build.patch
  - update debian/patches/81_sonames.patch
  - update debian/patches/85_security_load.patch
* Remove patches that are merged upstream
  - delete debian/patches/91_nonexec_stack.patch
  - update debian/patches/series 
* Bump nspr dependency to 4.8
  - update debian/control
* Add new symbols for 3.12.6
  - update debian/libnss3-1d.symbols  
* Enable transitional scheme for SSL renegotiation
  - add 97_SSL_RENEGOTIATE_TRANSITIONAL.patch
  - update debian/patches/series
* Generate missing checksum for libnssdbm3.so to make FIPS mode
  work properly
  - update debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 * the terms of any one of the MPL, the GPL or the LGPL.
37
37
 *
38
38
 * ***** END LICENSE BLOCK ***** */
39
 
/* $Id: drbg.c,v 1.8 2009/04/01 03:37:29 wtc%google.com Exp $ */
 
39
/* $Id: drbg.c,v 1.9 2009/06/10 03:24:01 rrelyea%redhat.com Exp $ */
40
40
 
41
41
#ifdef FREEBL_NO_DEPEND
42
42
#include "stubs.h"
381
381
    PRUint8 bytes[PRNG_SEEDLEN*2]; /* entropy + nonce */
382
382
    unsigned int numBytes;
383
383
    if (globalrng == NULL) {
 
384
        /* bytes needs to have enough space to hold
 
385
         * a SHA256 hash value. Blow up at compile time if this isn't true */
 
386
        PR_STATIC_ASSERT(sizeof(bytes) >= SHA256_LENGTH);
384
387
        /* create a new global RNG context */
385
388
        globalrng = &theGlobalRng;
386
389
        PORT_Assert(NULL == globalrng->lock);
414
417
        /* the RNG is in a valid state */
415
418
        globalrng->isValid = PR_TRUE;
416
419
 
 
420
        /* fetch one random value so that we can populate rng->oldV for our
 
421
         * continous random number test. */
 
422
        prng_generateNewBytes(globalrng, bytes, SHA256_LENGTH, NULL, 0);
 
423
 
417
424
        /* Fetch more entropy into the PRNG */
418
425
        RNG_SystemInfoForRNG();
419
426
    }