GithubHelp home page GithubHelp logo

gen-oath-safe's People

Contributors

72zn avatar damib avatar mcepl avatar rmonk-redhat avatar tobwen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gen-oath-safe's Issues

Missing manpage

Each executable in standard binary directories should have a man page.

File "<string>", line 1, RHEL7

Red Hat Enterprise Linux Server release 7.3 (Maipo)
gen-oath-safe-0.10.0-1.el7
generating a key gives a warning
File "", line 1
import sys; import base64; import binascii; print base64.b32encode(binascii.unhexlify(sys.stdin.read()))
the created key appears valid but causes force closes in freeotp.

surrounding the statement
import sys; import base64; import binascii; print (base64.b32encode(binascii.unhexlify(sys.stdin.read())))
allows the token to be created without errors but the created token is invalid.

Fails to work with python3

gen-oath-safe uses python2 , which is obsolete (see https://www.python.org/doc/sunset-python-2/).
To work with python3 line 107 should to be replaced with

b32key="$(echo -n "$hexkey" | python3 -c "import sys; import base64; import binascii; print(base64.b32encode(binascii.unhexlify(sys.stdin.read())).decode(\"utf8\"))")"

Why img2txt?

Thanks for this nice snippet, but why do you have caca as a dependency? qrencode should be enough?

Try this:

for t in ANSI ANSI256 ASCII ASCIIi UTF8 ANSIUTF8;
do
    qrencode --type $t "gen-oath-safe"; 
    sleep 2; 
done;

PR #10 broke key lengths

PR #10 broke key lengths. Culprit is line 117:

hexkey="$(printf '%s' $hexkey | base32 | tr -dc '[:alpha:][digit]' | od -tx1 -An | tr -d '[:space:]' | head -c 30 | tr -d '\n')"

It generates a 30 char hex value which results in a 24 char base32 value. However, the hex key should have 40 chars, the resulting base32 key should have 32 chars. This also breaks provisioning of yubikeys, which require a 40 char hex value, resulting in error Invalid key string.

To correct the issue the line should be:

hexkey="$(printf '%s' "${hexkey}" | base32 | tr -dc '[:alpha:][digit]' | od -tx1 -An | tr -d '[:space:]' | head -c 40 | tr -d '\n')"

I'll prepare a pr that fixes this issue.

Offer to run the command to reset the yubikey to the history issue

Since the user has to copy the command line to execute it on a yubikey, what about detecting if a yubikey is plugged currently ( one and only one ) and run the command instead of of asking to the user to do it ? This way, this prevent the issue of having the command with the seed in history, since the recommendation of using history -c can be a bit annoying.

( of course, we would need to ask the slot, and this could maybe also serve for #2 to detect if we can set the numeric-keypad option )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.