(clientRandom, serverRandom, publicKey []byte, namedCurve elliptic.Curve)
| 27 | } |
| 28 | |
| 29 | func valueKeyMessage(clientRandom, serverRandom, publicKey []byte, namedCurve elliptic.Curve) []byte { |
| 30 | serverECDHParams := make([]byte, 4) |
| 31 | serverECDHParams[0] = 3 // named curve |
| 32 | binary.BigEndian.PutUint16(serverECDHParams[1:], uint16(namedCurve)) |
| 33 | //nolint:gosec // G115, no risk of overflow, the biggest supported curve is 97 bytes. |
| 34 | serverECDHParams[3] = byte(len(publicKey)) |
| 35 | |
| 36 | plaintext := []byte{} |
| 37 | plaintext = append(plaintext, clientRandom...) |
| 38 | plaintext = append(plaintext, serverRandom...) |
| 39 | plaintext = append(plaintext, serverECDHParams...) |
| 40 | plaintext = append(plaintext, publicKey...) |
| 41 | |
| 42 | return plaintext |
| 43 | } |
| 44 | |
| 45 | // validateSignatureAlgOID validates that the signature scheme matches the |
| 46 | // certificate's public key algorithm OID. This is required by RFC 8446 Section 4.2.3: |
no outgoing calls
searching dependent graphs…