| OLD | NEW |
| (Empty) |
| 1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | |
| 2 /* | |
| 3 * This file is PRIVATE to SSL. | |
| 4 * | |
| 5 * This Source Code Form is subject to the terms of the Mozilla Public | |
| 6 * License, v. 2.0. If a copy of the MPL was not distributed with this | |
| 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
| 8 | |
| 9 #ifndef __tls13con_h_ | |
| 10 #define __tls13con_h_ | |
| 11 | |
| 12 typedef enum { | |
| 13 StaticSharedSecret, | |
| 14 EphemeralSharedSecret | |
| 15 } SharedSecretType; | |
| 16 | |
| 17 SECStatus tls13_UnprotectRecord( | |
| 18 sslSocket *ss, SSL3Ciphertext *cText, sslBuffer *plaintext, | |
| 19 SSL3AlertDescription *alert); | |
| 20 unsigned char * | |
| 21 tls13_EncodeUintX(PRUint32 value, unsigned int bytes, unsigned char *to); | |
| 22 | |
| 23 #if defined(WIN32) | |
| 24 #define __func__ __FUNCTION__ | |
| 25 #endif | |
| 26 | |
| 27 void tls13_SetHsState(sslSocket *ss, SSL3WaitState ws, | |
| 28 const char *func, const char *file, int line); | |
| 29 #define TLS13_SET_HS_STATE(ss, ws) \ | |
| 30 tls13_SetHsState(ss, ws, __func__, __FILE__, __LINE__) | |
| 31 | |
| 32 /* Return PR_TRUE if the socket is in one of the given states, else return | |
| 33 * PR_FALSE. Only call the macro not the function, because the trailing | |
| 34 * wait_invalid is needed to terminate the argument list. */ | |
| 35 PRBool tls13_InHsState(sslSocket *ss, ...); | |
| 36 #define TLS13_IN_HS_STATE(ss, ...) \ | |
| 37 tls13_InHsState(ss, __VA_ARGS__, wait_invalid) | |
| 38 | |
| 39 SSLHashType tls13_GetHash(sslSocket *ss); | |
| 40 CK_MECHANISM_TYPE tls13_GetHkdfMechanism(sslSocket *ss); | |
| 41 void tls13_FatalError(sslSocket *ss, PRErrorCode prError, | |
| 42 SSL3AlertDescription desc); | |
| 43 SECStatus tls13_SetupClientHello(sslSocket *ss); | |
| 44 SECStatus tls13_HandlePostHelloHandshakeMessage(sslSocket *ss, SSL3Opaque *b, | |
| 45 PRUint32 length, | |
| 46 SSL3Hashes *hashesPtr); | |
| 47 SECStatus tls13_HandleClientKeyShare(sslSocket *ss); | |
| 48 SECStatus tls13_SendServerHelloSequence(sslSocket *ss); | |
| 49 SECStatus tls13_HandleServerKeyShare(sslSocket *ss); | |
| 50 SECStatus tls13_AddContextToHashes(sslSocket *ss, | |
| 51 SSL3Hashes *hashes /* IN/OUT */, | |
| 52 SSLHashType algorithm, PRBool sending); | |
| 53 void tls13_DestroyKeyShareEntry(TLS13KeyShareEntry *entry); | |
| 54 void tls13_DestroyKeyShares(PRCList *list); | |
| 55 PRBool tls13_ExtensionAllowed(PRUint16 extension, SSL3HandshakeType message); | |
| 56 SECStatus tls13_ProtectRecord(sslSocket *ss, | |
| 57 SSL3ContentType type, | |
| 58 const SSL3Opaque *pIn, | |
| 59 PRUint32 contentLen, | |
| 60 sslBuffer *wrBuf); | |
| 61 | |
| 62 #endif /* __tls13con_h_ */ | |
| OLD | NEW |