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

can't build on debian host #20

Open
craigcomstock opened this issue Jan 8, 2021 · 10 comments
Open

can't build on debian host #20

craigcomstock opened this issue Jan 8, 2021 · 10 comments

Comments

@craigcomstock
Copy link
Contributor

After I fixed the bearssl include problem with

I get

craig@other:~/src/solokeys-openpgp$ make
g++ -std=c++17 -Os -Wall -g3 -I. -Ipc/ -Isrc/ -Ilibs/mbedtls/ -Ilibs/mbedtls/mbedtls/crypto/include/ -Ilibs/stm32fs/ -Ilibs/bearssl/ -c -o obj/opgpdevice.o ./pc/opgpdevice.cpp
./pc/opgpdevice.cpp:31:10: fatal error: spiffs.h: No such file or directory
 #include <spiffs.h>
          ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:28: obj/opgpdevice.o] Error 1

workaround is to remove the 'pc' directory so I just build for the solokeys hacker device

craig@other:~/src/solokeys-openpgp$ git diff
diff --git a/Makefile b/Makefile
index a37b4ea..0a8c2af 100644
--- a/Makefile
+++ b/Makefile
@@ -5,8 +5,7 @@ RM = rm -rf
 rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
 
 OBJ_DIR := ./obj
-SRC_DIRS := ./pc \
-            ./src \
+SRC_DIRS := ./src \
             ./src/applications \
             ./src/applications/openpgp \
             ./libs/stm32fs

but that leaves me with the next error:

c/cryptolib.cpp
./src/cryptolib.cpp:15:10: fatal error: device.h: No such file or directory
 #include "device.h"
          ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:27: obj/cryptolib.o] Error 1

I will continue working through these errors and see if I can fix things up and submit a PR.

@craigcomstock craigcomstock changed the title can't compile can't compile on debian host for solokeys hacker device Jan 8, 2021
@craigcomstock craigcomstock changed the title can't compile on debian host for solokeys hacker device can't build on debian host Jan 8, 2021
@craigcomstock
Copy link
Contributor Author

craigcomstock commented Jan 8, 2021

I copied a few header files from https://github.com/solokeys/solo/tree/master/fido2 but can't find cbor.h

Something like this?

https://github.com/ssilverman/libCBOR

p.s. I tried making sure submodules were present and didn't see any mention of any.

Am I not doing something right? The README just says git clone --recurse and then make

Oh! I see that -Ilibs/mbedtls/ -Ilibs/mbedtls/mbedtls/crypto/include/ are not present in my checked out tree. So maybe that is what is missing.

@craigcomstock
Copy link
Contributor Author

I tried git submodule add https://github.com/ARMmbed/mbedtls but still cbor.h is not found. Will check back again later for any feedback and try some more. Thanks.

@craigcomstock
Copy link
Contributor Author

Maybe this? https://github.com/PJK/libcbor looks like the right sort of thing.

@craigcomstock
Copy link
Contributor Author

Rather, sudo apt install libcbor-dev fixed cbor.

I see in this commit that libsalty was added

8756f46

But I can't figure out where that library comes from.

@merlokk
Copy link
Collaborator

merlokk commented Jan 8, 2021

https://github.com/intel/tinycbor
it includes from the main solo repository

@craigcomstock
Copy link
Contributor Author

@merlokk ack. Thanks for merging my PR. I see this now in the main solo repo:

craig@other:~/src/solokeys-solo$ git submodule 
-d04dd318609733d809904d4f2973597240655cde crypto/cifra
-601bd11062c551b108adbb43ba99f199b840777c crypto/micro-ecc
-4b97e75fb96c08f026d545f7f8905b5daa14e9e8 crypto/tiny-AES-c
-878eb01b96c573e353b217439c0f418f69c2ca04 tinycbor

So any thoughts on where to find libsalty?

I'll post another PR with my other changes.

@craigcomstock
Copy link
Contributor Author

@merlokk thanks for the help! Here's where I'm at right now:

#21

@merlokk
Copy link
Collaborator

merlokk commented Jan 8, 2021

https://github.com/solokeys/solo/pull/447/files

@merlokk
Copy link
Collaborator

merlokk commented Jan 8, 2021

#21 too much( needs to rewrite /pc directory sources to use bearssl and stm32fs

@nickray
Copy link
Member

nickray commented Jan 8, 2021

So any thoughts on where to find libsalty?

https://github.com/ycrypto/salty, in particular https://github.com/ycrypto/salty/blob/main/c-api/Makefile#L2

This is a Rust/assembly implementation (with C API wrapper) of ed255 signatures we will be using with SoloKeys for our v2 key.

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

3 participants