gl-sergei / u2f-token

u2f token firmware for stm32f103 and efm32hg boards
GNU General Public License v3.0
348 stars 57 forks source link

make certclean to solve ATTESTATION_DER_LEN error #8

Closed sowbug closed 6 years ago

sowbug commented 6 years ago

This is a documentation issue and can be closed immediately. I hope someone in the future is helped by this closed bug.

If you're not paying attention to the system requirements as you try to build this project, you'll generate a bogus file called src/cert/certificates.c. Then you'll get compilation errors about ATTESTATION_DER_LEN not being defined, and you'll go crazy because it really isn't defined anywhere.

Then you'll install more of the dependencies, and pip install --user --upgrade asn1crypto will enable the system to generate src/cert/certificates.c, which defines ATTESTATION_DER_LEN, but make clean doesn't remove that file, so you'll keep getting the error.

Once you make certclean you'll regenerate the file, and all will be well again.

gl-sergei commented 6 years ago

Thank you for sharing this! To make build process a bit easier, I've changed the script so that certificates.c won't be created if asn1crypto is missing and updated readme to mention cleanup commands. Commits https://github.com/gl-sergei/u2f-token/commit/9db588534f82c89f1a950a2d8b0dd8be208d8713 and https://github.com/gl-sergei/u2f-token/commit/ab0113dc54b421fb6799c844769bc8b3c81320bd

ncm commented 6 years ago

This seems like a good place to mention (because gurgling finds it) that you will also get this build failure if you have the python3 asn1crypto, but "python" runs python2 (and your branch hasn't got the patches above, yet). If so, change cert.gen to say "python3" and certclean. Maybe fix your /usr/bin/python link?