yubikeyedup tweaks: there's a flash.py script which is meant for running

as a separate command, so modify the patch-added setup.py to install it,
and patch to call yubikeyed-dbconf rather than the (non-executable) dbconf.py
source file. prompted by a mail on misc@ from marfabastewart at protonmail
This commit is contained in:
sthen 2022-04-02 15:24:44 +00:00
parent 8048276166
commit 2efc7774d3
4 changed files with 35 additions and 8 deletions

View File

@ -4,7 +4,8 @@ GH_ACCOUNT= scumjr
GH_PROJECT= yubikeyedup
GH_COMMIT= d5044d3fdc10cc59a5213efd53e0f80b2a1096f9
DISTNAME= yubikeyedup-0.20201226
REVISION= 0
MODPY_EGG_VERSION=0.1
REVISION= 1
CATEGORIES= security www

View File

@ -3,7 +3,7 @@ https://github.com/scumjr/yubikeyedup/pull/5
Index: setup.py
--- setup.py.orig
+++ setup.py
@@ -0,0 +1,26 @@
@@ -0,0 +1,27 @@
+#!/usr/bin/env python3
+
+from setuptools import setup, find_packages
@ -27,6 +27,7 @@ Index: setup.py
+ 'yubikeyedup=yubikeyedup.yubiserve:main',
+ 'yubikeyedup-dbcreate=yubikeyedup.tools.dbcreate:main',
+ 'yubikeyedup-dbconf=yubikeyedup.tools.dbconf:main',
+ 'yubikeyedup-flash=yubikeyedup.tools.flash:main',
+ ],
+ },
+)

View File

@ -0,0 +1,24 @@
Index: yubikeyedup/tools/flash.py
--- yubikeyedup/tools/flash.py.orig
+++ yubikeyedup/tools/flash.py
@@ -23,7 +23,7 @@ def gen_random(size):
def get_public(name):
return name.rjust(8, 'q')[:8]
-if __name__ == '__main__':
+def main():
if len(sys.argv) != 3:
print('Usage: %s <name> <db.sqlite3>' % sys.argv[0])
print('eg: %s bobama db/yubikeys.sqlite3' % sys.argv[0])
@@ -65,7 +65,10 @@ if __name__ == '__main__':
# sys.exit(ret)
cwd = os.path.dirname(os.path.realpath(__file__))
- dbconf = os.path.join(cwd, 'dbconf.py')
+ dbconf = 'yubikeyedup-dbconf'
subprocess.call([ dbconf, '-yk', name, db ])
subprocess.call([ dbconf, '-ya', name, public_m, uid, aeskey, db ])
subprocess.call([ dbconf, '-yl', db])
+
+if __name__ == '__main__':
+ main()

View File

@ -4,13 +4,14 @@
bin/yubikeyedup
bin/yubikeyedup-dbconf
bin/yubikeyedup-dbcreate
bin/yubikeyedup-flash
lib/python${MODPY_VERSION}/site-packages/yubikeyedup/
lib/python${MODPY_VERSION}/site-packages/yubikeyedup-0.1-py${MODPY_VERSION}.egg-info/
lib/python${MODPY_VERSION}/site-packages/yubikeyedup-0.1-py${MODPY_VERSION}.egg-info/PKG-INFO
lib/python${MODPY_VERSION}/site-packages/yubikeyedup-0.1-py${MODPY_VERSION}.egg-info/SOURCES.txt
lib/python${MODPY_VERSION}/site-packages/yubikeyedup-0.1-py${MODPY_VERSION}.egg-info/dependency_links.txt
lib/python${MODPY_VERSION}/site-packages/yubikeyedup-0.1-py${MODPY_VERSION}.egg-info/entry_points.txt
lib/python${MODPY_VERSION}/site-packages/yubikeyedup-0.1-py${MODPY_VERSION}.egg-info/top_level.txt
lib/python${MODPY_VERSION}/site-packages/yubikeyedup-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/
lib/python${MODPY_VERSION}/site-packages/yubikeyedup-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/PKG-INFO
lib/python${MODPY_VERSION}/site-packages/yubikeyedup-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/SOURCES.txt
lib/python${MODPY_VERSION}/site-packages/yubikeyedup-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/dependency_links.txt
lib/python${MODPY_VERSION}/site-packages/yubikeyedup-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/entry_points.txt
lib/python${MODPY_VERSION}/site-packages/yubikeyedup-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/top_level.txt
lib/python${MODPY_VERSION}/site-packages/yubikeyedup/__init__.py
${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packages/yubikeyedup/${MODPY_PYCACHE}/
lib/python${MODPY_VERSION}/site-packages/yubikeyedup/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc