public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] dev/c1pher:master commit in: sys-auth/libpam-google-authenticator/, ...
@ 2012-06-06 18:48 Dane Smith
  0 siblings, 0 replies; 3+ messages in thread
From: Dane Smith @ 2012-06-06 18:48 UTC (permalink / raw
  To: gentoo-commits

commit:     ed09a11925db43f27ff9010f6328510aab34fa0b
Author:     Dane Smith <c1pher <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  6 18:47:46 2012 +0000
Commit:     Dane Smith <c1pher <AT> gentoo <DOT> org>
CommitDate: Wed Jun  6 18:47:46 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/c1pher.git;a=commit;h=ed09a119

google-authenticator PAM module.

---
 sys-auth/libpam-google-authenticator/Manifest      |    3 +
 .../files/makefile.patch                           |   41 ++++++++++++++++++++
 .../libpam-google-authenticator-1.0.ebuild         |   34 ++++++++++++++++
 3 files changed, 78 insertions(+), 0 deletions(-)

diff --git a/sys-auth/libpam-google-authenticator/Manifest b/sys-auth/libpam-google-authenticator/Manifest
new file mode 100644
index 0000000..d892652
--- /dev/null
+++ b/sys-auth/libpam-google-authenticator/Manifest
@@ -0,0 +1,3 @@
+AUX makefile.patch 2387 RMD160 0b70faa355d224525a428f465e7b9642f531823b SHA1 736e82dabf41b0deb58bc7725cc990abe1246864 SHA256 71c866cad836492f35bbc2fde24e6fc2430181de31421af8a97305eec3b82842
+DIST libpam-google-authenticator-1.0-source.tar.bz2 32708 RMD160 ce26a2f805f36a82a7ab3d930116a73fb444e037 SHA1 017b7d89989f1624e360abe02d6b27a6298d285d SHA256 80426045d13ce7a2bf56c692ccfb1751cef3c7484752ad40738facf729264d4b
+EBUILD libpam-google-authenticator-1.0.ebuild 682 RMD160 e73b10b6b01e92569cafc0904f3b94cee53a2afa SHA1 9e47403d126dc7c48ee6d367c3b4483b34292f6a SHA256 238d96809743c8f3a1e58f5838e95f617af12ff604c6b0b89a2d79bd927bcca0

diff --git a/sys-auth/libpam-google-authenticator/files/makefile.patch b/sys-auth/libpam-google-authenticator/files/makefile.patch
new file mode 100644
index 0000000..2792456
--- /dev/null
+++ b/sys-auth/libpam-google-authenticator/files/makefile.patch
@@ -0,0 +1,41 @@
+--- Makefile	2012-06-06 14:39:56.000000000 -0400
++++ Makefile.new	2012-06-06 14:40:05.000000000 -0400
+@@ -28,6 +28,7 @@
+ DEF_LDFLAGS := $(shell [ `uname` = SunOS ] && echo ' -mimpure-text') $(LDFLAGS)
+ LDL_LDFLAGS := $(shell $(CC) -shared -ldl -xc -o /dev/null /dev/null          \
+                        >/dev/null 2>&1 && echo ' -ldl')
++DESTDIR := 
+ 
+ all: google-authenticator pam_google_authenticator.so demo                    \
+      pam_google_authenticator_unittest
+@@ -43,26 +44,11 @@
+ 	    *.c *.h *.html Makefile FILEFORMAT README utc-time
+ 
+ install: all
+-	@dst="`find /lib*/security /lib*/*/security -maxdepth 1               \
+-	            -name pam_unix.so -printf '%H' -quit 2>/dev/null`";       \
+-	[ -d "$${dst}" ] || dst=/lib/security;                                \
+-	[ -d "$${dst}" ] || dst=/usr/lib;                                     \
+-	sudo=; if [ $$(id -u) -ne 0 ]; then                                   \
+-	  echo "You need to be root to install this module.";                 \
+-	  if [ -x /usr/bin/sudo ]; then                                       \
+-	    echo "Invoking sudo:";                                            \
+-	    sudo=sudo;                                                        \
+-	  else                                                                \
+-	    exit 1;                                                           \
+-	  fi;                                                                 \
+-	fi;                                                                   \
+-	echo cp pam_google_authenticator.so $${dst};                          \
+-	tar fc - pam_google_authenticator.so | $${sudo} tar ofxC - $${dst};   \
++	echo install -m 755 pam_google_authenticator.so ${DESTDIR};           \
++	install -m 755 pam_google_authenticator.so ${DESTDIR};                \
+ 	                                                                      \
+-	echo cp google-authenticator /usr/local/bin;                          \
+-	tar fc - google-authenticator | $${sudo} tar ofxC - /usr/local/bin;   \
+-	$${sudo} chmod 755 $${dst}/pam_google_authenticator.so                \
+-	                   /usr/local/bin/google-authenticator
++	echo install -m 755 google-authenticator ${DESTDIR};		      \
++	install -m 755 google-authenticator ${DESTDIR};			      \
+ 
+ clean:
+ 	$(RM) *.o *.so core google-authenticator demo                         \

diff --git a/sys-auth/libpam-google-authenticator/libpam-google-authenticator-1.0.ebuild b/sys-auth/libpam-google-authenticator/libpam-google-authenticator-1.0.ebuild
new file mode 100644
index 0000000..2c67ddf
--- /dev/null
+++ b/sys-auth/libpam-google-authenticator/libpam-google-authenticator-1.0.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=4
+inherit pam
+
+DESCRIPTION="Google Authentiator PAM plugin"
+HOMEPAGE="http://code.google.com/p/google-authenticator/"
+SRC_URI="http://google-authenticator.googlecode.com/files/${P}-source.tar.bz2"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="sys-libs/pam"
+RDEPEND="${DEPEND}"
+
+src_prepare(){
+	epatch "${FILESDIR}/makefile.patch"
+}
+
+src_install(){
+	insinto $(getpam_mod_dir)
+	doins pam_google_authenticator.so
+	dobin google-authenticator
+
+	dodoc README
+}
+
+pkg_postinst(){
+	elog "For setup information check the installed README"
+}



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] dev/c1pher:master commit in: sys-auth/libpam-google-authenticator/, ...
@ 2012-06-07 14:44 Dane Smith
  0 siblings, 0 replies; 3+ messages in thread
From: Dane Smith @ 2012-06-07 14:44 UTC (permalink / raw
  To: gentoo-commits

commit:     be49e7040f6b6f770187f70f324e81349b1fdfc7
Author:     Dane Smith <c1pher <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  7 14:44:33 2012 +0000
Commit:     Dane Smith <c1pher <AT> gentoo <DOT> org>
CommitDate: Thu Jun  7 14:44:33 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/c1pher.git;a=commit;h=be49e704

drop unneded patch.

---
 sys-auth/libpam-google-authenticator/Manifest      |    3 +-
 .../files/makefile.patch                           |   41 --------------------
 .../libpam-google-authenticator-1.0.ebuild         |    4 --
 3 files changed, 1 insertions(+), 47 deletions(-)

diff --git a/sys-auth/libpam-google-authenticator/Manifest b/sys-auth/libpam-google-authenticator/Manifest
index d892652..bd20b65 100644
--- a/sys-auth/libpam-google-authenticator/Manifest
+++ b/sys-auth/libpam-google-authenticator/Manifest
@@ -1,3 +1,2 @@
-AUX makefile.patch 2387 RMD160 0b70faa355d224525a428f465e7b9642f531823b SHA1 736e82dabf41b0deb58bc7725cc990abe1246864 SHA256 71c866cad836492f35bbc2fde24e6fc2430181de31421af8a97305eec3b82842
 DIST libpam-google-authenticator-1.0-source.tar.bz2 32708 RMD160 ce26a2f805f36a82a7ab3d930116a73fb444e037 SHA1 017b7d89989f1624e360abe02d6b27a6298d285d SHA256 80426045d13ce7a2bf56c692ccfb1751cef3c7484752ad40738facf729264d4b
-EBUILD libpam-google-authenticator-1.0.ebuild 682 RMD160 e73b10b6b01e92569cafc0904f3b94cee53a2afa SHA1 9e47403d126dc7c48ee6d367c3b4483b34292f6a SHA256 238d96809743c8f3a1e58f5838e95f617af12ff604c6b0b89a2d79bd927bcca0
+EBUILD libpam-google-authenticator-1.0.ebuild 627 RMD160 95b8b8c213930976e5a47d624ae7ad0aaa852582 SHA1 63048eeef57535f1079e7596b72797fa91545bad SHA256 859bd5f93cc36c154b8bddaa7ccc9788da8bec0d329986be1108ae729d201b7c

diff --git a/sys-auth/libpam-google-authenticator/files/makefile.patch b/sys-auth/libpam-google-authenticator/files/makefile.patch
deleted file mode 100644
index 2792456..0000000
--- a/sys-auth/libpam-google-authenticator/files/makefile.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- Makefile	2012-06-06 14:39:56.000000000 -0400
-+++ Makefile.new	2012-06-06 14:40:05.000000000 -0400
-@@ -28,6 +28,7 @@
- DEF_LDFLAGS := $(shell [ `uname` = SunOS ] && echo ' -mimpure-text') $(LDFLAGS)
- LDL_LDFLAGS := $(shell $(CC) -shared -ldl -xc -o /dev/null /dev/null          \
-                        >/dev/null 2>&1 && echo ' -ldl')
-+DESTDIR := 
- 
- all: google-authenticator pam_google_authenticator.so demo                    \
-      pam_google_authenticator_unittest
-@@ -43,26 +44,11 @@
- 	    *.c *.h *.html Makefile FILEFORMAT README utc-time
- 
- install: all
--	@dst="`find /lib*/security /lib*/*/security -maxdepth 1               \
--	            -name pam_unix.so -printf '%H' -quit 2>/dev/null`";       \
--	[ -d "$${dst}" ] || dst=/lib/security;                                \
--	[ -d "$${dst}" ] || dst=/usr/lib;                                     \
--	sudo=; if [ $$(id -u) -ne 0 ]; then                                   \
--	  echo "You need to be root to install this module.";                 \
--	  if [ -x /usr/bin/sudo ]; then                                       \
--	    echo "Invoking sudo:";                                            \
--	    sudo=sudo;                                                        \
--	  else                                                                \
--	    exit 1;                                                           \
--	  fi;                                                                 \
--	fi;                                                                   \
--	echo cp pam_google_authenticator.so $${dst};                          \
--	tar fc - pam_google_authenticator.so | $${sudo} tar ofxC - $${dst};   \
-+	echo install -m 755 pam_google_authenticator.so ${DESTDIR};           \
-+	install -m 755 pam_google_authenticator.so ${DESTDIR};                \
- 	                                                                      \
--	echo cp google-authenticator /usr/local/bin;                          \
--	tar fc - google-authenticator | $${sudo} tar ofxC - /usr/local/bin;   \
--	$${sudo} chmod 755 $${dst}/pam_google_authenticator.so                \
--	                   /usr/local/bin/google-authenticator
-+	echo install -m 755 google-authenticator ${DESTDIR};		      \
-+	install -m 755 google-authenticator ${DESTDIR};			      \
- 
- clean:
- 	$(RM) *.o *.so core google-authenticator demo                         \

diff --git a/sys-auth/libpam-google-authenticator/libpam-google-authenticator-1.0.ebuild b/sys-auth/libpam-google-authenticator/libpam-google-authenticator-1.0.ebuild
index 2c67ddf..e716524 100644
--- a/sys-auth/libpam-google-authenticator/libpam-google-authenticator-1.0.ebuild
+++ b/sys-auth/libpam-google-authenticator/libpam-google-authenticator-1.0.ebuild
@@ -17,10 +17,6 @@ IUSE=""
 DEPEND="sys-libs/pam"
 RDEPEND="${DEPEND}"
 
-src_prepare(){
-	epatch "${FILESDIR}/makefile.patch"
-}
-
 src_install(){
 	insinto $(getpam_mod_dir)
 	doins pam_google_authenticator.so



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] dev/c1pher:master commit in: sys-auth/libpam-google-authenticator/, ...
@ 2013-05-13 16:21 Dane Smith
  0 siblings, 0 replies; 3+ messages in thread
From: Dane Smith @ 2013-05-13 16:21 UTC (permalink / raw
  To: gentoo-commits

commit:     e3b7c425ea3b4bc5130944b78e17d9c53e350fe7
Author:     Dane Smith <c1pher <AT> gentoo <DOT> org>
AuthorDate: Mon May 13 17:19:34 2013 +0000
Commit:     Dane Smith <c1pher <AT> gentoo <DOT> org>
CommitDate: Mon May 13 17:19:34 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/c1pher.git;a=commit;h=e3b7c425

Allow time configuration.

---
 sys-auth/libpam-google-authenticator/Manifest      |    6 +-
 .../files/allow_time_config.patch                  |   65 ++++++++++++++++++++
 .../libpam-google-authenticator-1.0.ebuild         |   14 +++-
 3 files changed, 80 insertions(+), 5 deletions(-)

diff --git a/sys-auth/libpam-google-authenticator/Manifest b/sys-auth/libpam-google-authenticator/Manifest
index bd20b65..5ca2680 100644
--- a/sys-auth/libpam-google-authenticator/Manifest
+++ b/sys-auth/libpam-google-authenticator/Manifest
@@ -1,2 +1,4 @@
-DIST libpam-google-authenticator-1.0-source.tar.bz2 32708 RMD160 ce26a2f805f36a82a7ab3d930116a73fb444e037 SHA1 017b7d89989f1624e360abe02d6b27a6298d285d SHA256 80426045d13ce7a2bf56c692ccfb1751cef3c7484752ad40738facf729264d4b
-EBUILD libpam-google-authenticator-1.0.ebuild 627 RMD160 95b8b8c213930976e5a47d624ae7ad0aaa852582 SHA1 63048eeef57535f1079e7596b72797fa91545bad SHA256 859bd5f93cc36c154b8bddaa7ccc9788da8bec0d329986be1108ae729d201b7c
+AUX allow_time_config.patch 2229 SHA256 b6baddfe1c30f3a4d4f3326795693fff8504c7f8bf0d8b5bc2d5eadced31fddc SHA512 b1f00fdee909f1020dbc662474c2380d6e69639845df97d162df6a90d8b44bdec9d6664adf3ee179f517132520558cbf15116c7a01fd311d66f1ddd19d6ecb9c WHIRLPOOL a81ad7c079455e54d4eb6cba402f3477eec54bfee19d33d3ab231db524ae00c1cd2074a1b83640cd10cf11c720381ab0e96a4b3b5edfa94f8b076f3139a8f3e2
+DIST libpam-google-authenticator-1.0-source.tar.bz2 32708 SHA256 80426045d13ce7a2bf56c692ccfb1751cef3c7484752ad40738facf729264d4b SHA512 92ec473b07e2e46f969cd0a1a6f5707892800418442ad7d046ebc1195bbd1654e396f53245056c7eee38decaeb1997102f9aa988b7da1d734dcd2b104402ef8c WHIRLPOOL fff94006035d0751ff690f81d827a33c5d304f86a48809fa889138bb29ae1f9c47315fb0c3548d29dae545cac63db9f35a9bb6e439f49cd4a6571241a43e4c6a
+EBUILD libpam-google-authenticator-1.0.ebuild 758 SHA256 48b78cc12150732399906633f99c564106557ac8af9ba84d9fe0a7abe2b12c87 SHA512 a60ac6e15d8f992bade946d239a34dfb36d8a2be40186189e50ab6e29125c72b6cc8311b72273caef44c1e823d2a0583afc0a25074615bb6605c90c3b40fac53 WHIRLPOOL 7e690d6a2026f12e6796e329ab764a9f8f84439958f8ec0f5428ca43a6b046f595a4340eb3fda32cbb4c75ab29480b45cd44f6afeda207c2d880da7f1bc8cc2a
+MISC TODO 23 SHA256 4929fa9118a621134d43b84969fe4c79c89a342ab5f56447cf936ff07eefbf58 SHA512 0422ce060bf4aa0506429c4e0a66df2e511b3e8f29ecddc76e5258f7f29003f4a62998269588f86c5d6cee0a5e271082a5f72edd0332018ca95c0689824d457b WHIRLPOOL f4deebbeb38a5ddf0d7cb89a82821d075e624587a453cc0978faf23d88224033280b1cff44ef818c707c5cf106228fdafe7cf0b1ea60b4685333a8c9981e063b

diff --git a/sys-auth/libpam-google-authenticator/files/allow_time_config.patch b/sys-auth/libpam-google-authenticator/files/allow_time_config.patch
new file mode 100644
index 0000000..85c48b0
--- /dev/null
+++ b/sys-auth/libpam-google-authenticator/files/allow_time_config.patch
@@ -0,0 +1,65 @@
+From ab2b4ba85e417eb0b4a497da84cd31b7e4a2bbe8 Mon Sep 17 00:00:00 2001
+From: Brian Ristuccia <brian@ristuccia.com>
+Date: Tue, 14 Aug 2012 11:42:55 -0400
+Subject: [PATCH] Add configuration option for TOTP time step size. Previously the time step
+ was hardcoded to 30 seconds, which is now the default.
+
+---
+ libpam/FILEFORMAT                 |    2 ++
+ libpam/pam_google_authenticator.c |   19 ++++++++++++++++---
+ 2 files changed, 18 insertions(+), 3 deletions(-)
+
+diff --git a/libpam/FILEFORMAT b/libpam/FILEFORMAT
+index 0f0ad8a..b267b68 100644
+--- a/libpam/FILEFORMAT
++++ b/libpam/FILEFORMAT
+@@ -54,6 +54,8 @@ Currently, the following options are recognized:
+     for most users as invalid login attempts and generated-but-not-used
+     tokens both contribute to synchronization problems.
+ 
++  TIME_STEP_SIZE n
++    the default value time step size is 30 seconds.
+ 
+ Any all-numeric sequence of eight-digit numbers are randomly generated
+ one-time tokens. The user can enter any arbitrary one-time code
+diff --git a/libpam/pam_google_authenticator.c b/libpam/pam_google_authenticator.c
+index 159e89e..e8dd5ab 100644
+--- a/libpam/pam_google_authenticator.c
++++ b/libpam/pam_google_authenticator.c
+@@ -502,8 +502,8 @@ static time_t get_time(void) {
+ }
+ #endif
+ 
+-static int get_timestamp(void) {
+-  return get_time()/30;
++static int get_timestamp(int step_size) {
++  return get_time()/step_size;
+ }
+ 
+ static int comparator(const void *a, const void *b) {
+@@ -1160,8 +1160,21 @@ static int check_timebased_code(pam_handle_t *pamh, const char*secret_filename,
+     return 1;
+   }
+ 
++  const char *step_size_str = get_cfg_value(pamh, "TIME_STEP_SIZE", *buf);
++  if (step_size_str == &oom) {
++    // Out of memory. This is a fatal error
++    return -1;
++  }
++  
++  // Default step size of 30s
++  int step_size = 30;
++  if (step_size_str) {
++    step_size = (int)strtol(step_size_str, NULL, 10);
++  }
++  free((void *)step_size_str);
++  
+   // Compute verification codes and compare them with user input
+-  const int tm = get_timestamp();
++  const int tm = get_timestamp(step_size);
+   const char *skew_str = get_cfg_value(pamh, "TIME_SKEW", *buf);
+   if (skew_str == &oom) {
+     // Out of memory. This is a fatal error
+-- 
+1.7.2.5
+

diff --git a/sys-auth/libpam-google-authenticator/libpam-google-authenticator-1.0.ebuild b/sys-auth/libpam-google-authenticator/libpam-google-authenticator-1.0.ebuild
index e716524..6a6a31a 100644
--- a/sys-auth/libpam-google-authenticator/libpam-google-authenticator-1.0.ebuild
+++ b/sys-auth/libpam-google-authenticator/libpam-google-authenticator-1.0.ebuild
@@ -3,7 +3,7 @@
 # $Header: $
 
 EAPI=4
-inherit pam
+inherit eutils pam toolchain-funcs
 
 DESCRIPTION="Google Authentiator PAM plugin"
 HOMEPAGE="http://code.google.com/p/google-authenticator/"
@@ -17,7 +17,15 @@ IUSE=""
 DEPEND="sys-libs/pam"
 RDEPEND="${DEPEND}"
 
-src_install(){
+src_prepare() {
+	epatch "${FILESDIR}/allow_time_config.patch"
+}
+
+src_compile() {
+	emake CC=$(tc-getCC)
+}
+
+src_install() {
 	insinto $(getpam_mod_dir)
 	doins pam_google_authenticator.so
 	dobin google-authenticator
@@ -25,6 +33,6 @@ src_install(){
 	dodoc README
 }
 
-pkg_postinst(){
+pkg_postinst() {
 	elog "For setup information check the installed README"
 }


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-13 16:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-13 16:21 [gentoo-commits] dev/c1pher:master commit in: sys-auth/libpam-google-authenticator/, Dane Smith
  -- strict thread matches above, loose matches on Subject: below --
2012-06-07 14:44 Dane Smith
2012-06-06 18:48 Dane Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox