summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD45
-rw-r--r--remove_get_entropy.patch51
3 files changed, 119 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..04111fe57bc1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = nginx-mod-auth-accessfabric
+ pkgdesc = Nginx module for authenticating requests from the ScaleFT Access Fabric
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://github.com/ScaleFt/nginx_auth_accessfabric
+ arch = i686
+ arch = x86_64
+ license = Apache
+ depends = glibc>=2.25
+ depends = nginx
+ depends = xjwt
+ source = https://nginx.org/download/nginx-1.14.0.tar.gz
+ source = https://nginx.org/download/nginx-1.14.0.tar.gz.asc
+ source = https://github.com/ScaleFT/nginx_auth_accessfabric/archive/v1.0.0.tar.gz
+ source = remove_get_entropy.patch
+ validpgpkeys = B0F4253373F8F6F510D42178520A9993A1C052F8
+ md5sums = 2d856aca3dfe1d32e3c9f8c4cac0cc95
+ md5sums = SKIP
+ md5sums = 28eac06b4247ed32939ca8c70e347342
+ md5sums = b10c128e65a36c7cb22fc9c2ec20ce92
+
+pkgname = nginx-mod-auth-accessfabric
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..66d16ced02a6
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer: Justin Gallardo <me@jirw.in>
+
+pkgname=nginx-mod-auth-accessfabric
+pkgver=1.0.0
+pkgrel=1
+
+_nginxver=1.14.0
+
+pkgdesc='Nginx module for authenticating requests from the ScaleFT Access Fabric'
+arch=('i686' 'x86_64')
+depends=('glibc>=2.25' 'nginx' 'xjwt')
+url="https://github.com/ScaleFt/nginx_auth_accessfabric"
+license=('Apache')
+
+source=(https://nginx.org/download/nginx-$_nginxver.tar.gz{,.asc}
+ https://github.com/ScaleFT/nginx_auth_accessfabric/archive/v$pkgver.tar.gz
+ remove_get_entropy.patch
+)
+validpgpkeys=(B0F4253373F8F6F510D42178520A9993A1C052F8)
+md5sums=('2d856aca3dfe1d32e3c9f8c4cac0cc95'
+ 'SKIP'
+ '28eac06b4247ed32939ca8c70e347342'
+ 'b10c128e65a36c7cb22fc9c2ec20ce92')
+
+prepare() {
+ cd "$srcdir"/nginx_auth_accessfabric-$pkgver
+ patch -Np1 -i "${srcdir}/remove_get_entropy.patch"
+}
+
+build() {
+ cd "$srcdir"/nginx-$_nginxver
+ ./configure --with-compat --add-dynamic-module=../nginx_auth_accessfabric-$pkgver
+ make modules
+}
+
+package() {
+ install -Dm644 "$srcdir/"nginx_auth_accessfabric-$pkgver/LICENSE \
+ "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+
+ cd "$srcdir"/nginx-$_nginxver/objs
+ for mod in *.so; do
+ install -Dm755 $mod "$pkgdir"/etc/nginx/modules/$mod
+ done
+}
+
diff --git a/remove_get_entropy.patch b/remove_get_entropy.patch
new file mode 100644
index 000000000000..9a7cc0ab9c90
--- /dev/null
+++ b/remove_get_entropy.patch
@@ -0,0 +1,51 @@
+diff -ura nginx_auth_accessfabric-1.0.0.old/ngx_http_auth_accessfabric_module.c nginx_auth_accessfabric-1.0.0.new/ngx_http_auth_accessfabric_module.c
+--- nginx_auth_accessfabric-1.0.0.old/ngx_http_auth_accessfabric_module.c 2018-01-02 20:03:57.000000000 -0800
++++ nginx_auth_accessfabric-1.0.0.new/ngx_http_auth_accessfabric_module.c 2018-07-29 20:05:05.630134694 -0700
+@@ -753,47 +753,6 @@
+ return req;
+ }
+
+-#ifdef __linux__
+-static int getentropy(void *buf, size_t buflen) {
+-/**
+- * getrandom is not available on most Linux yet, and we don't have
+- * an easy autoconf for it.
+- **/
+-#if 0
+- int ret;
+-
+- if (buflen > 256) {
+- goto failure;
+- }
+-
+- /* TODO(pquerna): old linux */
+- ret = getrandom(buf, buflen, 0);
+- if (ret < 0) {
+- return ret;
+- }
+-
+- if (ret == buflen) {
+- return 0;
+- }
+-failure:
+- errno = EIO;
+- return -1;
+-#else
+- size_t rlen;
+- FILE *fp = fopen("/dev/urandom", "rb");
+- if (fp == NULL) {
+- return -1;
+- }
+- rlen = fread(buf, 1, buflen, fp);
+- fclose(fp);
+- if (rlen == buflen) {
+- return 0;
+- }
+- return -1;
+-#endif
+-}
+-#endif
+-
+ static void af_jwk__refresh(af_jwk_refresher_t *jr) {
+ uint64_t random = 0;
+ uint64_t min = 1000;