uhttpd: - fix incorrect parsing of multiple listen options (#7458) - support PEM...
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 12 Jun 2010 12:58:11 +0000 (12:58 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 12 Jun 2010 12:58:11 +0000 (12:58 +0000)
SVN-Revision: 21762

package/uhttpd/Makefile
package/uhttpd/src/uhttpd-tls.c
package/uhttpd/src/uhttpd.c

index 3ac396a4b70dfa7de87b2841f36bd70e219edc1c..eb4238c90411230648fb4dbdf3ee0ad6a2aeb507 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uhttpd
-PKG_RELEASE:=10
+PKG_RELEASE:=11
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
index cb5061638078c75e919371bb45b5efd3118e8976..26143ddf7108c0c9f084a6036a1fab18b6bdbd3c 100644 (file)
@@ -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)
index 152e0b452a7899e9124ae3787e71647e076357e9..2f77a32a965c794f1c5006239af0aa6b9065daea 100644 (file)
@@ -550,6 +550,7 @@ int main (int argc, char **argv)
                                        &hints, (opt == 's'), &conf
                                );
 
+                               memset(bind, 0, sizeof(bind));
                                break;
 
 #ifdef HAVE_TLS