wut
v1.7.0
Wii U Toolchain
|
The NSSL library is Nintendo's interface for making SSL connections on the Wii U. More...
Typedefs | |
typedef int32_t | NSSLError |
An NSSL library return code. More... | |
typedef int32_t | NSSLContextHandle |
A handle to a NSSL context created with NSSLCreateContext(). More... | |
typedef int32_t | NSSLConnectionHandle |
A handle to a NSSL connection created with NSSLCreateConnection(). More... | |
typedef enum NSSLErrors | NSSLErrors |
List of errors returned by the NSSL library. More... | |
typedef enum NSSLServerCertId | NSSLServerCertId |
The IDs of a system CA. More... | |
Functions | |
NSSLError | NSSLInit () |
Initialises the NSSL library for use. More... | |
NSSLError | NSSLFinish () |
Cleans up and finishes use of the NSSL library. More... | |
NSSLContextHandle | NSSLCreateContext (int32_t unk) |
Creates a context to use with the NSSL library. More... | |
NSSLError | NSSLDestroyContext (NSSLContextHandle context) |
Destroys a NSSL context. More... | |
NSSLError | NSSLAddServerPKIExternal (NSSLContextHandle context, const void *cert, int32_t length, int32_t unk) |
Add a custom root CA to the given NSSL context. More... | |
NSSLError | NSSLAddServerPKI (NSSLContextHandle context, NSSLServerCertId pki) |
Add a system root CA (one of NSSLServerCertId) to the given NSSL context. More... | |
NSSLConnectionHandle | NSSLCreateConnection (NSSLContextHandle context, const char *host, int32_t hostLength, int32_t options, int32_t socket, int32_t block) |
Open an SSL connection. More... | |
NSSLError | NSSLDestroyConnection (NSSLConnectionHandle connection) |
Close and destroy a NSSL connection. More... | |
NSSLError | NSSLRead (NSSLConnectionHandle connection, const void *buffer, int32_t length, int32_t *outBytesRead) |
Read data from an open NSSL connection into a given buffer. More... | |
NSSLError | NSSLWrite (NSSLConnectionHandle connection, const void *buffer, int32_t length, int32_t *outBytesWritten) |
Write data to an open NSSL connection from a given buffer. More... | |
The NSSL library is Nintendo's interface for making SSL connections on the Wii U.
To use NSSL directly, call NSSLInit() then NSSLCreateContext() to create a context. This context - after adding root CAs via NSSLAddServerPKI() or NSSLAddServerPKIExternal() - can be used to create connections (NSSLCreateConnection()) that can transfer data using NSSLRead() and NSSLWrite().
For HTTPS connections, consider using nlibcurl.
typedef int32_t NSSLContextHandle |
A handle to a NSSL context created with NSSLCreateContext().
typedef int32_t NSSLConnectionHandle |
A handle to a NSSL connection created with NSSLCreateConnection().
typedef enum NSSLErrors NSSLErrors |
List of errors returned by the NSSL library.
typedef enum NSSLServerCertId NSSLServerCertId |
The IDs of a system CA.
These certificates are built-in to the system and can be added to a NSSL context with NSSLAddServerPKI().
The names and fingerprints given in this documentation are taken from the real certificates inside the Wii U's CDN package.
enum NSSLErrors |
List of errors returned by the NSSL library.
enum NSSLServerCertId |
The IDs of a system CA.
These certificates are built-in to the system and can be added to a NSSL context with NSSLAddServerPKI().
The names and fingerprints given in this documentation are taken from the real certificates inside the Wii U's CDN package.
NSSLError NSSLInit | ( | ) |
Initialises the NSSL library for use.
This must be called before any other NSSL functions.
NSSLError NSSLFinish | ( | ) |
Cleans up and finishes use of the NSSL library.
NSSLContextHandle NSSLCreateContext | ( | int32_t | unk | ) |
Creates a context to use with the NSSL library.
A context contains root CAs and connections.
unk | Unknown. A value of 0 appears to work. |
NSSLError NSSLDestroyContext | ( | NSSLContextHandle | context | ) |
Destroys a NSSL context.
context | The NSSL context to destroy. |
NSSLError NSSLAddServerPKIExternal | ( | NSSLContextHandle | context, |
const void * | cert, | ||
int32_t | length, | ||
int32_t | unk | ||
) |
Add a custom root CA to the given NSSL context.
context | The NSSL context to add a root CA to. |
cert | A pointer to a buffer containing the certificate data. |
length | The length of the certificate buffer. |
unk | Unknown. |
NSSLError NSSLAddServerPKI | ( | NSSLContextHandle | context, |
NSSLServerCertId | pki | ||
) |
Add a system root CA (one of NSSLServerCertId) to the given NSSL context.
context | The NSSL context to add a root CA to. |
pki | The NSSLServerCertId representing the system CA to add. |
NSSLConnectionHandle NSSLCreateConnection | ( | NSSLContextHandle | context, |
const char * | host, | ||
int32_t | hostLength, | ||
int32_t | options, | ||
int32_t | socket, | ||
int32_t | block | ||
) |
Open an SSL connection.
context | The context to open the connection under. |
host | The domain or IP of the host to connect to. |
hostLength | The length of the "host" buffer. |
options | Options for the underlying socket. |
socket | An existing socket to use for the connection, or NULL. |
block | If opening a new underlying socket, whether to open it in blocking mode. |
NSSLError NSSLDestroyConnection | ( | NSSLConnectionHandle | connection | ) |
Close and destroy a NSSL connection.
connection | The connection to destroy. |
NSSLError NSSLRead | ( | NSSLConnectionHandle | connection, |
const void * | buffer, | ||
int32_t | length, | ||
int32_t * | outBytesRead | ||
) |
Read data from an open NSSL connection into a given buffer.
connection | The connection to read data from. |
buffer | A buffer to read decrypted data into. |
length | The length of the given buffer. |
outBytesRead | A pointer to write the actual number of read bytes into. This may be smaller than the input buffer. |
NSSLError NSSLWrite | ( | NSSLConnectionHandle | connection, |
const void * | buffer, | ||
int32_t | length, | ||
int32_t * | outBytesWritten | ||
) |
Write data to an open NSSL connection from a given buffer.
connection | The connection to write data to. |
buffer | A buffer containing the data to be sent. |
length | The length of the given buffer. |
outBytesWritten | A pointer to write the actual number of written bytes into. This may be smaller than the input buffer. |