wut  v1.7.0
Wii U Toolchain
nssl.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
28 typedef int32_t NSSLError;
30 typedef int32_t NSSLContextHandle;
32 typedef int32_t NSSLConnectionHandle;
33 
37 typedef enum NSSLErrors
38 {
43  NSSL_ERROR_CERT_LIMIT = -0x280003,
47  NSSL_ERROR_WANT_READ = -0x280007,
48  NSSL_ERROR_WANT_WRITE = -0x280008,
49  NSSL_ERROR_IO_ERROR = -0x280009,
51  NSSL_ERROR_UNKNOWN = -0x28000b,
55  NSSL_ERROR_NO_CERT = -0x28000f,
56  NSSL_ERROR_INVALID_FD = -0x280010,
58  NSSL_ERROR_IPC_ERROR = -0x280012,
66  NSSL_ERROR_NO_CIPHER = -0x28001a,
69  NSSL_ERROR_NO_SESSION = -0x28001d,
80  NSSL_ERROR_NOT_READY = -0x280028,
91 
103 typedef enum NSSLServerCertId
104 {
127 
231 
243 
254 NSSLError
256 
263 NSSLError
265 
281 NSSLCreateContext(int32_t unk);
282 
292 NSSLError
294 
321 NSSLError
323  const void *cert,
324  int32_t length,
325  int32_t unk);
326 
342 NSSLError
344  NSSLServerCertId pki);
345 
382  const char *host,
383  int32_t hostLength,
384  int32_t options,
385  int32_t socket,
386  int32_t block);
387 
397 NSSLError
399 
422 NSSLError
424  const void *buffer,
425  int32_t length,
426  int32_t *outBytesRead);
427 
450 NSSLError
452  const void *buffer,
453  int32_t length,
454  int32_t *outBytesWritten);
455 
456 #ifdef __cplusplus
457 }
458 #endif
459 
NSSLError NSSLDestroyContext(NSSLContextHandle context)
Destroys a NSSL context.
NSSLError NSSLRead(NSSLConnectionHandle connection, const void *buffer, int32_t length, int32_t *outBytesRead)
Read data from an open NSSL connection into a given buffer.
NSSLErrors
List of errors returned by the NSSL library.
Definition: nssl.h:38
NSSLError NSSLAddServerPKI(NSSLContextHandle context, NSSLServerCertId pki)
Add a system root CA (one of NSSLServerCertId) to the given NSSL context.
NSSLServerCertId
The IDs of a system CA.
Definition: nssl.h:104
NSSLError NSSLInit()
Initialises the NSSL library for use.
NSSLConnectionHandle NSSLCreateConnection(NSSLContextHandle context, const char *host, int32_t hostLength, int32_t options, int32_t socket, int32_t block)
Open an SSL connection.
int32_t NSSLConnectionHandle
A handle to a NSSL connection created with NSSLCreateConnection().
Definition: nssl.h:32
int32_t NSSLError
An NSSL library return code.
Definition: nssl.h:28
NSSLError NSSLFinish()
Cleans up and finishes use of the NSSL library.
NSSLError NSSLDestroyConnection(NSSLConnectionHandle connection)
Close and destroy a NSSL connection.
NSSLError NSSLAddServerPKIExternal(NSSLContextHandle context, const void *cert, int32_t length, int32_t unk)
Add a custom root CA to the given NSSL context.
int32_t NSSLContextHandle
A handle to a NSSL context created with NSSLCreateContext().
Definition: nssl.h:30
NSSLError NSSLWrite(NSSLConnectionHandle connection, const void *buffer, int32_t length, int32_t *outBytesWritten)
Write data to an open NSSL connection from a given buffer.
NSSLContextHandle NSSLCreateContext(int32_t unk)
Creates a context to use with the NSSL library.
@ NSSL_ERROR_CERT_LIMIT
Definition: nssl.h:43
@ NSSL_ERROR_SSL_SHUTDOWN_ERROR
Definition: nssl.h:70
@ NSSL_ERROR_INVALID_PRIVATE_KEY
Definition: nssl.h:79
@ NSSL_ERROR_INVALID_STATE
Definition: nssl.h:53
@ NSSL_ERROR_CERT_STORE_ERROR
Definition: nssl.h:77
@ NSSL_ERROR_INVALID_HANDLE
Definition: nssl.h:60
@ NSSL_ERROR_INVALID_CERT
Definition: nssl.h:45
@ NSSL_ERROR_WANT_WRITE
Definition: nssl.h:48
@ NSSL_ERROR_PRIVATE_KEY_READ_ERROR
Definition: nssl.h:78
@ NSSL_ERROR_CERT_NOT_EXPORTABLE
Definition: nssl.h:87
@ NSSL_ERROR_NO_PEER_CERT
Definition: nssl.h:64
@ NSSL_ERROR_NO_SESSION
Definition: nssl.h:69
@ NSSL_ERROR_INVALID_CERT_ID2
Definition: nssl.h:73
@ NSSL_ERROR_LIB_NOT_READY
Definition: nssl.h:57
@ NSSL_ERROR_CERT_STORE_INIT_FAILURE
Definition: nssl.h:75
@ NSSL_ERROR_INVALID_KEY_SIZE
Definition: nssl.h:89
@ NSSL_ERROR_OUT_OF_MEMORY
Definition: nssl.h:52
@ NSSL_ERROR_IO_ERROR
Definition: nssl.h:49
@ NSSL_ERROR_HANDSHAKE_ERROR
Definition: nssl.h:54
@ NSSL_ERROR_NO_CIPHER
Definition: nssl.h:66
@ NSSL_ERROR_INVALID_NSSL_CONTEXT
Definition: nssl.h:41
@ NSSL_ERROR_IPC_ERROR
Definition: nssl.h:58
@ NSSL_ERROR_WANT_READ
Definition: nssl.h:47
@ NSSL_ERROR_PROCESS_MAX_CONNECTIONS
Definition: nssl.h:86
@ NSSL_ERROR_NO_CERT
Definition: nssl.h:55
@ NSSL_ERROR_CERT_SIZE_LIMIT
Definition: nssl.h:71
@ NSSL_ERROR_NO_CERT_STORE
Definition: nssl.h:82
@ NSSL_ERROR_NSSL_LIB_ERROR
Definition: nssl.h:50
@ NSSL_ERROR_NOT_READY
Definition: nssl.h:80
@ NSSL_ERROR_INVALID_NSSL_SESSION
Definition: nssl.h:68
@ NSSL_ERROR_ENCRYPTION_ERROR
Definition: nssl.h:81
@ NSSL_ERROR_PROCESS_MAX_CONTEXTS
Definition: nssl.h:85
@ NSSL_ERROR_RESOURCE_LIMIT
Definition: nssl.h:59
@ NSSL_ERROR_PROCESS_MAX_EXT_CERTS
Definition: nssl.h:84
@ NSSL_ERROR_CERT_NO_ACCESS
Definition: nssl.h:72
@ NSSL_ERROR_INVALID_CERT_ID
Definition: nssl.h:42
@ NSSL_ERROR_INVALID_ARG
Definition: nssl.h:67
@ NSSL_ERROR_INVALID_FD
Definition: nssl.h:56
@ NSSL_ERROR_INSUFFICIENT_SIZE
Definition: nssl.h:65
@ NSSL_ERROR_INVALID_CERT_TYPE
Definition: nssl.h:61
@ NSSL_ERROR_ZERO_RETURN
Definition: nssl.h:46
@ NSSL_ERROR_GENERIC
Definition: nssl.h:40
@ NSSL_ERROR_INVALID_NSSL_CONNECTION
Definition: nssl.h:44
@ NSSL_ERROR_OK
Definition: nssl.h:39
@ NSSL_ERROR_INVALID_CERT_SIZE
Definition: nssl.h:88
@ NSSL_ERROR_PRIVATE_KEY_SIZE_LIMIT
Definition: nssl.h:83
@ NSSL_ERROR_INVALID_KEY_TYPE
Definition: nssl.h:62
@ NSSL_ERROR_INVALID_CERT_ENCODING
Definition: nssl.h:76
@ NSSL_ERROR_INVALID_SIZE
Definition: nssl.h:63
@ NSSL_ERROR_CERT_READ_ERROR
Definition: nssl.h:74
@ NSSL_ERROR_UNKNOWN
Definition: nssl.h:51
@ NSSL_SERVER_CERT_ENTRUST_ROOT_CA
Entrust Root Certification Authority (SHA1: B3 1E B1 B7 40 E3 6C 84 02 DA DC 37 D4 4D F5 D4 67 49 52 ...
Definition: nssl.h:219
@ NSSL_SERVER_CERT_COMODO_CA
COMODO Certification Authority (SHA1: EE 86 93 87 FF FD 83 49 AB 5A D1 43 22 58 87 89 A4 57 B0 12)
Definition: nssl.h:180
@ NSSL_SERVER_CERT_GEOTRUST_PRIMARY_CA_G3
GeoTrust Primary Certification Authority - G3 (SHA1: 03 9E ED B8 0B E7 A0 3C 69 53 89 3B 20 D2 D9 32 ...
Definition: nssl.h:174
@ NSSL_SERVER_CERT_VERIZON_GLOBAL_ROOT_CA
Verizon Global Root (SHA1: 91 21 98 EE F2 3D CA C4 09 39 31 2F EE 97 DD 56 0B AE 49 B1)
Definition: nssl.h:138
@ NSSL_SERVER_CERT_CYBERTRUST_GLOBAL_ROOT_CA
Cybertrust Global Root (SHA1: 5F 43 E5 B1 BF F8 78 8C AC 1C C7 CA 4A 9A C6 22 2B CC 34 C6)
Definition: nssl.h:135
@ NSSL_SERVER_CERT_BALTIMORE_CYBERTRUST_ROOT_CA
Baltimore CyberTrust Root (SHA1: D4 DE 20 D0 5E 66 FC 53 FE 1A 50 88 2C 78 DB 28 52 CA E4 74)
Definition: nssl.h:132
@ NSSL_SERVER_CERT_GEOTRUST_PRIMARY_CA
GeoTrust Primary Certification Authority (SHA1: 32 3C 11 8E 1B F7 B8 B6 52 54 E2 E2 10 0D D6 02 90 37...
Definition: nssl.h:171
@ NSSL_SERVER_CERT_ENTRUST_ROOT_CA_G2
Entrust Root Certification Authority - G2 (SHA1: 8C F4 27 FD 79 0C 3A D1 66 06 8D E8 1E 57 EF BB 93 2...
Definition: nssl.h:222
@ NSSL_SERVER_CERT_DIGICERT_GLOBAL_ROOT_CA
DigiCert Global Root CA (SHA1: A8 98 5D 3A 65 E5 E5 C4 B2 D7 D6 6D 40 C6 DD 2F B1 9C 54 36)
Definition: nssl.h:195
@ NSSL_SERVER_CERT_ENTRUST_SECURE_SERVER_CA
Entrust.net Secure Server Certification Authority (SHA1: 99 A6 9B E6 1A FE 88 6B 4D 2B 82 00 7C B8 54...
Definition: nssl.h:210
@ NSSL_SERVER_CERT_VERISIGN_CLASS3_PUBLIC_PRIMARY_CA
[No common name] (SHA1: A1 DB 63 93 91 6F 17 E4 18 55 09 40 04 15 C7 02 40 B0 AE 6B)
Definition: nssl.h:201
@ NSSL_SERVER_CERT_GROUP_NINTENDO_FIRST
Represents the first certificate in the Nintendo CA group.
Definition: nssl.h:106
@ NSSL_SERVER_CERT_GROUP_COMMERCIAL_LAST
Represents the last certificate in the commerical CA group.
Definition: nssl.h:230
@ NSSL_SERVER_CERT_THAWTE_PRIMARY_ROOT_CA
thawte Primary Root CA (SHA1: 91 C6 D6 EE 3E 8A C8 63 84 E5 48 C2 99 29 5C 75 6C 81 7B 81)
Definition: nssl.h:162
@ NSSL_SERVER_CERT_GLOBALSIGN_ROOT_CA_R2
GlobalSign (SHA1: 75 E0 AB B6 13 85 12 27 1C 04 F8 5F DD DE 38 E4 B7 24 2E FE)
Definition: nssl.h:144
@ NSSL_SERVER_CERT_NINTENDO_CLASS2_CA_G3
Nintendo Class 2 CA - G3 (SHA1: FA B5 6C 4C C7 CF F5 07 1D 40 B6 B0 07 38 61 D2 90 CA 2A 1A)
Definition: nssl.h:124
@ NSSL_SERVER_CERT_EQUIFAX_SECURE_CA
[No common name] (SHA1: D2 32 09 AD 23 D3 14 23 21 74 E4 0D 7F 9D 62 13 97 86 63 3A)
Definition: nssl.h:207
@ NSSL_SERVER_CERT_GEOTRUST_GLOBAL_CA
GeoTrust Global CA (SHA1: DE 28 F4 A4 FF E5 B9 2F A3 C5 03 D1 A3 49 A7 F9 96 2A 82 12)
Definition: nssl.h:165
@ NSSL_SERVER_CERT_VERISIGN_CLASS3_PUBLIC_PRIMARY_CA_G5
VeriSign Class 3 Public Primary Certification Authority - G5 (SHA1: 4E B6 D5 78 49 9B 1C CF 5F 58 1E ...
Definition: nssl.h:156
@ NSSL_SERVER_CERT_DIGICERT_GLOBAL_ROOT_CA_G2
DigiCert Global Root G2 (SHA1: DF 3C 24 F9 BF D6 66 76 1B 26 80 73 FE 06 D1 CC 8D 4F 82 A4)
Definition: nssl.h:228
@ NSSL_SERVER_CERT_NINTENDO_CA
Nintendo CA (SHA1: B5 22 94 55 DD 26 C1 F5 3C 73 06 0E 90 89 B3 91 38 9E 1F 75)
Definition: nssl.h:109
@ NSSL_SERVER_CERT_VERISIGN_CLASS3_PUBLIC_PRIMARY_CA_G2
[No common name] (SHA1: 85 37 1C A6 E5 50 14 3D CE 28 03 47 1B DE 3A 09 E8 F8 77 0F)
Definition: nssl.h:213
@ NSSL_SERVER_CERT_GROUP_COMMERCIAL_4096_LAST
Represents the last certificate in the 4096-bit commercial CA group.
Definition: nssl.h:241
@ NSSL_SERVER_CERT_NINTENDO_CLASS2_CA
Nintendo Class 2 CA (SHA1: AA 8E F6 6A E0 F8 07 ED B8 41 C8 89 EE 36 66 A2 59 A2 8C CC)
Definition: nssl.h:118
@ NSSL_SERVER_CERT_UTN_USERFIRST_HARDWARE_CA
UTN-USERFirst-Hardware (SHA1: 04 83 ED 33 99 AC 36 08 05 87 22 ED BC 5E 46 00 E3 BE F9 D7)
Definition: nssl.h:186
@ NSSL_SERVER_CERT_ADDTRUST_EXT_CA_ROOT
AddTrust External CA Root (SHA1: 02 FA F3 E2 91 43 54 68 60 78 57 69 4D F5 E4 5B 68 85 18 68)
Definition: nssl.h:177
@ NSSL_SERVER_CERT_UTN_DATACORP_SGC_CA
UTN - DATACorp SGC (SHA1: 58 11 9F 0E 12 82 87 EA 50 FD D9 87 45 6F 4F 78 DC FA D6 D4)
Definition: nssl.h:183
@ NSSL_SERVER_CERT_GLOBALSIGN_ROOT_CA
GlobalSign Root CA (SHA1: B1 BC 96 8B D4 F4 9D 62 2A A8 9A 81 F2 15 01 52 A4 1D 82 9C)
Definition: nssl.h:141
@ NSSL_SERVER_CERT_GEOTRUST_GLOBAL_CA2
GeoTrust Global CA 2 (SHA1: A9 E9 78 08 14 37 58 88 F2 05 19 B0 6D 2B 0D 2B 60 16 90 7D)
Definition: nssl.h:168
@ NSSL_SERVER_CERT_GLOBALSIGN_ROOT_CA_R3
GlobalSign (SHA1: D6 9B 56 11 48 F0 1C 77 C5 45 78 C1 09 26 DF 5B 85 69 76 AD)
Definition: nssl.h:147
@ NSSL_SERVER_CERT_GROUP_NINTENDO_LAST
Represents the last certificate in the Nintendo CA group.
Definition: nssl.h:126
@ NSSL_SERVER_CERT_VERISIGN_CLASS3_PUBLIC_PRIMARY_CA_G3
VeriSign Class 3 Public Primary Certification Authority - G3 (SHA1: 13 2D 0D 45 53 4B 69 97 CD B2 D5 ...
Definition: nssl.h:150
@ NSSL_SERVER_CERT_USERTRUST_RSA_CA
USERTrust RSA Certification Authority (SHA1: 2B 8F 1B 57 33 0D BB A2 D0 7A 6C 51 F7 0E E9 0D DA B9 AD...
Definition: nssl.h:239
@ NSSL_SERVER_CERT_ENTRUST_CA_2048
Entrust.net Certification Authority (2048) (SHA1: 50 30 06 09 1D 97 D4 F5 AE 39 F7 CB E7 92 7D 7D 65 ...
Definition: nssl.h:216
@ NSSL_SERVER_CERT_DIGICERT_ASSURED_ID_ROOT_CA
DigiCert Assured ID Root CA (SHA1: 05 63 B8 63 0D 62 D7 5A BB C8 AB 1E 4B DF B5 A8 99 B2 4D 43)
Definition: nssl.h:192
@ NSSL_SERVER_CERT_THAWTE_PRIMARY_ROOT_CA_G3
thawte Primary Root CA - G3 (SHA1: F1 8B 53 8D 1B E9 03 B6 A6 F0 56 43 5B 17 15 89 CA F3 6B F2)
Definition: nssl.h:159
@ NSSL_SERVER_CERT_GTE_CYBERTRUST_GLOBAL_ROOT
GTE CyberTrust Global Root (SHA1: 97 81 79 50 D8 1C 96 70 CC 34 D8 09 CF 79 44 31 36 7E F4 74)
Definition: nssl.h:198
@ NSSL_SERVER_CERT_DIGICERT_ASSURED_ID_ROOT_CA_G2
DigiCert Assured ID Root G2 (SHA1: A1 4B 48 D9 43 EE 0A 0E 40 90 4F 3C E0 A4 C0 91 93 51 5D 3F)
Definition: nssl.h:225
@ NSSL_SERVER_CERT_GROUP_COMMERCIAL_4096_FIRST
Represents the first certificate in the 4096-bit commercial CA group.
Definition: nssl.h:233
@ NSSL_SERVER_CERT_NINTENDO_CA_G2
Nintendo CA - G2 (SHA1: C6 0B 2A 5C C9 0F 06 30 CC A3 30 40 DF 6B 33 78 23 9F 3B FA)
Definition: nssl.h:112
@ NSSL_SERVER_CERT_NINTENDO_CA_G3
Nintendo CA - G3 (SHA1: 68 A0 77 05 CC C7 A4 08 41 6E 0E D7 AD 65 F2 EC 3F EA 98 62)
Definition: nssl.h:115
@ NSSL_SERVER_CERT_DIGICERT_HIGH_ASSURANCE_EV_ROOT_CA
DigiCert High Assurance EV Root CA (SHA1: 5F B7 EE 06 33 E2 59 DB AD 0C 4C 9A E6 D3 8F 1A 61 C7 DC 25...
Definition: nssl.h:189
@ NSSL_SERVER_CERT_COMODO_RSA_CA
COMODO RSA Certification Authority (SHA1: AF E5 D2 44 A8 D1 19 42 30 FF 47 9F E2 F8 97 BB CD 7A 8C B4...
Definition: nssl.h:236
@ NSSL_SERVER_CERT_NINTENDO_CLASS2_CA_G2
Nintendo Class 2 CA - G2 (SHA1: 03 9D E5 37 3A C6 5E 1A EE 89 8D 54 E7 56 35 76 EB BE 54 9B)
Definition: nssl.h:121
@ NSSL_SERVER_CERT_GROUP_COMMERCIAL_FIRST
Represents the first certificate in the commercial CA group.
Definition: nssl.h:129
@ NSSL_SERVER_CERT_VERISIGN_UNIVERSAL_ROOT_CA
VeriSign Universal Root Certification Authority (SHA1: 36 79 CA 35 66 87 72 30 4D 30 A5 FB 87 3B 0F A...
Definition: nssl.h:153
@ NSSL_SERVER_CERT_THAWTE_PREMIUM_SERVER_CA
Thawte Premium Server CA (SHA1: 62 7F 8D 78 27 65 63 99 D2 7D 7F 90 44 C9 FE B3 F3 3E FA 9A)
Definition: nssl.h:204
int RPLWRAP() socket(int domain, int type, int protocol)