OLD | NEW |
1 /* tlsprfalg.c - TLS Pseudo Random Function (PRF) implementation | 1 /* tlsprfalg.c - TLS Pseudo Random Function (PRF) implementation |
2 * | 2 * |
3 * This Source Code Form is subject to the terms of the Mozilla Public | 3 * This Source Code Form is subject to the terms of the Mozilla Public |
4 * License, v. 2.0. If a copy of the MPL was not distributed with this | 4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 /* $Id: tlsprfalg.c,v 1.8 2012/04/25 14:49:43 gerv%gerv.net Exp $ */ | 6 /* $Id: tlsprfalg.c,v 1.9 2012/06/26 22:27:29 rrelyea%redhat.com Exp $ */ |
7 | 7 |
8 #ifdef FREEBL_NO_DEPEND | 8 #ifdef FREEBL_NO_DEPEND |
9 #include "stubs.h" | 9 #include "stubs.h" |
10 #endif | 10 #endif |
11 | 11 |
12 #include "sechash.h" | 12 #include "blapi.h" |
| 13 #include "hasht.h" |
13 #include "alghmac.h" | 14 #include "alghmac.h" |
14 #include "blapi.h" | |
15 | 15 |
16 | 16 |
17 #define PHASH_STATE_MAX_LEN HASH_LENGTH_MAX | 17 #define PHASH_STATE_MAX_LEN HASH_LENGTH_MAX |
18 | 18 |
19 /* TLS P_hash function */ | 19 /* TLS P_hash function */ |
20 SECStatus | 20 SECStatus |
21 TLS_P_hash(HASH_HashType hashType, const SECItem *secret, const char *label, | 21 TLS_P_hash(HASH_HashType hashType, const SECItem *secret, const char *label, |
22 SECItem *seed, SECItem *result, PRBool isFIPS) | 22 SECItem *seed, SECItem *result, PRBool isFIPS) |
23 { | 23 { |
24 unsigned char state[PHASH_STATE_MAX_LEN]; | 24 unsigned char state[PHASH_STATE_MAX_LEN]; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 result->data[i] ^= tmp.data[i]; | 128 result->data[i] ^= tmp.data[i]; |
129 | 129 |
130 rv = SECSuccess; | 130 rv = SECSuccess; |
131 | 131 |
132 loser: | 132 loser: |
133 if (tmp.data != NULL) | 133 if (tmp.data != NULL) |
134 PORT_ZFree(tmp.data, tmp.len); | 134 PORT_ZFree(tmp.data, tmp.len); |
135 return rv; | 135 return rv; |
136 } | 136 } |
137 | 137 |
OLD | NEW |