0

trying to run the makefile in TSS.CPP directory (downloaded from https://github.com/microsoft/ms-tpm-20-ref/tree/main) gives me openssl/sm3.h error file not found

I already tried sudo apt install libssl-dev the error is still there

do i need to do something else? before running the makefile? I run this on Ubuntu

dibii
  • 7
  • 5
  • https://github.com/openssl/openssl/commits/master/include/internal/sm3.h looks like this header is not supposed to be used directly in the client code – pptaszni Aug 28 '23 at 09:09
  • @pptaszni which one is the client code? is the src files in TSS.CPP directory considered the client code? – dibii Aug 28 '23 at 09:21

1 Answers1

0

As it's written here https://github.com/microsoft/ms-tpm-20-ref/issues/50 sm3.h shouldn't be used directly. So, it's issue of code developers. Of cause you could copy the headers to /usr/include/openssl and may be your build would be succeed.

PS sm3.h places in <openssl_source>/include/internals/. You could obtain sources by the command apt source openssl

Misha T
  • 56
  • 5
  • okay it actually works, i just commented out the line that requires sm3.h. but is this safe? like it fixed my build right now but would it be okay for production? – dibii Aug 28 '23 at 10:16
  • Yes, it's safe. `sm3_` functions and types never used anywhere in the code of MsTpm. Also you could fix inequality, i.e. replace `OPENSSL_VERSION_NUMBER < 0x10101010L` to `OPENSSL_VERSION_NUMBER < 0x10200000L` – Misha T Aug 28 '23 at 11:36
  • Thank you very much. your response is a huge help~ – dibii Aug 29 '23 at 01:15