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

u2f fails to build on macos #9

Open
Firstyear opened this issue Aug 5, 2019 · 1 comment
Open

u2f fails to build on macos #9

Firstyear opened this issue Aug 5, 2019 · 1 comment

Comments

@Firstyear
Copy link

commit 449b9e5 fails to build on macos with:

[william@amethyst 16:16] ~/development/tomu-chopstx-u2f/u2f I0> make

arm-none-eabi-gcc -c -mcpu=cortex-m0plus -O3 -Os -fstack-usage -ffunction-sections -fdata-sections -fno-common -Wall -Wextra -Wstrict-prototypes -Wa,-alms=build/u2f-apdu.lst -DMAKE_ENTRY_PUBLIC -DUSE_SYS3 -DFREE_STANDING -DMHZ=21 -DENFORCE_DEBUG_LOCK -mthumb -mno-thumb-interwork -DTHUMB -MD -MP -MF .dep/u2f-apdu.o.d -I. -I.. u2f-apdu.c -o build/u2f-apdu.o
u2f-apdu.c:101:21: error: 'ATTESTATION_DER_LEN' undeclared here (not in a function)
     uint8_t attCert[ATTESTATION_DER_LEN]; // Attestation certificate
                     ^~~~~~~~~~~~~~~~~~~
u2f-apdu.c: In function 'u2f_register':
u2f-apdu.c:337:26: error: 'attestation_der' undeclared (first use in this function)
   memcpy (resp->attCert, attestation_der, ATTESTATION_DER_LEN);
                          ^~~~~~~~~~~~~~~
u2f-apdu.c:337:26: note: each undeclared identifier is reported only once for each function it appears in
u2f-apdu.c:341:37: error: 'attestation_key' undeclared (first use in this function)
   if (ecdsa_sign_p256r1 (hash, sig, attestation_key))
                                     ^~~~~~~~~~~~~~~
u2f-apdu.c:352:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [build/u2f-apdu.o] Error 1

This appears to be a missing header file.

Other tomu examples and code builds (ie toboot, examples, quickstart). So I suspect there is a missing dependency for macos that provides the header, or there is an un-commited header that is required.

Thanks,

@mcassaniti
Copy link

mcassaniti commented Jan 23, 2021

This doesn't just seem to be Mac OS. I've tried on Ubuntu 16.04 and 20.04.1 using Docker containers.

[EDIT] After looking harder and following the documentation to make sure a certificate is generated, I got this working. Try running make certclean && make after you've got the Python asn1crypto package installed correctly.

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