2016-02-08 18:16:25 +03:00
|
|
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This file is PRIVATE to SSL.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef __tls13con_h_
|
|
|
|
#define __tls13con_h_
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
StaticSharedSecret,
|
|
|
|
EphemeralSharedSecret
|
|
|
|
} SharedSecretType;
|
|
|
|
|
|
|
|
SECStatus tls13_UnprotectRecord(
|
2016-02-23 02:50:19 +03:00
|
|
|
sslSocket *ss, SSL3Ciphertext *cText, sslBuffer *plaintext,
|
2016-02-08 18:16:25 +03:00
|
|
|
SSL3AlertDescription *alert);
|
|
|
|
|
|
|
|
#if defined(WIN32)
|
|
|
|
#define __func__ __FUNCTION__
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void tls13_SetHsState(sslSocket *ss, SSL3WaitState ws,
|
|
|
|
const char *func, const char *file, int line);
|
|
|
|
#define TLS13_SET_HS_STATE(ss, ws) \
|
|
|
|
tls13_SetHsState(ss, ws, __func__, __FILE__, __LINE__)
|
|
|
|
|
|
|
|
/* Return PR_TRUE if the socket is in one of the given states, else return
|
|
|
|
* PR_FALSE. Only call the macro not the function, because the trailing
|
|
|
|
* wait_invalid is needed to terminate the argument list. */
|
|
|
|
PRBool tls13_InHsState(sslSocket *ss, ...);
|
|
|
|
#define TLS13_IN_HS_STATE(ss, ...) \
|
|
|
|
tls13_InHsState(ss, __VA_ARGS__, wait_invalid)
|
|
|
|
|
|
|
|
SSLHashType tls13_GetHash(sslSocket *ss);
|
|
|
|
CK_MECHANISM_TYPE tls13_GetHkdfMechanism(sslSocket *ss);
|
|
|
|
void tls13_FatalError(sslSocket *ss, PRErrorCode prError,
|
|
|
|
SSL3AlertDescription desc);
|
|
|
|
SECStatus tls13_SetupClientHello(sslSocket *ss);
|
2016-06-30 09:42:30 +03:00
|
|
|
SECStatus tls13_MaybeDo0RTTHandshake(sslSocket *ss);
|
2016-04-12 15:40:44 +03:00
|
|
|
PRBool tls13_AllowPskCipher(const sslSocket *ss,
|
|
|
|
const ssl3CipherSuiteDef *cipher_def);
|
2016-06-02 23:33:04 +03:00
|
|
|
PRBool tls13_PskSuiteEnabled(sslSocket *ss);
|
2016-04-12 15:40:44 +03:00
|
|
|
SECStatus tls13_HandleClientHelloPart2(sslSocket *ss,
|
|
|
|
const SECItem *suites,
|
|
|
|
sslSessionID *sid);
|
|
|
|
SECStatus tls13_HandleServerHelloPart2(sslSocket *ss);
|
2016-02-08 18:16:25 +03:00
|
|
|
SECStatus tls13_HandlePostHelloHandshakeMessage(sslSocket *ss, SSL3Opaque *b,
|
|
|
|
PRUint32 length,
|
|
|
|
SSL3Hashes *hashesPtr);
|
|
|
|
void tls13_DestroyKeyShareEntry(TLS13KeyShareEntry *entry);
|
|
|
|
void tls13_DestroyKeyShares(PRCList *list);
|
2016-10-05 18:52:14 +03:00
|
|
|
SECStatus tls13_CreateKeyShare(sslSocket *ss, const sslNamedGroupDef *groupDef);
|
2016-06-30 09:42:30 +03:00
|
|
|
void tls13_DestroyEarlyData(PRCList *list);
|
2016-04-12 15:40:44 +03:00
|
|
|
void tls13_CipherSpecAddRef(ssl3CipherSpec *spec);
|
|
|
|
void tls13_CipherSpecRelease(ssl3CipherSpec *spec);
|
|
|
|
void tls13_DestroyCipherSpecs(PRCList *list);
|
2016-02-08 18:16:25 +03:00
|
|
|
PRBool tls13_ExtensionAllowed(PRUint16 extension, SSL3HandshakeType message);
|
|
|
|
SECStatus tls13_ProtectRecord(sslSocket *ss,
|
2016-04-12 15:40:44 +03:00
|
|
|
ssl3CipherSpec *cwSpec,
|
2016-02-08 18:16:25 +03:00
|
|
|
SSL3ContentType type,
|
|
|
|
const SSL3Opaque *pIn,
|
|
|
|
PRUint32 contentLen,
|
|
|
|
sslBuffer *wrBuf);
|
2016-06-30 09:42:30 +03:00
|
|
|
PRInt32 tls13_Read0RttData(sslSocket *ss, void *buf, PRInt32 len);
|
|
|
|
SECStatus tls13_HandleEndOfEarlyData(sslSocket *ss);
|
|
|
|
SECStatus tls13_HandleEarlyApplicationData(sslSocket *ss, sslBuffer *origBuf);
|
|
|
|
PRBool tls13_ClientAllow0Rtt(sslSocket *ss, const sslSessionID *sid);
|
2016-10-04 08:59:19 +03:00
|
|
|
PRUint16 tls13_EncodeDraftVersion(PRUint16 version);
|
|
|
|
PRUint16 tls13_DecodeDraftVersion(PRUint16 version);
|
|
|
|
SECStatus tls13_NegotiateVersion(sslSocket *ss,
|
|
|
|
const TLSExtension *supported_versions);
|
2016-02-08 18:16:25 +03:00
|
|
|
|
|
|
|
#endif /* __tls13con_h_ */
|