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

« back to all changes in this revision

Viewing changes to security/nss/lib/ssl/derive.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:
36
36
 * the terms of any one of the MPL, the GPL or the LGPL.
37
37
 *
38
38
 * ***** END LICENSE BLOCK ***** */
39
 
/* $Id: derive.c,v 1.3.6.2 2006/02/03 22:31:45 wtchang%redhat.com Exp $ */
 
39
/* $Id: derive.c,v 1.3.6.3 2006/09/01 21:03:19 kaie%kuix.de Exp $ */
40
40
 
41
41
#include "ssl.h"        /* prereq to sslimpl.h */
42
42
#include "certt.h"      /* prereq to sslimpl.h */
52
52
    result->type = siBuffer;
53
53
    result->data = keyBlock;
54
54
    result->len  = keyLen;
 
55
    PRINT_BUF(100, (NULL, "key value", keyBlock, keyLen));
55
56
}
56
57
#else
57
58
#define buildSSLKey(keyBlock, keyLen, result) \
59
60
    (result)->type = siBuffer; \
60
61
    (result)->data = keyBlock; \
61
62
    (result)->len  = keyLen; \
 
63
    PRINT_BUF(100, (NULL, "key value", keyBlock, keyLen)); \
62
64
}
63
65
#endif
64
66
 
122
124
        return rv;
123
125
    }
124
126
 
 
127
    PRINT_BUF(100, (NULL, "Master Secret", pwSpec->msItem.data, 
 
128
                                           pwSpec->msItem.len));
 
129
 
125
130
    /* figure out how much is needed */
126
131
    macSize    = pwSpec->mac_size;
127
132
    keySize    = cipher_def->key_size;
153
158
    crsr.len    = sizeof crsrdata;
154
159
    PORT_Memcpy(crsrdata, cr, SSL3_RANDOM_LENGTH);
155
160
    PORT_Memcpy(crsrdata + SSL3_RANDOM_LENGTH, sr, SSL3_RANDOM_LENGTH);
 
161
    PRINT_BUF(100, (NULL, "Key & MAC CRSR", crsr.data, crsr.len));
156
162
 
157
163
    /*
158
164
     * generate the key material:
203
209
    }
204
210
    PORT_Assert(block_bytes >= block_needed);
205
211
    PORT_Assert(block_bytes <= sizeof pwSpec->key_block);
 
212
    PRINT_BUF(100, (NULL, "key block", key_block, block_bytes));
206
213
 
207
214
    /*
208
215
     * Put the key material where it goes.
395
402
 
396
403
 
397
404
/* derive the Master Secret from the PMS */
398
 
/* Presently, this is only done wtih RSA PMS, os isRSA is always true. */
 
405
/* Presently, this is only done wtih RSA PMS, and only on the server side,
 
406
 * so isRSA is always true. 
 
407
 */
399
408
SECStatus
400
409
ssl3_MasterKeyDeriveBypass( 
401
410
    ssl3CipherSpec *      pwSpec,
434
443
    crsr.len    = sizeof crsrdata;
435
444
    PORT_Memcpy(crsrdata, cr, SSL3_RANDOM_LENGTH);
436
445
    PORT_Memcpy(crsrdata + SSL3_RANDOM_LENGTH, sr, SSL3_RANDOM_LENGTH);
 
446
    PRINT_BUF(100, (NULL, "Master Secret CRSR", crsr.data, crsr.len));
437
447
 
438
448
    /* finally do the key gen */
439
449
    if (isTLS) {
474
484
                SSL3_MASTER_SECRET_LENGTH);
475
485
    pwSpec->msItem.data = pwSpec->raw_master_secret;
476
486
    pwSpec->msItem.len  = SSL3_MASTER_SECRET_LENGTH;
 
487
    PRINT_BUF(100, (NULL, "Master Secret", pwSpec->msItem.data, 
 
488
                                           pwSpec->msItem.len));
477
489
 
478
490
    return rv;
479
491
}