Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

malformed QR code crashes the app / QR code text trimming #51

Open
leonyu opened this issue Sep 4, 2017 · 1 comment
Open

malformed QR code crashes the app / QR code text trimming #51

leonyu opened this issue Sep 4, 2017 · 1 comment

Comments

@leonyu
Copy link

leonyu commented Sep 4, 2017

Two problems discovered:

  • Certain QR code would crash the app
  • QR code text is imported as is, no trimming/verification is done until user hits save

In attempt to generate my own QR code, I ran the following command.

 fwknop --key-gen | qrencode -t UTF8

The above generated QR code would crash the app.

Afterwards, I tried edit the ouptut of fwknop --key-gen to conform to that of OpenWrt package (KEY_BASE64:{CODE} HMAC_KEY_BASE64:{CODE}). In the process also learned that the app doesn't attempt to trim the text from QR code.

This resulted in the save operation telling me the Base64 is invalid. It took me awhile to figure out that it was merely due to the fact that there is a space at the end of the Base64 code.

@jp-bennett
Copy link
Owner

The qr code processing does not have much error checking built in atm. I'll take a look at this, and at least fix the crash. One more trick you might find interesting is this script: https://github.com/mrash/fwknop/blob/master/extras/console-qr/console-qr.sh

You pipe a fwknop access.conf file into it, and it generates qr codes from each stanza.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants