2015-10-21 05:03:22 +02:00
|
|
|
/* Private header file of libSSL.
|
|
|
|
* Various and sundry protocol constants. DON'T CHANGE THESE. These
|
|
|
|
* values are defined by the SSL 3.0 protocol specification.
|
|
|
|
*
|
2018-05-04 16:08:28 +02:00
|
|
|
* 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/. */
|
2015-10-21 05:03:22 +02:00
|
|
|
|
|
|
|
#ifndef __ssl3proto_h_
|
|
|
|
#define __ssl3proto_h_
|
|
|
|
|
2018-05-04 16:08:28 +02:00
|
|
|
typedef PRUint8 SSL3Opaque;
|
2015-10-21 05:03:22 +02:00
|
|
|
|
2018-05-04 16:08:28 +02:00
|
|
|
typedef PRUint16 SSL3ProtocolVersion;
|
2015-10-21 05:03:22 +02:00
|
|
|
/* version numbers are defined in sslproto.h */
|
|
|
|
|
cherry-picked mozilla NSS upstream changes (to rev 902bc119dcdb, which is on par with 3.17.2):
bug920719, bug1026148, bug1028647, bug963150, bug1030486, bug1025729, bug836658, bug1028582, bug1038728, bug1038526, bug1042634, bug1047210, bug1043891, bug1043108, bug1046735, bug1043082, bug1036735, bug1046718, bug1050107, bug1054625, bug1057465, bug1057476, bug1041326, bug1058933, bug1064636, bug1057161, bug1078669, bug1049435, bug1070493, bug1083360, bug1028764, bug1065990, bug1073330, bug1064670, bug1094650
2018-07-11 15:35:15 +02:00
|
|
|
/* The TLS 1.3 draft version. Used to avoid negotiating
|
|
|
|
* between incompatible pre-standard TLS 1.3 drafts.
|
|
|
|
* TODO(ekr@rtfm.com): Remove when TLS 1.3 is published. */
|
|
|
|
#define TLS_1_3_DRAFT_VERSION 3
|
|
|
|
|
2018-05-04 16:08:28 +02:00
|
|
|
typedef PRUint16 ssl3CipherSuite;
|
2015-10-21 05:03:22 +02:00
|
|
|
/* The cipher suites are defined in sslproto.h */
|
|
|
|
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
#define MAX_CERT_TYPES 10
|
|
|
|
#define MAX_COMPRESSION_METHODS 10
|
|
|
|
#define MAX_MAC_LENGTH 64
|
|
|
|
#define MAX_PADDING_LENGTH 64
|
|
|
|
#define MAX_KEY_LENGTH 64
|
|
|
|
#define EXPORT_KEY_LENGTH 5
|
|
|
|
#define SSL3_RANDOM_LENGTH 32
|
2015-10-21 05:03:22 +02:00
|
|
|
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
#define SSL3_RECORD_HEADER_LENGTH 5
|
2015-10-21 05:03:22 +02:00
|
|
|
|
2018-05-04 16:08:28 +02:00
|
|
|
/* SSL3_RECORD_HEADER_LENGTH + epoch/sequence_number */
|
|
|
|
#define DTLS_RECORD_HEADER_LENGTH 13
|
|
|
|
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
#define MAX_FRAGMENT_LENGTH 16384
|
|
|
|
|
2015-10-21 05:03:22 +02:00
|
|
|
typedef enum {
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
content_change_cipher_spec = 20,
|
2015-10-21 05:03:22 +02:00
|
|
|
content_alert = 21,
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
content_handshake = 22,
|
2015-10-21 05:03:22 +02:00
|
|
|
content_application_data = 23
|
|
|
|
} SSL3ContentType;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
SSL3ContentType type;
|
|
|
|
SSL3ProtocolVersion version;
|
2018-05-04 16:08:28 +02:00
|
|
|
PRUint16 length;
|
2015-10-21 05:03:22 +02:00
|
|
|
SECItem fragment;
|
|
|
|
} SSL3Plaintext;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
SSL3ContentType type;
|
|
|
|
SSL3ProtocolVersion version;
|
2018-05-04 16:08:28 +02:00
|
|
|
PRUint16 length;
|
2015-10-21 05:03:22 +02:00
|
|
|
SECItem fragment;
|
|
|
|
} SSL3Compressed;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
SECItem content;
|
|
|
|
SSL3Opaque MAC[MAX_MAC_LENGTH];
|
|
|
|
} SSL3GenericStreamCipher;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
SECItem content;
|
|
|
|
SSL3Opaque MAC[MAX_MAC_LENGTH];
|
2018-05-04 16:08:28 +02:00
|
|
|
PRUint8 padding[MAX_PADDING_LENGTH];
|
|
|
|
PRUint8 padding_length;
|
2015-10-21 05:03:22 +02:00
|
|
|
} SSL3GenericBlockCipher;
|
|
|
|
|
|
|
|
typedef enum { change_cipher_spec_choice = 1 } SSL3ChangeCipherSpecChoice;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
SSL3ChangeCipherSpecChoice choice;
|
|
|
|
} SSL3ChangeCipherSpec;
|
|
|
|
|
|
|
|
typedef enum { alert_warning = 1, alert_fatal = 2 } SSL3AlertLevel;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
close_notify = 0,
|
|
|
|
unexpected_message = 10,
|
|
|
|
bad_record_mac = 20,
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
decryption_failed_RESERVED = 21, /* do not send; see RFC 5246 */
|
|
|
|
record_overflow = 22, /* TLS only */
|
2015-10-21 05:03:22 +02:00
|
|
|
decompression_failure = 30,
|
|
|
|
handshake_failure = 40,
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
no_certificate = 41, /* SSL3 only, NOT TLS */
|
2015-10-21 05:03:22 +02:00
|
|
|
bad_certificate = 42,
|
|
|
|
unsupported_certificate = 43,
|
|
|
|
certificate_revoked = 44,
|
|
|
|
certificate_expired = 45,
|
|
|
|
certificate_unknown = 46,
|
|
|
|
illegal_parameter = 47,
|
|
|
|
|
|
|
|
/* All alerts below are TLS only. */
|
|
|
|
unknown_ca = 48,
|
|
|
|
access_denied = 49,
|
|
|
|
decode_error = 50,
|
|
|
|
decrypt_error = 51,
|
|
|
|
export_restriction = 60,
|
|
|
|
protocol_version = 70,
|
|
|
|
insufficient_security = 71,
|
|
|
|
internal_error = 80,
|
cherry-picked mozilla NSS upstream changes (to rev 902bc119dcdb, which is on par with 3.17.2):
bug920719, bug1026148, bug1028647, bug963150, bug1030486, bug1025729, bug836658, bug1028582, bug1038728, bug1038526, bug1042634, bug1047210, bug1043891, bug1043108, bug1046735, bug1043082, bug1036735, bug1046718, bug1050107, bug1054625, bug1057465, bug1057476, bug1041326, bug1058933, bug1064636, bug1057161, bug1078669, bug1049435, bug1070493, bug1083360, bug1028764, bug1065990, bug1073330, bug1064670, bug1094650
2018-07-11 15:35:15 +02:00
|
|
|
inappropriate_fallback = 86, /* could also be sent for SSLv3 */
|
2015-10-21 05:03:22 +02:00
|
|
|
user_canceled = 90,
|
|
|
|
no_renegotiation = 100,
|
|
|
|
|
|
|
|
/* Alerts for client hello extensions */
|
|
|
|
unsupported_extension = 110,
|
|
|
|
certificate_unobtainable = 111,
|
|
|
|
unrecognized_name = 112,
|
|
|
|
bad_certificate_status_response = 113,
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
bad_certificate_hash_value = 114,
|
|
|
|
no_application_protocol = 120
|
2015-10-21 05:03:22 +02:00
|
|
|
|
|
|
|
} SSL3AlertDescription;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
SSL3AlertLevel level;
|
|
|
|
SSL3AlertDescription description;
|
|
|
|
} SSL3Alert;
|
|
|
|
|
|
|
|
typedef enum {
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
hello_request = 0,
|
|
|
|
client_hello = 1,
|
|
|
|
server_hello = 2,
|
2018-05-04 16:08:28 +02:00
|
|
|
hello_verify_request = 3,
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
new_session_ticket = 4,
|
|
|
|
certificate = 11,
|
2015-10-21 05:03:22 +02:00
|
|
|
server_key_exchange = 12,
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
certificate_request = 13,
|
|
|
|
server_hello_done = 14,
|
|
|
|
certificate_verify = 15,
|
|
|
|
client_key_exchange = 16,
|
|
|
|
finished = 20,
|
2018-05-04 16:08:28 +02:00
|
|
|
certificate_status = 22,
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
next_proto = 67
|
2015-10-21 05:03:22 +02:00
|
|
|
} SSL3HandshakeType;
|
|
|
|
|
|
|
|
typedef struct {
|
2018-05-04 16:08:28 +02:00
|
|
|
PRUint8 empty;
|
2015-10-21 05:03:22 +02:00
|
|
|
} SSL3HelloRequest;
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
|
2015-10-21 05:03:22 +02:00
|
|
|
typedef struct {
|
|
|
|
SSL3Opaque rand[SSL3_RANDOM_LENGTH];
|
|
|
|
} SSL3Random;
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
|
2015-10-21 05:03:22 +02:00
|
|
|
typedef struct {
|
|
|
|
SSL3Opaque id[32];
|
2018-05-04 16:08:28 +02:00
|
|
|
PRUint8 length;
|
2015-10-21 05:03:22 +02:00
|
|
|
} SSL3SessionID;
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
|
2015-10-21 05:03:22 +02:00
|
|
|
typedef struct {
|
|
|
|
SSL3ProtocolVersion client_version;
|
|
|
|
SSL3Random random;
|
|
|
|
SSL3SessionID session_id;
|
|
|
|
SECItem cipher_suites;
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
PRUint8 cm_count;
|
2018-05-04 16:08:28 +02:00
|
|
|
SSLCompressionMethod compression_methods[MAX_COMPRESSION_METHODS];
|
2015-10-21 05:03:22 +02:00
|
|
|
} SSL3ClientHello;
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
|
2015-10-21 05:03:22 +02:00
|
|
|
typedef struct {
|
|
|
|
SSL3ProtocolVersion server_version;
|
|
|
|
SSL3Random random;
|
|
|
|
SSL3SessionID session_id;
|
|
|
|
ssl3CipherSuite cipher_suite;
|
2018-05-04 16:08:28 +02:00
|
|
|
SSLCompressionMethod compression_method;
|
2015-10-21 05:03:22 +02:00
|
|
|
} SSL3ServerHello;
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
|
2015-10-21 05:03:22 +02:00
|
|
|
typedef struct {
|
|
|
|
SECItem list;
|
|
|
|
} SSL3Certificate;
|
|
|
|
|
|
|
|
/* SSL3SignType moved to ssl.h */
|
|
|
|
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
/* The SSL key exchange method used */
|
2015-10-21 05:03:22 +02:00
|
|
|
typedef enum {
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
kea_null,
|
|
|
|
kea_rsa,
|
2015-10-21 05:03:22 +02:00
|
|
|
kea_rsa_export,
|
|
|
|
kea_rsa_export_1024,
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
kea_dh_dss,
|
|
|
|
kea_dh_dss_export,
|
|
|
|
kea_dh_rsa,
|
2015-10-21 05:03:22 +02:00
|
|
|
kea_dh_rsa_export,
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
kea_dhe_dss,
|
|
|
|
kea_dhe_dss_export,
|
|
|
|
kea_dhe_rsa,
|
2015-10-21 05:03:22 +02:00
|
|
|
kea_dhe_rsa_export,
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
kea_dh_anon,
|
|
|
|
kea_dh_anon_export,
|
2015-10-21 05:03:22 +02:00
|
|
|
kea_rsa_fips,
|
|
|
|
kea_ecdh_ecdsa,
|
|
|
|
kea_ecdhe_ecdsa,
|
|
|
|
kea_ecdh_rsa,
|
|
|
|
kea_ecdhe_rsa,
|
|
|
|
kea_ecdh_anon
|
|
|
|
} SSL3KeyExchangeAlgorithm;
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
|
2015-10-21 05:03:22 +02:00
|
|
|
typedef struct {
|
|
|
|
SECItem modulus;
|
|
|
|
SECItem exponent;
|
|
|
|
} SSL3ServerRSAParams;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
SECItem p;
|
|
|
|
SECItem g;
|
|
|
|
SECItem Ys;
|
|
|
|
} SSL3ServerDHParams;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
union {
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
SSL3ServerDHParams dh;
|
|
|
|
SSL3ServerRSAParams rsa;
|
2015-10-21 05:03:22 +02:00
|
|
|
} u;
|
|
|
|
} SSL3ServerParams;
|
|
|
|
|
2018-05-04 16:08:28 +02:00
|
|
|
/* SSL3HashesIndividually contains a combination MD5/SHA1 hash, as used in TLS
|
|
|
|
* prior to 1.2. */
|
|
|
|
typedef struct {
|
|
|
|
PRUint8 md5[16];
|
|
|
|
PRUint8 sha[20];
|
|
|
|
} SSL3HashesIndividually;
|
|
|
|
|
|
|
|
/* SSL3Hashes contains an SSL hash value. The digest is contained in |u.raw|
|
cherry-picked mozilla NSS upstream changes (to rev bad5fd065fa1, which is on par with 3.20):
bug1001332, 56b691c003ad, bug1086145, bug1054069, bug1155922, bug991783, bug1125025, bug1162521, bug1162644, bug1132941, bug1164364, bug1166205, bug1166163, bug1166515, bug1138554, bug1167046, bug1167043, bug1169451, bug1172128, bug1170322, bug102794, bug1128184, bug557830, bug1174648, bug1180244, bug1177784, bug1173413, bug1169174, bug1084669, bug951455, bug1183395, bug1177430, bug1183827, bug1160139, bug1154106, bug1142209, bug1185033, bug1193467, bug1182667(with sha512 changes backed out, which breaks VC6 compilation), bug1158489, bug337796
2018-07-12 15:44:51 +02:00
|
|
|
* which, if |hashAlg==ssl_hash_none| is also a SSL3HashesIndividually
|
2018-05-04 16:08:28 +02:00
|
|
|
* struct. */
|
|
|
|
typedef struct {
|
|
|
|
unsigned int len;
|
cherry-picked mozilla NSS upstream changes (to rev bad5fd065fa1, which is on par with 3.20):
bug1001332, 56b691c003ad, bug1086145, bug1054069, bug1155922, bug991783, bug1125025, bug1162521, bug1162644, bug1132941, bug1164364, bug1166205, bug1166163, bug1166515, bug1138554, bug1167046, bug1167043, bug1169451, bug1172128, bug1170322, bug102794, bug1128184, bug557830, bug1174648, bug1180244, bug1177784, bug1173413, bug1169174, bug1084669, bug951455, bug1183395, bug1177430, bug1183827, bug1160139, bug1154106, bug1142209, bug1185033, bug1193467, bug1182667(with sha512 changes backed out, which breaks VC6 compilation), bug1158489, bug337796
2018-07-12 15:44:51 +02:00
|
|
|
SSLHashType hashAlg;
|
2018-05-04 16:08:28 +02:00
|
|
|
union {
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
PRUint8 raw[64];
|
|
|
|
SSL3HashesIndividually s;
|
2018-05-04 16:08:28 +02:00
|
|
|
} u;
|
2015-10-21 05:03:22 +02:00
|
|
|
} SSL3Hashes;
|
2018-05-04 16:08:28 +02:00
|
|
|
|
2015-10-21 05:03:22 +02:00
|
|
|
typedef struct {
|
|
|
|
union {
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
SSL3Opaque anonymous;
|
|
|
|
SSL3Hashes certified;
|
2015-10-21 05:03:22 +02:00
|
|
|
} u;
|
|
|
|
} SSL3ServerKeyExchange;
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
|
2015-10-21 05:03:22 +02:00
|
|
|
typedef enum {
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
ct_RSA_sign = 1,
|
|
|
|
ct_DSS_sign = 2,
|
|
|
|
ct_RSA_fixed_DH = 3,
|
|
|
|
ct_DSS_fixed_DH = 4,
|
|
|
|
ct_RSA_ephemeral_DH = 5,
|
2015-10-21 05:03:22 +02:00
|
|
|
ct_DSS_ephemeral_DH = 6,
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
ct_ECDSA_sign = 64,
|
|
|
|
ct_RSA_fixed_ECDH = 65,
|
|
|
|
ct_ECDSA_fixed_ECDH = 66
|
2015-10-21 05:03:22 +02:00
|
|
|
|
|
|
|
} SSL3ClientCertificateType;
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
|
2015-10-21 05:03:22 +02:00
|
|
|
typedef SECItem *SSL3DistinquishedName;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
SSL3Opaque client_version[2];
|
|
|
|
SSL3Opaque random[46];
|
|
|
|
} SSL3RSAPreMasterSecret;
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
|
2015-10-21 05:03:22 +02:00
|
|
|
typedef SECItem SSL3EncryptedPreMasterSecret;
|
|
|
|
|
|
|
|
|
|
|
|
typedef SSL3Opaque SSL3MasterSecret[48];
|
|
|
|
|
|
|
|
typedef enum { implicit, explicit } SSL3PublicValueEncoding;
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
|
2015-10-21 05:03:22 +02:00
|
|
|
typedef struct {
|
|
|
|
union {
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
SSL3Opaque implicit;
|
|
|
|
SECItem explicit;
|
2015-10-21 05:03:22 +02:00
|
|
|
} dh_public;
|
|
|
|
} SSL3ClientDiffieHellmanPublic;
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
|
2015-10-21 05:03:22 +02:00
|
|
|
typedef struct {
|
|
|
|
union {
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
SSL3EncryptedPreMasterSecret rsa;
|
|
|
|
SSL3ClientDiffieHellmanPublic diffie_helman;
|
2015-10-21 05:03:22 +02:00
|
|
|
} exchange_keys;
|
|
|
|
} SSL3ClientKeyExchange;
|
|
|
|
|
|
|
|
typedef SSL3Hashes SSL3PreSignedCertificateVerify;
|
|
|
|
|
|
|
|
typedef SECItem SSL3CertificateVerify;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
sender_client = 0x434c4e54,
|
|
|
|
sender_server = 0x53525652
|
|
|
|
} SSL3Sender;
|
|
|
|
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
typedef SSL3HashesIndividually SSL3Finished;
|
2015-10-21 05:03:22 +02:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
SSL3Opaque verify_data[12];
|
|
|
|
} TLSFinished;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* TLS extension related data structures and constants.
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
*/
|
2015-10-21 05:03:22 +02:00
|
|
|
|
|
|
|
/* SessionTicket extension related data structures. */
|
|
|
|
|
|
|
|
/* NewSessionTicket handshake message. */
|
|
|
|
typedef struct {
|
2018-05-04 16:08:28 +02:00
|
|
|
PRUint32 received_timestamp;
|
|
|
|
PRUint32 ticket_lifetime_hint;
|
|
|
|
SECItem ticket;
|
2015-10-21 05:03:22 +02:00
|
|
|
} NewSessionTicket;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
CLIENT_AUTH_ANONYMOUS = 0,
|
|
|
|
CLIENT_AUTH_CERTIFICATE = 1
|
|
|
|
} ClientAuthenticationType;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
ClientAuthenticationType client_auth_type;
|
|
|
|
union {
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
SSL3Opaque *certificate_list;
|
2015-10-21 05:03:22 +02:00
|
|
|
} identity;
|
|
|
|
} ClientIdentity;
|
|
|
|
|
|
|
|
#define SESS_TICKET_KEY_NAME_LEN 16
|
|
|
|
#define SESS_TICKET_KEY_NAME_PREFIX "NSS!"
|
|
|
|
#define SESS_TICKET_KEY_NAME_PREFIX_LEN 4
|
|
|
|
#define SESS_TICKET_KEY_VAR_NAME_LEN 12
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
unsigned char *key_name;
|
|
|
|
unsigned char *iv;
|
|
|
|
SECItem encrypted_state;
|
|
|
|
unsigned char *mac;
|
|
|
|
} EncryptedSessionTicket;
|
|
|
|
|
cherry-picked mozilla NSS upstream changes (to rev b07697c94038, which is on par with 3.16.2):
bug753136, bug999893, bug1011090, bug1009785, bug1009794, bug421391, bug1011229, bug1013088, bug996237, bug970539, bug1016567, bug485732, bug334013, bug959864, bug1016836, bug1016811, bug1018536, bug996250, bug1009227, bug963150, bug1007126, bug952572, bug1021102, bug1020395, bug902171
2018-07-11 14:39:02 +02:00
|
|
|
#define TLS_EX_SESS_TICKET_MAC_LENGTH 32
|
2015-10-21 05:03:22 +02:00
|
|
|
|
2018-05-04 16:08:28 +02:00
|
|
|
#define TLS_STE_NO_SERVER_NAME -1
|
|
|
|
|
2015-10-21 05:03:22 +02:00
|
|
|
#endif /* __ssl3proto_h_ */
|