Merge branch 'master' of https://github.com/Diaoul/umurmur into Diaoul-master
authorMartin Johansson <martin@fatbob.nu>
Thu, 14 Apr 2011 21:20:53 +0000 (23:20 +0200)
committerMartin Johansson <martin@fatbob.nu>
Thu, 14 Apr 2011 21:20:53 +0000 (23:20 +0200)
configure.ac
openwrt/Makefile.openssl [deleted file]
openwrt/Makefile.polarssl [deleted file]
openwrt/files/umurmur.conf
src/client.c
src/conf.c
src/conf.h
src/main.c
src/ssl.c
src/version.h

index 6e2af6835592c8879904cbf723b8db8cb415820d..a5173bc28138a2d05621597aa1d3ddfb3e4aac1a 100644 (file)
@@ -29,7 +29,7 @@
 
 # Process this file with autoconf to produce a configure script.
 AC_PREREQ([2.63])
-AC_INIT([umurmur], [0.2.6], [http://code.google.com/p/umurmur/issues/entry], [umurmur], [http://code.google.com/p/umurmur])
+AC_INIT([umurmur], [0.2.7], [http://code.google.com/p/umurmur/issues/entry], [umurmur], [http://code.google.com/p/umurmur])
 AC_CONFIG_SRCDIR([src/client.h])
 AC_CONFIG_HEADERS([config.h])
 AM_INIT_AUTOMAKE
@@ -44,16 +44,16 @@ AC_PROG_CC
 AC_CHECK_HEADERS([google/protobuf-c/protobuf-c.h], [], [AC_MSG_ERROR([could not find google/protobuf-c/protobuf-c.h])])
 AC_CHECK_LIB([protobuf-c], [protobuf_c_data_buffer_init], [], [AC_MSG_ERROR([could not find protobuf-c library])])
 AC_CHECK_HEADERS([libconfig.h], [], [AC_MSG_ERROR([could not find libconfig.h])])
-AC_CHECK_LIB([config], [config_init], [], [AC_MSG_ERROR([could not find config])])
+AC_CHECK_LIB([config], [config_init], [], [AC_MSG_ERROR([could not find libconfig])])
 AS_IF([test "x$with_ssl" == xpolarssl], [
-       AC_CHECK_HEADERS([polarssl/ssl.h])
-       AC_CHECK_LIB([polarssl], [ssl_init])
+       AC_CHECK_HEADERS([polarssl/ssl.h], [], [AC_MSG_ERROR([could not find polarssl/ssl.h])])
+       AC_CHECK_LIB([polarssl], [ssl_init], [], [AC_MSG_ERROR([could not find libpolarssl])])
        AC_DEFINE([USE_POLARSSL], [], [Use PolarSSL])
 ])
 AS_IF([test "x$with_ssl" == xopenssl], [
-       AC_CHECK_HEADERS([openssl/ssl.h])
-       AC_CHECK_LIB([crypto], [BN_init])
-       AC_CHECK_LIB([ssl], [SSL_library_init])
+       AC_CHECK_HEADERS([openssl/ssl.h], [], [AC_MSG_ERROR([could not find openssl/ssl.h])])
+       AC_CHECK_LIB([crypto], [BN_init], [], [AC_MSG_ERROR([could not find libcrypto])])
+       AC_CHECK_LIB([ssl], [SSL_library_init], [], [AC_MSG_ERROR([could not find libssl])])
 ])
 
 # Checks for header files.
diff --git a/openwrt/Makefile.openssl b/openwrt/Makefile.openssl
deleted file mode 100644 (file)
index 5b6fb1d..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=umurmur-openssl
-PKG_VERSION:=0.2.6
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(INCLUDE_DIR)/package.mk
-
-
-define Package/umurmur-openssl
-       SECTION:=net
-       CATEGORY:=Network
-       TITLE:=uMurmur
-       DEPENDS:=+libopenssl +libconfig
-       URL:=http://code.google.com/p/umurmur
-       MAINTAINER:=Martin Johansson <martin@fatbob.nu>
-endef
-
-define Package/umurmur-openssl/description
-       Minimalistic Mumble server daemon.
-       Uses OpenSSL library for SSL and crypto.
-endef
-
-TARGET_CFLAGS := \
-        -DWRT_TARGET \
-        $(TARGET_CFLAGS)
-TARGET_LDFLAGS := \
-        -lcrypto -lssl \
-       $(TARGET_LDFLAGS)
-
-define Build/Prepare
-       mkdir -p $(PKG_BUILD_DIR)
-       $(CP) ./src/* $(PKG_BUILD_DIR)/
-endef
-
-define Build/CompileTarget
-       CFLAGS="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)"\
-       $(MAKE) -C $(PKG_BUILD_DIR)/umurmur.$(1)/umurmur \
-               all
-endef
-
-define Package/umurmur-openssl/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/umurmurd $(1)/usr/bin/
-       $(INSTALL_DIR) $(1)/etc
-       $(INSTALL_CONF) ./openwrt/files/umurmur.conf $(1)/etc/
-       $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) ./openwrt/files/umurmur.init $(1)/etc/init.d/umurmur
-       $(INSTALL_DIR) $(1)/etc/umurmur
-endef
-
-$(eval $(call BuildPackage,umurmur-openssl))
-
diff --git a/openwrt/Makefile.polarssl b/openwrt/Makefile.polarssl
deleted file mode 100644 (file)
index 8d641af..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=umurmur-polarssl
-PKG_VERSION:=0.2.6
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
-
-include $(INCLUDE_DIR)/package.mk
-
-
-define Package/umurmur-polarssl
-       SECTION:=net
-       CATEGORY:=Network
-       TITLE:=uMurmur
-       DEPENDS:=+libpolarssl +libconfig
-       URL:=http://code.google.com/p/umurmur
-       MAINTAINER:=Martin Johansson <martin@fatbob.nu>
-endef
-
-define Package/umurmur-polarssl/description
-       Minimalistic Mumble server daemon.
-       Uses the PolarSSL library for SSL and crypto.
-endef
-
-TARGET_CFLAGS := \
-        -DWRT_TARGET \
-       -DUSE_POLARSSL \
-        $(TARGET_CFLAGS)
-TARGET_LDFLAGS := \
-        -lpolarssl \
-       $(TARGET_LDFLAGS)
-
-define Build/Prepare
-       mkdir -p $(PKG_BUILD_DIR)
-       $(CP) ./src/* $(PKG_BUILD_DIR)/
-endef
-
-define Build/CompileTarget
-       CFLAGS="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)"\
-       $(MAKE) -C $(PKG_BUILD_DIR)/umurmur.$(1)/umurmur \
-               all
-endef
-
-define Package/umurmur-polarssl/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/umurmurd $(1)/usr/bin/
-       $(INSTALL_DIR) $(1)/etc
-       $(INSTALL_CONF) ./openwrt/files/umurmur.conf $(1)/etc/
-       $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) ./openwrt/files/umurmur.init $(1)/etc/init.d/umurmur
-       $(INSTALL_DIR) $(1)/etc/umurmur
-endef
-
-$(eval $(call BuildPackage,umurmur-polarssl))
-
index 826746bda7fc5759169aedc52b2222bc6c0e01d8..fad2b8091c3c0522354cc1e48ffde81f7eee00cb 100644 (file)
@@ -5,12 +5,14 @@ private_key = "/etc/umurmur/key.key";
 password = "";
 max_users = 10;
 
-# Username and groupname for privilege dropping
+# username and groupname for privilege dropping.
+# Will attempt to switch user if set. 
 # username = "";
+# If groupname not set the user's default login group will be used
 # groupname = "";
 
-# bindaddr = "192.168.1.1";
 # bindport = 64738;
+# bindaddr = "192.168.1.1";
 
 # Root channel must always be defined first.
 # If a channel has a parent, the parent must be defined before the child channel(s).
index e304f35b25fea204e5d225d7d11cd9f24982803a..e190a0b9f67fa30f94ebed2fc8a6951dd8f9a765 100644 (file)
@@ -690,7 +690,6 @@ int Client_read_udp()
                                        memcpy(&itr->remote_udp, &from, sizeof(struct sockaddr_in));
                                        break;
                                }
-                               else Log_warn("Bad cryptstate from peer");
                        }
                } /* while */
        }
index e3d417c262b6c5004720d5c66ac5a4b18d1b2e4a..38b32852775c1727ffbd4c045515294a42c4f611 100644 (file)
@@ -40,7 +40,6 @@
 
 static config_t configuration;
 
-#define DEFAULT_CONFIG "/etc/umurmur.conf"
 #define DEFAULT_WELCOME "Welcome to uMurmur!"
 #define DEFAULT_MAX_CLIENTS 10
 #define DEFAULT_MAX_BANDWIDTH 48000
index 065544654b3f73ad4dfa08495d08f877dcbf73e8..32531f8653ed2874322a36802fc09f826aae0d9f 100644 (file)
@@ -33,6 +33,8 @@
 
 #include "messages.h"
 
+#define DEFAULT_CONFIG "/etc/umurmur.conf"
+
 typedef enum param {
        CERTIFICATE,
        KEY,
index fce997a77a471f4201d3706e107f0e51ac1fee58..1e22885389947ed03be9ea01508c7d36d236f0b4 100644 (file)
@@ -217,16 +217,16 @@ void setscheduler()
 void printhelp()
 {
        printf("uMurmur version %s. Mumble protocol %d.%d.%d\n", UMURMUR_VERSION, PROTVER_MAJOR, PROTVER_MINOR, PROTVER_PATCH);
-       printf("Usage: umurmurd [-d] [-p <pidfile>] [-c <conf file>] [-h]\n");
-       printf("       -d             - Do not daemonize\n");
-       printf("       -p <pidfile>   - Write PID to this file\n");
-       printf("       -c <conf file> - Specify configuration file\n");
+       printf("Usage: umurmurd [-d] [-r] [-h] [-p <pidfile>] [-c <conf file>] [-a <addr>] [-b <port>]\n");
+       printf("       -d             - Do not daemonize - run in foreground.\n");
 #ifdef _POSIX_PRIORITY_SCHEDULING
        printf("       -r             - Run with realtime priority\n");
 #endif
+       printf("       -h             - Print this help\n");
+       printf("       -p <pidfile>   - Write PID to this file\n");
+       printf("       -c <conf file> - Specify configuration file (default %s)\n", DEFAULT_CONFIG);
        printf("       -a <address>   - Bind to IP address\n");
        printf("       -b <port>      - Bind to port\n");
-       printf("       -h             - Print this help\n");
        exit(0);
 }
 
index 6ed9aea15df1708fd46da57b73dc640eb478f354..44fa0c9378d07a0eda9aaa5f7542adcb9154f3c7 100644 (file)
--- a/src/ssl.c
+++ b/src/ssl.c
@@ -69,7 +69,7 @@ bool_t builtInTestCertificate;
 havege_state hs; /* exported to crypt.c */
 
 /* DH prime */
-const char *my_dhm_P =
+char *my_dhm_P =
        "9CE85640903BF123906947FEDE767261" \
        "D9B4A973EB8F7D984A8C656E2BCC161C" \
        "183D4CA471BA78225F940F16D1D99CA3" \
@@ -77,64 +77,28 @@ const char *my_dhm_P =
        "44FF6AB553EC7073AD0CB608F2A3B480" \
        "19E6C02BCED40BD30E91BB2469089670" \
        "DEF409C08E8AC24D1732A6128D2220DC53";
-const char *my_dhm_G = "4";
-
-const char *test_key =
-       "-----BEGIN RSA PRIVATE KEY-----\r\n"
-       "MIICXAIBAAKBgQC/zZ5p/st9JUgoFIuNCwyYJhKhnqKlAk36RJJAXhJ/3FZCThQK\r\n"
-       "J0jxMCjnQb9envZPIKrAfyDtlEGKU8OI2HvDsFL7Y2fNjew0R9DoUyzPRVBInfW9\r\n"
-       "JP03aiOldpooTjXBrzoZV+DGqRYJE/IRJEyXir5NEJu624bMJm0XDVkxiwIDAQAB\r\n"
-       "AoGAPcFJiR01jYSsd+Mtj2sIUhCoHQuDmJdmXfcoE7t2P17FEzIqd55weN+lu9fK\r\n"
-       "cv/BlHaTI8mK45PBinUv1ubE6gzzyLtNgBW7ko8i23YQNMS4+8ApZZoCFsVbN533\r\n"
-       "/mFYcOmWpdgIsAOyi3gAyO5OyGA71a3gkNX+MDYc7PgbTkkCQQDq1NN/j6xVw4qc\r\n"
-       "3qunsMOVJxln7Gkgt0fOrCV0WltJNkKYiARwtpvB/SHIj6nHhun+J/ee/v+QjAL4\r\n"
-       "aUwC8OmnAkEA0RfWWVQ2Yxk9QjRcqcpDddtc+9xxM6Dt+edGDSYKRUB/S2cl/Sdg\r\n"
-       "abFdrFEnFdO03VknCrqUgweegeUJhU1tfQJBAKLFFjxK59cijMejCDRZr5eI3HFO\r\n"
-       "Sqgkoh8871Ew+ClM9OgpD3rY+CmEPZB5E+N7PmGublLEyXv1sHFi+w7m0e0CQDnH\r\n"
-       "eoYIzVapHNJ0ob6Rk/63dYRrsCRyLhDGpgbwIhps7kAp6sd/4BaU2qvJaSGQ9QPN\r\n"
-       "pQpD8NIcguKmJfFeKgkCQBABatS74xI2UAW/IIbRBg8a8z4v5JxEnQwp0EtmON2I\r\n"
-       "+AVBenUVFjpdjaaQ2/2IEgEwnzRfbERQfUlAkjczRaM=\r\n"
-       "-----END RSA PRIVATE KEY-----\r\n";
-
-const char *test_cert =
-       "-----BEGIN CERTIFICATE-----\r\n"
-       "MIICfDCCAeWgAwIBAgIJANEN9Jb9sp0oMA0GCSqGSIb3DQEBBQUAMFcxCzAJBgNV\r\n"
-       "BAYTAlNFMRMwEQYDVQQHDApHb3RoZW5idXJnMRAwDgYDVQQKDAd1TXVybXVyMSEw\r\n"
-       "HwYDVQQDDBh1TXVybXVyIHRlc3QgY2VydGlmaWNhdGUwHhcNMTEwMzIyMjIxMTEy\r\n"
-       "WhcNMjEwMzE5MjIxMTEyWjBXMQswCQYDVQQGEwJTRTETMBEGA1UEBwwKR290aGVu\r\n"
-       "YnVyZzEQMA4GA1UECgwHdU11cm11cjEhMB8GA1UEAwwYdU11cm11ciB0ZXN0IGNl\r\n"
-       "cnRpZmljYXRlMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC/zZ5p/st9JUgo\r\n"
-       "FIuNCwyYJhKhnqKlAk36RJJAXhJ/3FZCThQKJ0jxMCjnQb9envZPIKrAfyDtlEGK\r\n"
-       "U8OI2HvDsFL7Y2fNjew0R9DoUyzPRVBInfW9JP03aiOldpooTjXBrzoZV+DGqRYJ\r\n"
-       "E/IRJEyXir5NEJu624bMJm0XDVkxiwIDAQABo1AwTjAdBgNVHQ4EFgQUyI0/J6gS\r\n"
-       "G7vEZl1nKq9rAYAg/TMwHwYDVR0jBBgwFoAUyI0/J6gSG7vEZl1nKq9rAYAg/TMw\r\n"
-       "DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCGL3T4a7g+MUtcjIq2XLON\r\n"
-       "cN/oPgPpMNcSPj7zQF1NVzjeQagvKIe3mL5sNIYuoIQm1Xm7aH2ueruhH0wkSOf0\r\n"
-       "+7U/g7r70U1CFWzfgwzz3EWRq3hUQmZ9/Xy9V2P/iRrFNyAKE8MneuVv3aAIN6/W\r\n"
-       "rWVxhCquqhFM3yIGe0f6hw==\r\n"
-       "-----END CERTIFICATE-----\r\n";
-
+char *my_dhm_G = "4";
 
 static void initTestCert()
 {
        int rc;
        builtInTestCertificate = true;
-       rc = x509parse_crt(&certificate, (unsigned char *)test_cert,
-                                          strlen(test_cert));  
+       rc = x509parse_crt(&certificate, (unsigned char *)test_srv_crt,
+                                          strlen(test_srv_crt));       
        if (rc != 0)
                Log_fatal("Could not parse built-in test certificate");
-       rc = x509parse_crt(&certificate, (unsigned char *)test_cert,
-                                          strlen(test_cert));  
+       rc = x509parse_crt(&certificate, (unsigned char *)test_ca_crt,
+                                          strlen(test_ca_crt));
        if (rc != 0)
-               Log_fatal("Could not parse built-in test certificate");
+               Log_fatal("Could not parse built-in test CA certificate");
 }
 
 static void initTestKey()
 {
        int rc;
        
-       rc = x509parse_key(&key, (unsigned char *)test_key,
-                                          strlen(test_key), NULL, 0);
+       rc = x509parse_key(&key, (unsigned char *)test_srv_key,
+                                          strlen(test_srv_key), NULL, 0);
        if (rc != 0)
                Log_fatal("Could not parse built-in test RSA key");
 }
index f556d1f3133f3550d33558d4f0715fdc97c7a58b..606e5bebc8611cad98e750189fa8440396b5f2a2 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef VERSION_H_989876
 #define VERSION_H_989876
 
-#define UMURMUR_VERSION "0.2.6"
+#define UMURMUR_VERSION "0.2.7"
 
 #endif