Permalink
Browse files

Added the ctr.uds lib (3DS-to-3DS wireless communication), Added a fu…

…nction to add ssl certificates for HTTP contexts, Minor documentation update.

The UDS lib is completely untested, because I only have 1 3DS.
  • Loading branch information...
Firew0lf committed Apr 26, 2016
1 parent f554f53 commit 707b1a451ee79c546f0363e01c17a4dd11277902
Showing with 616 additions and 1 deletion.
  1. +9 −0 source/ctr.c
  2. +17 −0 source/httpc.c
  3. +1 −1 source/socket.c
  4. +589 −0 source/uds.c
@@ -128,6 +128,14 @@ The `ctr.thread` module.
*/
void load_thread_lib(lua_State *L);

/***
The `ctr.uds` module.
@table uds
@see ctr.uds
*/
void load_uds_lib(lua_State *L);
void unload_uds_lib(lua_State *L);

/***
Return whether or not the program should continue.
@function run
@@ -198,6 +206,7 @@ struct { char *name; void (*load)(lua_State *L); void (*unload)(lua_State *L); }
{ "apt", load_apt_lib, unload_apt_lib },
{ "mic", load_mic_lib, NULL },
{ "thread", load_thread_lib, NULL },
{ "uds", load_uds_lib, unload_uds_lib },
{ NULL, NULL, NULL }
};

@@ -275,6 +275,22 @@ static int httpc_setSSLOptions(lua_State *L) {
return 0;
}

/***
Add all the default certificates to the context.
@function addDefaultCert
*/
static int httpc_addDefaultCert(lua_State *L) {
httpcContext *context = lua_touserdata(L, 1);

httpcAddDefaultCert(context, SSLC_DefaultRootCert_CyberTrust);
httpcAddDefaultCert(context, SSLC_DefaultRootCert_AddTrust_External_CA);
httpcAddDefaultCert(context, SSLC_DefaultRootCert_COMODO);
httpcAddDefaultCert(context, SSLC_DefaultRootCert_USERTrust);
httpcAddDefaultCert(context, SSLC_DefaultRootCert_DigiCert_EV);

return 0;
}

// object
static const struct luaL_Reg httpc_methods[] = {
{"open", httpc_open },
@@ -289,6 +305,7 @@ static const struct luaL_Reg httpc_methods[] = {
{"getResponseHeader", httpc_getResponseHeader },
{"addTrustedRootCA", httpc_addTrustedRootCA },
{"setSSLOptions", httpc_setSSLOptions },
{"addDefaultCert", httpc_addDefaultCert },
{NULL, NULL}
};

@@ -92,7 +92,7 @@ static int socket_init(lua_State *L) {
}

/***
Disable the socket module. Must be called before exiting ctrµLua.
Disable the socket module.
@function shutdown
*/
static int socket_shutdown(lua_State *L) {
Oops, something went wrong.

0 comments on commit 707b1a4

Please sign in to comment.