diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-03-25 02:04:50 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-03-25 02:04:50 +0000 |
commit | af4611d4e02c8a5b0c72cae08c1d944528d63787 (patch) | |
tree | 321a71c77c3da0c7ee20bae6183e5c89fd35fb25 /contrib/package/uhttpd/src/uhttpd-tls.c | |
parent | a6722be769be20d3e06d0ca77eac1bd3af6f9593 (diff) |
uhttpd: move Lua and TLS support into loadable plugins
Diffstat (limited to 'contrib/package/uhttpd/src/uhttpd-tls.c')
-rw-r--r-- | contrib/package/uhttpd/src/uhttpd-tls.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/contrib/package/uhttpd/src/uhttpd-tls.c b/contrib/package/uhttpd/src/uhttpd-tls.c index bbec7509d..cb5061638 100644 --- a/contrib/package/uhttpd/src/uhttpd-tls.c +++ b/contrib/package/uhttpd/src/uhttpd-tls.c @@ -33,6 +33,16 @@ SSL_CTX * uh_tls_ctx_init() return c; } +int uh_tls_ctx_cert(SSL_CTX *c, const char *file) +{ + return SSL_CTX_use_certificate_file(c, file, SSL_FILETYPE_ASN1); +} + +int uh_tls_ctx_key(SSL_CTX *c, const char *file) +{ + return SSL_CTX_use_PrivateKey_file(c, file, SSL_FILETYPE_ASN1); +} + void uh_tls_ctx_free(struct listener *l) { SSL_CTX_free(l->tls); @@ -48,6 +58,16 @@ void uh_tls_client_accept(struct client *c) } } +int uh_tls_client_recv(struct client *c, void *buf, int len) +{ + return SSL_read(c->tls, buf, len); +} + +int uh_tls_client_send(struct client *c, void *buf, int len) +{ + return SSL_write(c->tls, buf, len); +} + void uh_tls_client_close(struct client *c) { if( c->tls ) @@ -58,3 +78,5 @@ void uh_tls_client_close(struct client *c) c->tls = NULL; } } + + |