9 #include "../sf/service.h"
13 SslServiceType_Default = 0,
14 SslServiceType_System = 1,
19 SslCaCertificateId_All = -1,
21 SslCaCertificateId_NintendoCAG3 = 1,
22 SslCaCertificateId_NintendoClass2CAG3 = 2,
23 SslCaCertificateId_NintendoRootCAG4 = 3,
25 SslCaCertificateId_AmazonRootCA1 = 1000,
26 SslCaCertificateId_StarfieldServicesRootCertificateAuthorityG2 = 1001,
27 SslCaCertificateId_AddTrustExternalCARoot = 1002,
28 SslCaCertificateId_COMODOCertificationAuthority = 1003,
29 SslCaCertificateId_UTNDATACorpSGC = 1004,
30 SslCaCertificateId_UTNUSERFirstHardware = 1005,
31 SslCaCertificateId_BaltimoreCyberTrustRoot = 1006,
32 SslCaCertificateId_CybertrustGlobalRoot = 1007,
33 SslCaCertificateId_VerizonGlobalRootCA = 1008,
34 SslCaCertificateId_DigiCertAssuredIDRootCA = 1009,
35 SslCaCertificateId_DigiCertAssuredIDRootG2 = 1010,
36 SslCaCertificateId_DigiCertGlobalRootCA = 1011,
37 SslCaCertificateId_DigiCertGlobalRootG2 = 1012,
38 SslCaCertificateId_DigiCertHighAssuranceEVRootCA = 1013,
39 SslCaCertificateId_EntrustnetCertificationAuthority2048 = 1014,
40 SslCaCertificateId_EntrustRootCertificationAuthority = 1015,
41 SslCaCertificateId_EntrustRootCertificationAuthorityG2 = 1016,
42 SslCaCertificateId_GeoTrustGlobalCA2 = 1017,
43 SslCaCertificateId_GeoTrustGlobalCA = 1018,
44 SslCaCertificateId_GeoTrustPrimaryCertificationAuthorityG3 = 1019,
45 SslCaCertificateId_GeoTrustPrimaryCertificationAuthority = 1020,
46 SslCaCertificateId_GlobalSignRootCA = 1021,
47 SslCaCertificateId_GlobalSignRootCAR2 = 1022,
48 SslCaCertificateId_GlobalSignRootCAR3 = 1023,
49 SslCaCertificateId_GoDaddyClass2CertificationAuthority = 1024,
50 SslCaCertificateId_GoDaddyRootCertificateAuthorityG2 = 1025,
51 SslCaCertificateId_StarfieldClass2CertificationAuthority = 1026,
52 SslCaCertificateId_StarfieldRootCertificateAuthorityG2 = 1027,
53 SslCaCertificateId_thawtePrimaryRootCAG3 = 1028,
54 SslCaCertificateId_thawtePrimaryRootCA = 1029,
55 SslCaCertificateId_VeriSignClass3PublicPrimaryCertificationAuthorityG3 = 1030,
56 SslCaCertificateId_VeriSignClass3PublicPrimaryCertificationAuthorityG5 = 1031,
57 SslCaCertificateId_VeriSignUniversalRootCertificationAuthority = 1032,
58 SslCaCertificateId_DSTRootCAX3 = 1033,
59 SslCaCertificateId_USERTrustRsaCertificationAuthority = 1034,
60 SslCaCertificateId_ISRGRootX10 = 1035,
61 SslCaCertificateId_USERTrustEccCertificationAuthority = 1036,
62 SslCaCertificateId_COMODORsaCertificationAuthority = 1037,
63 SslCaCertificateId_COMODOEccCertificationAuthority = 1038,
64 SslCaCertificateId_AmazonRootCA2 = 1039,
65 SslCaCertificateId_AmazonRootCA3 = 1040,
66 SslCaCertificateId_AmazonRootCA4 = 1041,
67 SslCaCertificateId_DigiCertAssuredIDRootG3 = 1042,
68 SslCaCertificateId_DigiCertGlobalRootG3 = 1043,
69 SslCaCertificateId_DigiCertTrustedRootG4 = 1044,
70 SslCaCertificateId_EntrustRootCertificationAuthorityEC1 = 1045,
71 SslCaCertificateId_EntrustRootCertificationAuthorityG4 = 1046,
72 SslCaCertificateId_GlobalSignECCRootCAR4 = 1047,
73 SslCaCertificateId_GlobalSignECCRootCAR5 = 1048,
74 SslCaCertificateId_GlobalSignECCRootCAR6 = 1049,
75 SslCaCertificateId_GTSRootR1 = 1050,
76 SslCaCertificateId_GTSRootR2 = 1051,
77 SslCaCertificateId_GTSRootR3 = 1052,
78 SslCaCertificateId_GTSRootR4 = 1053,
79 SslCaCertificateId_SecurityCommunicationRootCA = 1054,
80 SslCaCertificateId_GlobalSignRootE4 = 1055,
81 SslCaCertificateId_GlobalSignRootR4 = 1056,
82 SslCaCertificateId_TTeleSecGlobalRootClass2 = 1057,
83 SslCaCertificateId_DigiCertTLSECCP384RootG5 = 1058,
84 SslCaCertificateId_DigiCertTLSRSA4096RootG5 = 1059,
89 SslTrustedCertStatus_Invalid = -1,
90 SslTrustedCertStatus_Removed = 0,
91 SslTrustedCertStatus_EnabledTrusted = 1,
92 SslTrustedCertStatus_EnabledNotTrusted = 2,
93 SslTrustedCertStatus_Revoked = 3,
94 } SslTrustedCertStatus;
98 SslFlushSessionCacheOptionType_SingleHost = 0,
99 SslFlushSessionCacheOptionType_AllHosts = 1,
100 } SslFlushSessionCacheOptionType;
104 SslDebugOptionType_AllowDisableVerifyOption = 0,
105 } SslDebugOptionType;
109 SslVersion_Auto =
BIT(0),
110 SslVersion_TlsV10 =
BIT(3),
111 SslVersion_TlsV11 =
BIT(4),
112 SslVersion_TlsV12 =
BIT(5),
113 SslVersion_TlsV13 =
BIT(6),
114 SslVersion_Auto24 =
BIT(24),
119 SslCertificateFormat_Pem = 1,
120 SslCertificateFormat_Der = 2,
121 } SslCertificateFormat;
125 SslInternalPki_DeviceClientCertDefault = 1,
130 SslContextOption_CrlImportDateCheckEnable = 1,
137 SslVerifyOption_PeerCa =
BIT(0),
138 SslVerifyOption_HostName =
BIT(1),
139 SslVerifyOption_DateCheck =
BIT(2),
140 SslVerifyOption_EvCertPartial =
BIT(3),
141 SslVerifyOption_EvPolicyOid =
BIT(4),
142 SslVerifyOption_EvCertFingerprint =
BIT(5),
148 SslIoMode_Blocking = 1,
149 SslIoMode_NonBlocking = 2,
154 SslPollEvent_Read =
BIT(0),
155 SslPollEvent_Write =
BIT(1),
156 SslPollEvent_Except =
BIT(2),
161 SslSessionCacheMode_None = 0,
162 SslSessionCacheMode_SessionId = 1,
163 SslSessionCacheMode_SessionTicket = 2,
164 } SslSessionCacheMode;
168 SslRenegotiationMode_None = 0,
169 SslRenegotiationMode_Secure = 1,
170 } SslRenegotiationMode;
174 SslOptionType_DoNotCloseSocket = 0,
175 SslOptionType_GetServerCertChain = 1,
176 SslOptionType_SkipDefaultVerify = 2,
177 SslOptionType_EnableAlpn = 3,
182 SslPrivateOptionType_DtlsSession = 1,
183 SslPrivateOptionType_SetCipher = 2,
184 } SslPrivateOptionType;
188 SslAlpnProtoState_NoSupport = 0,
189 SslAlpnProtoState_Negotiated = 1,
190 SslAlpnProtoState_NoOverlap = 2,
191 SslAlpnProtoState_Selected = 3,
192 SslAlpnProtoState_EarlyValue = 4,
229 char protocol_version[0x8];
237 char common_name[0x40];
248 Service* sslGetServiceSession(
void);
273 Result sslGetCertificates(
void* buffer,
u32 size,
u32 *ca_cert_ids,
u32 count,
u32 *total_out);
281 Result sslGetCertificateBufSize(
u32 *ca_cert_ids,
u32 count,
u32 *out);
291 Result sslFlushSessionCache(
const char *str,
size_t str_bufsize, SslFlushSessionCacheOptionType type,
u32 *out);
301 Result sslSetDebugOption(
const void* buffer,
size_t size, SslDebugOptionType type);
310 Result sslGetDebugOption(
void* buffer,
size_t size, SslDebugOptionType type);
316 Result sslClearTls12FallbackFlag(
void);
383 Result sslContextImportServerPki(
SslContext *c,
const void* buffer,
u32 size, SslCertificateFormat format,
u64 *
id);
395 Result sslContextImportClientPki(
SslContext *c,
const void* pkcs12,
u32 pkcs12_size,
const char *pw,
u32 pw_size,
u64 *
id);
442 Result sslContextImportClientCertKeyPki(
SslContext *c,
const void* cert,
u32 cert_size,
const void* key,
u32 key_size, SslCertificateFormat format,
u64 *
id);
564 Result sslConnectionGetServerCertDetail(
const void* certbuf,
u32 certbuf_size,
u32 cert_index,
void** cert,
u32 *cert_size);
736 Result sslConnectionSetDtlsSocketDescriptor(
SslConnection *c,
int sockfd,
const void* buf,
size_t size,
int *out_sockfd);
783 Result sslConnectionExportKeyingMaterial(
SslConnection *c,
u8 *outbuf,
u32 outbuf_size,
const char *label,
u32 label_size,
const void* context,
u32 context_size);
Service object structure.
Definition: service.h:14
BuiltInCertificateInfo.
Definition: ssl.h:206
u32 status
SslTrustedCertStatus
Definition: ssl.h:208
u8 * cert_data
CertificateData (converted from an offset to a ptr), in DER format.
Definition: ssl.h:210
u64 cert_size
CertificateSize.
Definition: ssl.h:209
u32 cert_id
SslCaCertificateId
Definition: ssl.h:207
CipherInfo.
Definition: ssl.h:227
SslConnection.
Definition: ssl.h:201
Service s
ISslConnection.
Definition: ssl.h:202
SslContext.
Definition: ssl.h:196
Service s
ISslContext.
Definition: ssl.h:197
KeyAndCertParams.
Definition: ssl.h:233
u32 common_name_len
Length of common_name excluding NUL-terminator. Must be 0x1-0x3F.
Definition: ssl.h:238
u64 public_exponent
Public exponent, must be non-zero. Only the low 4-bytes are used.
Definition: ssl.h:236
u32 unk_x0
Must be value 1.
Definition: ssl.h:234
s32 key_size
Key size in bits.
Definition: ssl.h:235
SslServerCertDetailEntry.
Definition: ssl.h:221
u32 offset
Offset.
Definition: ssl.h:223
u32 size
Size.
Definition: ssl.h:222
#define BIT(n)
Creates a bitmask from a bit number.
Definition: types.h:54
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
uint16_t u16
16-bit unsigned integer.
Definition: types.h:20
u32 Result
Function error code result type.
Definition: types.h:44
int32_t s32
32-bit signed integer.
Definition: types.h:27
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21