wut  v1.7.0
Wii U Toolchain
Typedefs | Enumerations | Functions
nssl.h File Reference
#include <wut.h>
Include dependency graph for nssl.h:

Go to the source code of this file.

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...
 

Enumerations

enum  NSSLErrors {
  NSSL_ERROR_OK = 0x0 ,
  NSSL_ERROR_GENERIC = -0x1 ,
  NSSL_ERROR_INVALID_NSSL_CONTEXT = -0x280001 ,
  NSSL_ERROR_INVALID_CERT_ID = -0x280002 ,
  NSSL_ERROR_CERT_LIMIT = -0x280003 ,
  NSSL_ERROR_INVALID_NSSL_CONNECTION = -0x280004 ,
  NSSL_ERROR_INVALID_CERT = -0x280005 ,
  NSSL_ERROR_ZERO_RETURN = -0x280006 ,
  NSSL_ERROR_WANT_READ = -0x280007 ,
  NSSL_ERROR_WANT_WRITE = -0x280008 ,
  NSSL_ERROR_IO_ERROR = -0x280009 ,
  NSSL_ERROR_NSSL_LIB_ERROR = -0x28000a ,
  NSSL_ERROR_UNKNOWN = -0x28000b ,
  NSSL_ERROR_OUT_OF_MEMORY = -0x28000c ,
  NSSL_ERROR_INVALID_STATE = -0x28000d ,
  NSSL_ERROR_HANDSHAKE_ERROR = -0x28000e ,
  NSSL_ERROR_NO_CERT = -0x28000f ,
  NSSL_ERROR_INVALID_FD = -0x280010 ,
  NSSL_ERROR_LIB_NOT_READY = -0x280011 ,
  NSSL_ERROR_IPC_ERROR = -0x280012 ,
  NSSL_ERROR_RESOURCE_LIMIT = -0x280013 ,
  NSSL_ERROR_INVALID_HANDLE = -0x280014 ,
  NSSL_ERROR_INVALID_CERT_TYPE = -0x280015 ,
  NSSL_ERROR_INVALID_KEY_TYPE = -0x280016 ,
  NSSL_ERROR_INVALID_SIZE = -0x280017 ,
  NSSL_ERROR_NO_PEER_CERT = -0x280018 ,
  NSSL_ERROR_INSUFFICIENT_SIZE = -0x280019 ,
  NSSL_ERROR_NO_CIPHER = -0x28001a ,
  NSSL_ERROR_INVALID_ARG = -0x28001b ,
  NSSL_ERROR_INVALID_NSSL_SESSION = -0x28001c ,
  NSSL_ERROR_NO_SESSION = -0x28001d ,
  NSSL_ERROR_SSL_SHUTDOWN_ERROR = -0x28001e ,
  NSSL_ERROR_CERT_SIZE_LIMIT = -0x28001f ,
  NSSL_ERROR_CERT_NO_ACCESS = -0x280020 ,
  NSSL_ERROR_INVALID_CERT_ID2 = -0x280021 ,
  NSSL_ERROR_CERT_READ_ERROR = -0x280022 ,
  NSSL_ERROR_CERT_STORE_INIT_FAILURE = -0x280023 ,
  NSSL_ERROR_INVALID_CERT_ENCODING = -0x280024 ,
  NSSL_ERROR_CERT_STORE_ERROR = -0x280025 ,
  NSSL_ERROR_PRIVATE_KEY_READ_ERROR = -0x280026 ,
  NSSL_ERROR_INVALID_PRIVATE_KEY = -0x280027 ,
  NSSL_ERROR_NOT_READY = -0x280028 ,
  NSSL_ERROR_ENCRYPTION_ERROR = -0x280029 ,
  NSSL_ERROR_NO_CERT_STORE = -0x28002a ,
  NSSL_ERROR_PRIVATE_KEY_SIZE_LIMIT = -0x28002b ,
  NSSL_ERROR_PROCESS_MAX_EXT_CERTS = -0x28002c ,
  NSSL_ERROR_PROCESS_MAX_CONTEXTS = -0x28002d ,
  NSSL_ERROR_PROCESS_MAX_CONNECTIONS = -0x28002e ,
  NSSL_ERROR_CERT_NOT_EXPORTABLE = -0x28002f ,
  NSSL_ERROR_INVALID_CERT_SIZE = -0x280030 ,
  NSSL_ERROR_INVALID_KEY_SIZE = -0x280031
}
 List of errors returned by the NSSL library. More...
 
enum  NSSLServerCertId {
  NSSL_SERVER_CERT_GROUP_NINTENDO_FIRST = 100 ,
  NSSL_SERVER_CERT_NINTENDO_CA = 100 ,
  NSSL_SERVER_CERT_NINTENDO_CA_G2 = 101 ,
  NSSL_SERVER_CERT_NINTENDO_CA_G3 = 102 ,
  NSSL_SERVER_CERT_NINTENDO_CLASS2_CA = 103 ,
  NSSL_SERVER_CERT_NINTENDO_CLASS2_CA_G2 = 104 ,
  NSSL_SERVER_CERT_NINTENDO_CLASS2_CA_G3 = 105 ,
  NSSL_SERVER_CERT_GROUP_NINTENDO_LAST = 105 ,
  NSSL_SERVER_CERT_GROUP_COMMERCIAL_FIRST = 1001 ,
  NSSL_SERVER_CERT_BALTIMORE_CYBERTRUST_ROOT_CA = 1001 ,
  NSSL_SERVER_CERT_CYBERTRUST_GLOBAL_ROOT_CA = 1002 ,
  NSSL_SERVER_CERT_VERIZON_GLOBAL_ROOT_CA = 1003 ,
  NSSL_SERVER_CERT_GLOBALSIGN_ROOT_CA = 1004 ,
  NSSL_SERVER_CERT_GLOBALSIGN_ROOT_CA_R2 = 1005 ,
  NSSL_SERVER_CERT_GLOBALSIGN_ROOT_CA_R3 = 1006 ,
  NSSL_SERVER_CERT_VERISIGN_CLASS3_PUBLIC_PRIMARY_CA_G3 = 1007 ,
  NSSL_SERVER_CERT_VERISIGN_UNIVERSAL_ROOT_CA = 1008 ,
  NSSL_SERVER_CERT_VERISIGN_CLASS3_PUBLIC_PRIMARY_CA_G5 = 1009 ,
  NSSL_SERVER_CERT_THAWTE_PRIMARY_ROOT_CA_G3 = 1010 ,
  NSSL_SERVER_CERT_THAWTE_PRIMARY_ROOT_CA = 1011 ,
  NSSL_SERVER_CERT_GEOTRUST_GLOBAL_CA = 1012 ,
  NSSL_SERVER_CERT_GEOTRUST_GLOBAL_CA2 = 1013 ,
  NSSL_SERVER_CERT_GEOTRUST_PRIMARY_CA = 1014 ,
  NSSL_SERVER_CERT_GEOTRUST_PRIMARY_CA_G3 = 1015 ,
  NSSL_SERVER_CERT_ADDTRUST_EXT_CA_ROOT = 1016 ,
  NSSL_SERVER_CERT_COMODO_CA = 1017 ,
  NSSL_SERVER_CERT_UTN_DATACORP_SGC_CA = 1018 ,
  NSSL_SERVER_CERT_UTN_USERFIRST_HARDWARE_CA = 1019 ,
  NSSL_SERVER_CERT_DIGICERT_HIGH_ASSURANCE_EV_ROOT_CA = 1020 ,
  NSSL_SERVER_CERT_DIGICERT_ASSURED_ID_ROOT_CA = 1021 ,
  NSSL_SERVER_CERT_DIGICERT_GLOBAL_ROOT_CA = 1022 ,
  NSSL_SERVER_CERT_GTE_CYBERTRUST_GLOBAL_ROOT = 1023 ,
  NSSL_SERVER_CERT_VERISIGN_CLASS3_PUBLIC_PRIMARY_CA = 1024 ,
  NSSL_SERVER_CERT_THAWTE_PREMIUM_SERVER_CA = 1025 ,
  NSSL_SERVER_CERT_EQUIFAX_SECURE_CA = 1026 ,
  NSSL_SERVER_CERT_ENTRUST_SECURE_SERVER_CA = 1027 ,
  NSSL_SERVER_CERT_VERISIGN_CLASS3_PUBLIC_PRIMARY_CA_G2 = 1028 ,
  NSSL_SERVER_CERT_ENTRUST_CA_2048 = 1029 ,
  NSSL_SERVER_CERT_ENTRUST_ROOT_CA = 1030 ,
  NSSL_SERVER_CERT_ENTRUST_ROOT_CA_G2 = 1031 ,
  NSSL_SERVER_CERT_DIGICERT_ASSURED_ID_ROOT_CA_G2 = 1032 ,
  NSSL_SERVER_CERT_DIGICERT_GLOBAL_ROOT_CA_G2 = 1033 ,
  NSSL_SERVER_CERT_GROUP_COMMERCIAL_LAST = 1033 ,
  NSSL_SERVER_CERT_GROUP_COMMERCIAL_4096_FIRST = 1900 ,
  NSSL_SERVER_CERT_COMODO_RSA_CA = 1900 ,
  NSSL_SERVER_CERT_USERTRUST_RSA_CA = 1901 ,
  NSSL_SERVER_CERT_GROUP_COMMERCIAL_4096_LAST = 1901
}
 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...