diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-06-12 12:58:11 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-06-12 12:58:11 +0000 |
commit | 0f2211afd6a87f325daf30c76153f94d760b616b (patch) | |
tree | f87f722897d00068f2d1ef3e9904629fca155366 /package/uhttpd | |
parent | c7086dce4ea7b59cd2f748b3c48e012c7a28d29a (diff) | |
download | upstream-0f2211afd6a87f325daf30c76153f94d760b616b.tar.gz upstream-0f2211afd6a87f325daf30c76153f94d760b616b.tar.bz2 upstream-0f2211afd6a87f325daf30c76153f94d760b616b.zip |
[package] uhttpd:
- fix incorrect parsing of multiple listen options (#7458)
- support PEM certificates for SSL
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21762 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/uhttpd')
-rw-r--r-- | package/uhttpd/Makefile | 2 | ||||
-rw-r--r-- | package/uhttpd/src/uhttpd-tls.c | 14 | ||||
-rw-r--r-- | package/uhttpd/src/uhttpd.c | 1 |
3 files changed, 14 insertions, 3 deletions
diff --git a/package/uhttpd/Makefile b/package/uhttpd/Makefile index 3ac396a4b7..eb4238c904 100644 --- a/package/uhttpd/Makefile +++ b/package/uhttpd/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uhttpd -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) diff --git a/package/uhttpd/src/uhttpd-tls.c b/package/uhttpd/src/uhttpd-tls.c index cb50616380..26143ddf71 100644 --- a/package/uhttpd/src/uhttpd-tls.c +++ b/package/uhttpd/src/uhttpd-tls.c @@ -35,12 +35,22 @@ SSL_CTX * uh_tls_ctx_init() int uh_tls_ctx_cert(SSL_CTX *c, const char *file) { - return SSL_CTX_use_certificate_file(c, file, SSL_FILETYPE_ASN1); + int rv; + + if( (rv = SSL_CTX_use_certificate_file(c, file, SSL_FILETYPE_PEM)) < 1 ) + rv = SSL_CTX_use_certificate_file(c, file, SSL_FILETYPE_ASN1); + + return rv; } int uh_tls_ctx_key(SSL_CTX *c, const char *file) { - return SSL_CTX_use_PrivateKey_file(c, file, SSL_FILETYPE_ASN1); + int rv; + + if( (rv = SSL_CTX_use_PrivateKey_file(c, file, SSL_FILETYPE_PEM)) < 1 ) + rv = SSL_CTX_use_PrivateKey_file(c, file, SSL_FILETYPE_ASN1); + + return rv; } void uh_tls_ctx_free(struct listener *l) diff --git a/package/uhttpd/src/uhttpd.c b/package/uhttpd/src/uhttpd.c index 152e0b452a..2f77a32a96 100644 --- a/package/uhttpd/src/uhttpd.c +++ b/package/uhttpd/src/uhttpd.c @@ -550,6 +550,7 @@ int main (int argc, char **argv) &hints, (opt == 's'), &conf ); + memset(bind, 0, sizeof(bind)); break; #ifdef HAVE_TLS |