~ubuntu-branches/ubuntu/gutsy/firefox/gutsy

« back to all changes in this revision

Viewing changes to security/nss/lib/ssl/ssl3con.c

  • Committer: Bazaar Package Importer
  • Author(s): Ian Jackson
  • Date: 2006-10-10 18:49:32 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20061010184932-da75izt7y0e59afq
Tags: 1.99+2.0rc2+dfsg-0ubuntu1
* New upstream version 2.0rc2.
* Fix/workaround for epiphany GtkSocket lifetype crash:
  apply patch id=241087 from Mozilla Bugzilla #241535 to fix LP #63814.
* Change application name to `Firefox', as requested by mdz.
  Files changed:
    - browser/locales/en-US/chrome/branding/brand.dtd
    - browser/locales/en-US/chrome/branding/brand.properties;
  New values:
    - brandShortName and brandFullName: `Bon Echo' => `Firefox'
    - vendorShortName: `Mozilla' => `Ubuntu'
* Make preferences dialogue fit again (bah!).

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 * the terms of any one of the MPL, the GPL or the LGPL.
40
40
 *
41
41
 * ***** END LICENSE BLOCK ***** */
42
 
/* $Id: ssl3con.c,v 1.71.14.6 2006/08/04 19:10:54 kaie%kuix.de Exp $ */
 
42
/* $Id: ssl3con.c,v 1.71.14.8 2006/09/23 19:34:07 wtchang%redhat.com Exp $ */
43
43
 
44
44
#include "nssrenam.h"
45
45
#include "cert.h"
74
74
static void      ssl3_CleanupPeerCerts(sslSocket *ss);
75
75
static PK11SymKey *ssl3_GenerateRSAPMS(sslSocket *ss, ssl3CipherSpec *spec,
76
76
                                       PK11SlotInfo * serverKeySlot);
77
 
static SECStatus ssl3_DeriveMasterSecret(sslSocket *ss, const PK11SymKey *pms);
 
77
static SECStatus ssl3_DeriveMasterSecret(sslSocket *ss, PK11SymKey *pms);
78
78
static SECStatus ssl3_DeriveConnectionKeysPKCS11(sslSocket *ss);
79
79
static SECStatus ssl3_HandshakeFailure(      sslSocket *ss);
80
80
static SECStatus ssl3_InitState(             sslSocket *ss);
2534
2534
** Called from ssl3_InitPendingCipherSpec.   prSpec is pwSpec.
2535
2535
*/
2536
2536
static SECStatus
2537
 
ssl3_DeriveMasterSecret(sslSocket *ss, const PK11SymKey *pms)
 
2537
ssl3_DeriveMasterSecret(sslSocket *ss, PK11SymKey *pms)
2538
2538
{
2539
2539
    ssl3CipherSpec *  pwSpec = ss->ssl3.pwSpec;
2540
2540
    const ssl3KEADef *kea_def= ss->ssl3.hs.kea_def;
2584
2584
    }
2585
2585
 
2586
2586
    if (pms != NULL) {
2587
 
        pwSpec->master_secret = PK11_DeriveWithFlags((PK11SymKey *)pms, 
2588
 
                                        master_derive, &params, key_derive, 
2589
 
                                        CKA_DERIVE, 0, keyFlags);
 
2587
#if defined(TRACE)
 
2588
        if (ssl_trace >= 100) {
 
2589
            SECStatus extractRV = PK11_ExtractKeyValue(pms);
 
2590
            if (extractRV == SECSuccess) {
 
2591
                SECItem * keyData = PK11_GetKeyData(pms);
 
2592
                if (keyData && keyData->data && keyData->len) {
 
2593
                    ssl_PrintBuf(ss, "Pre-Master Secret", 
 
2594
                                 keyData->data, keyData->len);
 
2595
                }
 
2596
            }
 
2597
        }
 
2598
#endif
 
2599
        pwSpec->master_secret = PK11_DeriveWithFlags(pms, master_derive, 
 
2600
                                &params, key_derive, CKA_DERIVE, 0, keyFlags);
2590
2601
        if (!isDH && pwSpec->master_secret && ss->opt.detectRollBack) {
2591
2602
            SSL3ProtocolVersion client_version;
2592
2603
            client_version = pms_version.major << 8 | pms_version.minor;
4102
4113
        goto loser;
4103
4114
    }
4104
4115
 
 
4116
#if defined(TRACE)
 
4117
    if (ssl_trace >= 100) {
 
4118
        SECStatus extractRV = PK11_ExtractKeyValue(pms);
 
4119
        if (extractRV == SECSuccess) {
 
4120
            SECItem * keyData = PK11_GetKeyData(pms);
 
4121
            if (keyData && keyData->data && keyData->len) {
 
4122
                ssl_PrintBuf(ss, "Pre-Master Secret", 
 
4123
                             keyData->data, keyData->len);
 
4124
            }
 
4125
        }
 
4126
    }
 
4127
#endif
 
4128
 
4105
4129
    /* Get the wrapped (encrypted) pre-master secret, enc_pms */
4106
4130
    enc_pms.len  = SECKEY_PublicKeyStrength(svrPubKey);
4107
4131
    enc_pms.data = (unsigned char*)PORT_Alloc(enc_pms.len);