Skip to content

Commit

Permalink
Added the ctr.uds lib (3DS-to-3DS wireless communication), Added a fu…
Browse files Browse the repository at this point in the history
…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 707b1a4
Show file tree
Hide file tree
Showing 4 changed files with 616 additions and 1 deletion.
9 changes: 9 additions & 0 deletions source/ctr.c
Expand Up @@ -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
Expand Down Expand Up @@ -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 }
};

Expand Down
17 changes: 17 additions & 0 deletions source/httpc.c
Expand Up @@ -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 },
Expand All @@ -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}
};

Expand Down
2 changes: 1 addition & 1 deletion source/socket.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 707b1a4

Please sign in to comment.