[package] uhttpd:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 12 Jun 2010 12:58:11 +0000 (12:58 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 12 Jun 2010 12:58:11 +0000 (12:58 +0000)
- 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

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

index 3ac396a..eb4238c 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uhttpd
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uhttpd
-PKG_RELEASE:=10
+PKG_RELEASE:=11
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
index cb50616..26143dd 100644 (file)
@@ -35,12 +35,22 @@ SSL_CTX * uh_tls_ctx_init()
 
 int uh_tls_ctx_cert(SSL_CTX *c, const char *file)
 {
 
 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)
 {
 }
 
 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)
 }
 
 void uh_tls_ctx_free(struct listener *l)
index 152e0b4..2f77a32 100644 (file)
@@ -550,6 +550,7 @@ int main (int argc, char **argv)
                                        &hints, (opt == 's'), &conf
                                );
 
                                        &hints, (opt == 's'), &conf
                                );
 
+                               memset(bind, 0, sizeof(bind));
                                break;
 
 #ifdef HAVE_TLS
                                break;
 
 #ifdef HAVE_TLS
This page took 0.032912 seconds and 4 git commands to generate.