Skip to content

Instantly share code, notes, and snippets.

@linuxkidd
Created August 3, 2016 20:41
Show Gist options
  • Save linuxkidd/27e40aca598d7234d3c23e97ac4ae8c5 to your computer and use it in GitHub Desktop.
Save linuxkidd/27e40aca598d7234d3c23e97ac4ae8c5 to your computer and use it in GitHub Desktop.
Patch to the wari hotp.py file to output PIN or Secret+PIN to stdout -- useful for piping into programs
--- /usr/lib/python2.7/site-packages/wari-0.0.1-py2.7.egg/wari/hotp.py.orig 2016-08-03 13:38:00.601784735 -0700
+++ /usr/lib/python2.7/site-packages/wari-0.0.1-py2.7.egg/wari/hotp.py 2016-08-03 13:38:30.758031752 -0700
@@ -105,11 +105,13 @@
pin = otp.get_hotp(b32, intervals_no=step)
password = "%s%s" % (document['secret'], pin)
if 'pin' in items:
- pyperclip.copy(pin)
- logger.info('pin copied to the clipboard')
+ print str(pin)
+ pyperclip.copy(str(pin))
+ #logger.info('pin copied to the clipboard')
else:
+ print password
pyperclip.copy(password)
- logger.info('secret with generated pin has been copied to the clipboard')
+ #logger.info('secret with generated pin has been copied to the clipboard')
document['step'] = step + 1
db.collection.update(document)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment