Hi,

I'm working on porting tlsdate to various different platforms as
documented here:

 https://github.com/ioerror/tlsdate/blob/master/INSTALL

OpenWRT is one platform where I'd like to see it available and sadly, I
don't have any systems with which to use or build OpenWRT at the moment.

I wonder if anyone could give me feedback? If this seems to build and is
useable, I'd be happy to put some more energy into it.

I've made a basic package and included it here as well as as an attachment:

#
# Copyright (C) 2008-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# Want to test this package? Try this:
# make package/tor-alpha/{clean,compile,install} V=99
#

include $(TOPDIR)/rules.mk

PKG_NAME:=tlsdate
PKG_VERSION:=0.0.6-git-tip
PKG_RELEASE:=1

# Eventually: PKG_SOURCE:=tlsdate-$(PKG_VERSION).tar.gz
# For testing we're using this url:
PKG_SOURCE:=tlsdate-git-tip-dist.tar.gz
PKG_SOURCE_URL:=https://people.torproject.org/~ioerror/src/
PKG_MD5SUM:=5c8d08478c731ae4abeca967342d1493
PKG_BUILD_DIR=$(BUILD_DIR)/tor-$(PKG_VERSION)/

PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

define Package/tlsdate
  SECTION:=net
  CATEGORY:=Network
  DEPENDS:=+libopenssl
  TITLE:=secure parasitic rdate replacement
  URL:=https://www.github.com/ioerror/tlsdate
endef

define Package/tlsdate/description
 tlsdate sets the local clock by securely connecting with TLS to remote
 servers and extracting the remote time out of the secure handshake. Unlike
 ntpdate, tlsdate uses TCP, for instance connecting to a remote HTTPS or TLS
 enabled service, and provides some protection against adversaries that
try to
 feed you malicious time information.
endef

define Package/tlsdate/conffiles
/etc/tlsdate/tlsdated.conf
/etc/tlsdate/ca-roots/tlsdate-ca-roots.conf
endef

CONFIGURE_ARGS += \
        --with-ssl-dir="$(STAGING_DIR)/usr" \

CONFIGURE_VARS += \
        CROSS_COMPILE="yes" \

# pass CFLAGS again to override -O2 set by configure
MAKE_FLAGS += \
        CFLAGS="$(TARGET_CFLAGS)" \

define Package/tlsdate/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tlsdate $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tlsdated $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tlsdate-helper $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tlsdate-routeup $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/etc/tlsdate/
        $(INSTALL_DIR) $(1)/etc/tlsdate/ca-roots/
        $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tlsdate/tlsdated.conf
$(1)/etc/tlsdate/tlsdated.conf
        $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tlsdate/tlsdate-ca-roots.conf
$(1)/etc/tlsdate/ca-roots/tlsdate-ca-roots.conf
endef

$(eval $(call BuildPackage,tlsdate))
# EOF

I'm open to suggestions - I'd like to add OpenWRT as an officially
supported build platform for tlsdate. I'd also like to ensure that it is
easy to install even for people who aren't interested in compiling it
from source themselves.

All the best,
Jacob
#
# Copyright (C) 2008-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# Want to test this package? Try this:
# make package/tor-alpha/{clean,compile,install} V=99
# 

include $(TOPDIR)/rules.mk

PKG_NAME:=tlsdate
PKG_VERSION:=0.0.6-git-tip
PKG_RELEASE:=1

# Eventually: PKG_SOURCE:=tlsdate-$(PKG_VERSION).tar.gz
# For testing we're using this url:
PKG_SOURCE:=tlsdate-git-tip-dist.tar.gz
PKG_SOURCE_URL:=https://people.torproject.org/~ioerror/src/
PKG_MD5SUM:=5c8d08478c731ae4abeca967342d1493
PKG_BUILD_DIR=$(BUILD_DIR)/tor-$(PKG_VERSION)/

PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

define Package/tlsdate
  SECTION:=net
  CATEGORY:=Network
  DEPENDS:=+libopenssl
  TITLE:=secure parasitic rdate replacement
  URL:=https://www.github.com/ioerror/tlsdate
endef

define Package/tlsdate/description
 tlsdate sets the local clock by securely connecting with TLS to remote
 servers and extracting the remote time out of the secure handshake. Unlike
 ntpdate, tlsdate uses TCP, for instance connecting to a remote HTTPS or TLS
 enabled service, and provides some protection against adversaries that try to
 feed you malicious time information.
endef

define Package/tlsdate/conffiles
/etc/tlsdate/tlsdated.conf
/etc/tlsdate/ca-roots/tlsdate-ca-roots.conf
endef

CONFIGURE_ARGS += \
        --with-ssl-dir="$(STAGING_DIR)/usr" \

CONFIGURE_VARS += \
        CROSS_COMPILE="yes" \

# pass CFLAGS again to override -O2 set by configure
MAKE_FLAGS += \
        CFLAGS="$(TARGET_CFLAGS)" \

define Package/tlsdate/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tlsdate $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tlsdated $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tlsdate-helper $(1)/usr/sbin/
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tlsdate-routeup $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/etc/tlsdate/
        $(INSTALL_DIR) $(1)/etc/tlsdate/ca-roots/
        $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tlsdate/tlsdated.conf 
$(1)/etc/tlsdate/tlsdated.conf
        $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/tlsdate/tlsdate-ca-roots.conf 
$(1)/etc/tlsdate/ca-roots/tlsdate-ca-roots.conf
endef

$(eval $(call BuildPackage,tlsdate))
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to