avivgr / stm32-u2f Goto Github PK
View Code? Open in Web Editor NEWA Universal 2nd Factor (U2F) USB token using STM32 MCUs
License: Apache License 2.0
A Universal 2nd Factor (U2F) USB token using STM32 MCUs
License: Apache License 2.0
store keys in flash
Need to implement button press
Right now the channels do not expire - and will exhaust the available RAM.
Need to add ->expire field to cid structure and from main loop, free unused cids.
to set attestation key and private keys (EC private key and AES)
The counter is init to 1 and gets reset each time the device is powered.
Need to store counter in NVRAM.
Since STM32 has no eeprom - consider eeprom emulation on top of STM32 flash.
The only thing that makes it variable size is that the DER-encoded signature can be variable size, but adding padding to a DER-encoded blob should not break things.
The issue is found in this line:
uint16_t status, len = sizeof(U2F_AUTHENTICATE_RESP);
I'm trying to compile under OSX. After modifying stm32.mak
(update TOOLCHAIN_ROOT
, remove .exe
from tools, change tool names to arm-none-eabi-*
... I'll submit a PR once I get something working), the compile runs all the way to linking.
Then I get this error:
/Users/apowers/Projects/ctap-stm32/gcc-arm-none-eabi-5_4-2016q3//bin/arm-none-eabi-g++ -o Debug/stm32-u2f.elf -Wl,-gc-sections -TBSP/STM32F407VG_flash.lds -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -Wl,--start-group Debug/startup_stm32f407xx.o Debug/stm32f4xx_hal.o Debug/stm32f4xx_hal_adc.o Debug/stm32f4xx_hal_adc_ex.o Debug/stm32f4xx_hal_can.o Debug/stm32f4xx_hal_cec.o Debug/stm32f4xx_hal_cortex.o Debug/stm32f4xx_hal_crc.o Debug/stm32f4xx_hal_cryp.o Debug/stm32f4xx_hal_cryp_ex.o Debug/stm32f4xx_hal_dac.o Debug/stm32f4xx_hal_dac_ex.o Debug/stm32f4xx_hal_dcmi.o Debug/stm32f4xx_hal_dcmi_ex.o Debug/stm32f4xx_hal_dma.o Debug/stm32f4xx_hal_dma2d.o Debug/stm32f4xx_hal_dma_ex.o Debug/stm32f4xx_hal_dsi.o Debug/stm32f4xx_hal_eth.o Debug/stm32f4xx_hal_flash.o Debug/stm32f4xx_hal_flash_ex.o Debug/stm32f4xx_hal_flash_ramfunc.o Debug/stm32f4xx_hal_fmpi2c.o Debug/stm32f4xx_hal_fmpi2c_ex.o Debug/stm32f4xx_hal_gpio.o Debug/stm32f4xx_hal_hash.o Debug/stm32f4xx_hal_hash_ex.o Debug/stm32f4xx_hal_hcd.o Debug/stm32f4xx_hal_i2c.o Debug/stm32f4xx_hal_i2c_ex.o Debug/stm32f4xx_hal_i2s.o Debug/stm32f4xx_hal_i2s_ex.o Debug/stm32f4xx_hal_irda.o Debug/stm32f4xx_hal_iwdg.o Debug/stm32f4xx_hal_lptim.o Debug/stm32f4xx_hal_ltdc.o Debug/stm32f4xx_hal_ltdc_ex.o Debug/stm32f4xx_hal_nand.o Debug/stm32f4xx_hal_nor.o Debug/stm32f4xx_hal_pccard.o Debug/stm32f4xx_hal_pcd.o Debug/stm32f4xx_hal_pcd_ex.o Debug/stm32f4xx_hal_pwr.o Debug/stm32f4xx_hal_pwr_ex.o Debug/stm32f4xx_hal_qspi.o Debug/stm32f4xx_hal_rcc.o Debug/stm32f4xx_hal_rcc_ex.o Debug/stm32f4xx_hal_rng.o Debug/stm32f4xx_hal_rtc.o Debug/stm32f4xx_hal_rtc_ex.o Debug/stm32f4xx_hal_sai.o Debug/stm32f4xx_hal_sai_ex.o Debug/stm32f4xx_hal_sd.o Debug/stm32f4xx_hal_sdram.o Debug/stm32f4xx_hal_smartcard.o Debug/stm32f4xx_hal_spdifrx.o Debug/stm32f4xx_hal_spi.o Debug/stm32f4xx_hal_sram.o Debug/stm32f4xx_hal_tim.o Debug/stm32f4xx_hal_tim_ex.o Debug/stm32f4xx_hal_uart.o Debug/stm32f4xx_hal_usart.o Debug/stm32f4xx_hal_wwdg.o Debug/stm32f4xx_ll_fmc.o Debug/stm32f4xx_ll_fsmc.o Debug/stm32f4xx_ll_sdmmc.o Debug/stm32f4xx_ll_usb.o Debug/usbd_hid.o Debug/usbd_core.o Debug/usbd_ctlreq.o Debug/usbd_ioreq.o Debug/main.o Debug/aes.o Debug/aesni.o Debug/arc4.o Debug/asn1parse.o Debug/asn1write.o Debug/base64.o Debug/bignum.o Debug/blowfish.o Debug/camellia.o Debug/ccm.o Debug/certs.o Debug/cipher.o Debug/cipher_wrap.o Debug/ctr_drbg.o Debug/debug.o Debug/des.o Debug/dhm.o Debug/ecdh.o Debug/ecdsa.o Debug/ecjpake.o Debug/ecp.o Debug/ecp_curves.o Debug/entropy.o Debug/entropy_poll.o Debug/error.o Debug/gcm.o Debug/havege.o Debug/hmac_drbg.o Debug/md.o Debug/md2.o Debug/md4.o Debug/md5.o Debug/md_wrap.o Debug/memory_buffer_alloc.o Debug/oid.o Debug/padlock.o Debug/pem.o Debug/pk.o Debug/pkcs11.o Debug/pkcs12.o Debug/pkcs5.o Debug/pkparse.o Debug/pkwrite.o Debug/pk_wrap.o Debug/platform.o Debug/ripemd160.o Debug/rsa.o Debug/sha1.o Debug/sha256.o Debug/sha512.o Debug/ssl_cache.o Debug/ssl_ciphersuites.o Debug/ssl_cli.o Debug/ssl_cookie.o Debug/ssl_srv.o Debug/ssl_ticket.o Debug/ssl_tls.o Debug/threading.o Debug/timing.o Debug/version.o Debug/version_features.o Debug/x509.o Debug/x509write_crt.o Debug/x509write_csr.o Debug/x509_create.o Debug/x509_crl.o Debug/x509_crt.o Debug/x509_csr.o Debug/xtea.o Debug/stm32f4xx_hal_msp.o Debug/stm32f4xx_it.o Debug/stm32_entropy.o Debug/system_stm32f4xx.o Debug/u2f_messages.o Debug/uart_printf.o Debug/usbd_conf.o Debug/usbd_desc.o Debug/usbd_u2fhid.o Debug/usbd_u2f_hid_if.o Debug/usb_device.o -lcompactcpp -Wl,--end-group
/Users/apowers/Projects/ctap-stm32/gcc-arm-none-eabi-5_4-2016q3/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: cannot find -lcompactcpp
collect2: error: ld returned 1 exit status
All I see is that stm32.mak
adds compactcpp
to LIBRARY_NAMES
... I'm not quite sure where to pick up this library so that I can link it in.
Any hints would be appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.