prf10 implements the TLS 1.0 pseudo-random function, as defined in RFC 2246, Section 5.
(result, secret, label, seed []byte)
| 46 | |
| 47 | // prf10 implements the TLS 1.0 pseudo-random function, as defined in RFC 2246, Section 5. |
| 48 | func prf10(result, secret, label, seed []byte) { |
| 49 | hashSHA1 := sha1.New |
| 50 | hashMD5 := md5.New |
| 51 | |
| 52 | labelAndSeed := make([]byte, len(label)+len(seed)) |
| 53 | copy(labelAndSeed, label) |
| 54 | copy(labelAndSeed[len(label):], seed) |
| 55 | |
| 56 | s1, s2 := splitPreMasterSecret(secret) |
| 57 | pHash(result, s1, labelAndSeed, hashMD5) |
| 58 | result2 := make([]byte, len(result)) |
| 59 | pHash(result2, s2, labelAndSeed, hashSHA1) |
| 60 | |
| 61 | for i, b := range result2 { |
| 62 | result[i] ^= b |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | // prf12 implements the TLS 1.2 pseudo-random function, as defined in RFC 5246, Section 5. |
| 67 | func prf12(hashFunc func() hash.Hash) func(result, secret, label, seed []byte) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…