Error while building host software for the A71CH

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error while building host software for the A71CH

1,501 Views
jose_au_zone
Contributor II

Hello! I'm trying to compile the software on WSL2 Linux on Windows 10 following the instructions on  the AN12133 document. I'm running ./buildA71CH.sh all (inside the Linux folder), but getting the following errors, which leads me to believe there's a missing library:

Script to automatically build/evaluate build success of specific A71CH solution binaries
Compiling all binaries
GNU/Linux
** Running and compiling for PC linux **
>> make -f Makefile_A71CH default app=A71CH conn=socket platf=native
echo Building A71CH for socket on native
Building A71CH for socket on native
gcc -fstack-protector-all -g -ggdb -I../hostLib/libCommon/scp -I../hostLib/libCommon/infra -I../hostLib/libCommon/hostCrypto -I../hostLib/libCommon/smCom -I../hostLib/a71ch/inc -I../hostLib/a71ch/ex -I../hostLib/tstUtil -I../hostLib/api/inc -I../hostLib/platform/inc -I/usr/local/ssl/include -DLINUX -DFTR_FILE_SYSTEM -DSCP_MODE=C_MAC_C_ENC_R_MAC_R_ENC -Wall -Wno-format -Wno-missing-braces -DTGT_A71CH -DHOST_CRYPTO -DOPENSSL -DRJCT_SOCKET -DDEBUG -L/usr/local/ssl/lib -o A71CH_socket_native ../hostLib/libCommon/scp/scp.c ../hostLib/libCommon/infra/sm_apdu.c ../hostLib/libCommon/infra/sm_errors.c ../hostLib/libCommon/infra/global_platf.c ../hostLib/libCommon/hostCrypto/hcAsn.c ../hostLib/api/src/ax_crypto_rng.c ../hostLib/api/src/ax_util.c ../hostLib/a71ch/src/a71ch_com.c ../hostLib/a71ch/src/a71ch_crypto_derive.c ../hostLib/a71ch/src/a71ch_crypto_ecc.c ../hostLib/a71ch/src/a71ch_module.c ../hostLib/a71ch/src/a71ch_sst.c ../hostLib/libCommon/infra/a71_debug.c ../hostLib/api/src/ax_scp.c ../hostLib/libCommon/hostCrypto/axHostCryptoOpenSSL.c ../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c ../hostLib/a71ch/ex/mainA71CH.c ../hostLib/a71ch/ex/ex_aes.c ../hostLib/a71ch/ex/ex_boot.c ../hostLib/a71ch/ex/ex_config.c ../hostLib/a71ch/ex/ex_debug.c ../hostLib/a71ch/ex/ex_ecc_nohc.c ../hostLib/a71ch/ex/ex_gpstorage.c ../hostLib/a71ch/ex/ex_misc.c ../hostLib/a71ch/ex/ex_psk.c ../hostLib/a71ch/ex/ex_scp.c ../hostLib/a71ch/ex/ex_sst.c ../hostLib/a71ch/ex/ex_sst_kp.c ../hostLib/a71ch/ex/ex_walkthrough.c ../hostLib/tstUtil/tst_sm_util.c ../hostLib/tstUtil/tst_a71ch_util.c ../hostLib/tstUtil/tst_sm_time.c ../hostLib/tstUtil/tstHostCrypto.c ../hostLib/tstUtil/hkdf.c ../hostLib/tstUtil/app_boot.c ../hostLib/libCommon/smCom/smComSocket_linux.c ../hostLib/libCommon/smCom/smCom.c ../hostLib/platform/generic/sm_printf.c ../hostLib/platform/generic/sm_timer.c -lcrypto -lssl -ldl
../hostLib/libCommon/hostCrypto/axHostCryptoOpenSSL.c: In function ‘HOST_AES_CBC_Process’:
../hostLib/libCommon/hostCrypto/axHostCryptoOpenSSL.c:225:20: error: storage size of ‘aesCtx’ isn’t known
  225 |     EVP_CIPHER_CTX aesCtx;
      |                    ^~~~~~
../hostLib/libCommon/hostCrypto/axHostCryptoOpenSSL.c:225:20: warning: unused variable ‘aesCtx’ [-Wunused-variable]
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c: In function ‘HLCRYPT_Encrypt’:
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:124:24: error: storage size of ‘aesCtx’ isn’t known
  124 |         EVP_CIPHER_CTX aesCtx;
      |                        ^~~~~~
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:124:24: warning: unused variable ‘aesCtx’ [-Wunused-variable]
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:165:33: error: ‘C_Block’ undeclared (first use in this function); did you mean ‘clock’?
  165 |             nRet = DES_set_key((C_Block *)inKey, &ks1);
      |                                 ^~~~~~~
      |                                 clock
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:165:33: note: each undeclared identifier is reported only once for each function it appears in
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:165:42: error: expected expression before ‘)’ token
  165 |             nRet = DES_set_key((C_Block *)inKey, &ks1);
      |                                          ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:165:20: error: too few arguments to function ‘DES_set_key’
  165 |             nRet = DES_set_key((C_Block *)inKey, &ks1);
      |                    ^~~~~~~~~~~
In file included from ../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:36:
/usr/include/openssl/des.h:154:5: note: declared here
  154 | int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);
      |     ^~~~~~~~~~~
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:171:42: error: expected expression before ‘)’ token
  171 |             nRet = DES_set_key((C_Block *)(&inKey[8]), &ks2);
      |                                          ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:177:42: error: expected expression before ‘)’ token
  177 |             nRet = DES_set_key((C_Block *)(&inKey[16]), &ks3);
      |                                          ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:185:44: error: expected expression before ‘)’ token
  185 |                 DES_ecb3_encrypt((C_Block *)(inData + i), (C_Block *)(outEncryptedData + i), &ks1, &ks2, &ks3, DES_ENCRYPT);
      |                                            ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:185:69: error: expected expression before ‘)’ token
  185 |                 DES_ecb3_encrypt((C_Block *)(inData + i), (C_Block *)(outEncryptedData + i), &ks1, &ks2, &ks3, DES_ENCRYPT);
      |                                                                     ^
In file included from ../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:36:
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:188:44: error: expected expression before ‘)’ token
  188 |                 DES_ecb2_encrypt((C_Block *)(inData + i), (C_Block *)(outEncryptedData + i), &ks1, &ks2, DES_ENCRYPT);
      |                                            ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:188:69: error: expected expression before ‘)’ token
  188 |                 DES_ecb2_encrypt((C_Block *)(inData + i), (C_Block *)(outEncryptedData + i), &ks1, &ks2, DES_ENCRYPT);
      |                                                                     ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:191:43: error: expected expression before ‘)’ token
  191 |                 DES_ecb_encrypt((C_Block *)(inData + i), (C_Block *)(outEncryptedData + i), &ks1, DES_ENCRYPT);
      |                                           ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:191:68: error: expected expression before ‘)’ token
  191 |                 DES_ecb_encrypt((C_Block *)(inData + i), (C_Block *)(outEncryptedData + i), &ks1, DES_ENCRYPT);
      |                                                                    ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:208:42: error: expected expression before ‘)’ token
  208 |             nRet = DES_set_key((C_Block *)inKey, &ks1);
      |                                          ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:208:20: error: too few arguments to function ‘DES_set_key’
  208 |             nRet = DES_set_key((C_Block *)inKey, &ks1);
      |                    ^~~~~~~~~~~
In file included from ../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:36:
/usr/include/openssl/des.h:154:5: note: declared here
  154 | int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);
      |     ^~~~~~~~~~~
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:214:42: error: expected expression before ‘)’ token
  214 |             nRet = DES_set_key((C_Block *)(&inKey[8]), &ks2);
      |                                          ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:220:42: error: expected expression before ‘)’ token
  220 |             nRet = DES_set_key((C_Block *)(&inKey[16]), &ks3);
      |                                          ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c: In function ‘HLCRYPT_Decrypt’:
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:293:24: error: storage size of ‘aesCtx’ isn’t known
  293 |         EVP_CIPHER_CTX aesCtx;
      |                        ^~~~~~
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:293:24: warning: unused variable ‘aesCtx’ [-Wunused-variable]
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:333:33: error: ‘C_Block’ undeclared (first use in this function); did you mean ‘clock’?
  333 |             nRet = DES_set_key((C_Block *)inKey, &ks1);
      |                                 ^~~~~~~
      |                                 clock
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:333:42: error: expected expression before ‘)’ token
  333 |             nRet = DES_set_key((C_Block *)inKey, &ks1);
      |                                          ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:333:20: error: too few arguments to function ‘DES_set_key’
  333 |             nRet = DES_set_key((C_Block *)inKey, &ks1);
      |                    ^~~~~~~~~~~
In file included from ../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:36:
/usr/include/openssl/des.h:154:5: note: declared here
  154 | int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);
      |     ^~~~~~~~~~~
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:339:42: error: expected expression before ‘)’ token
  339 |             nRet = DES_set_key((C_Block *)(&inKey[8]), &ks2);
      |                                          ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:345:42: error: expected expression before ‘)’ token
  345 |             nRet = DES_set_key((C_Block *)(&inKey[16]), &ks3);
      |                                          ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:353:44: error: expected expression before ‘)’ token
  353 |                 DES_ecb3_encrypt((C_Block *)(inData + i), (C_Block *)(outDecryptedData + i), &ks1, &ks2, &ks3, DES_DECRYPT);
      |                                            ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:353:69: error: expected expression before ‘)’ token
  353 |                 DES_ecb3_encrypt((C_Block *)(inData + i), (C_Block *)(outDecryptedData + i), &ks1, &ks2, &ks3, DES_DECRYPT);
      |                                                                     ^
In file included from ../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:36:
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:356:44: error: expected expression before ‘)’ token
  356 |                 DES_ecb2_encrypt((C_Block *)(inData + i), (C_Block *)(outDecryptedData + i), &ks1, &ks2, DES_DECRYPT);
      |                                            ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:356:69: error: expected expression before ‘)’ token
  356 |                 DES_ecb2_encrypt((C_Block *)(inData + i), (C_Block *)(outDecryptedData + i), &ks1, &ks2, DES_DECRYPT);
      |                                                                     ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:359:43: error: expected expression before ‘)’ token
  359 |                 DES_ecb_encrypt((C_Block *)(inData + i), (C_Block *)(outDecryptedData + i), &ks1, DES_DECRYPT);
      |                                           ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:359:68: error: expected expression before ‘)’ token
  359 |                 DES_ecb_encrypt((C_Block *)(inData + i), (C_Block *)(outDecryptedData + i), &ks1, DES_DECRYPT);
      |                                                                    ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:376:42: error: expected expression before ‘)’ token
  376 |             nRet = DES_set_key((C_Block *)inKey, &ks1);
      |                                          ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:376:20: error: too few arguments to function ‘DES_set_key’
  376 |             nRet = DES_set_key((C_Block *)inKey, &ks1);
      |                    ^~~~~~~~~~~
In file included from ../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:36:
/usr/include/openssl/des.h:154:5: note: declared here
  154 | int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);
      |     ^~~~~~~~~~~
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:382:42: error: expected expression before ‘)’ token
  382 |             nRet = DES_set_key((C_Block *)(&inKey[8]), &ks2);
      |                                          ^
../hostLib/libCommon/hostCrypto/HostCryptoAPIOpenSSL.c:388:42: error: expected expression before ‘)’ token
  388 |             nRet = DES_set_key((C_Block *)(&inKey[16]), &ks3);
      |                                          ^
../hostLib/a71ch/ex/ex_boot.c:447:11: warning: ‘readStateFromFile’ defined but not used [-Wunused-function]
  447 | static U8 readStateFromFile(char *szFilename, SmCommState_t *commState, Scp03SessionState_t *scp03State)
      |           ^~~~~~~~~~~~~~~~~
../hostLib/a71ch/ex/ex_boot.c:425:11: warning: ‘writeStateToFile’ defined but not used [-Wunused-function]
  425 | static U8 writeStateToFile(char *szFilename, SmCommState_t *commState, Scp03SessionState_t *scp03State)
      |           ^~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/asn1.h:23,
                 from /usr/include/openssl/objects.h:15,
                 from /usr/include/openssl/evp.h:28,
                 from /usr/include/openssl/cmac.h:19,
                 from ../hostLib/libCommon/hostCrypto/axHostCrypto.h:28,
                 from ../hostLib/tstUtil/tstHostCrypto.c:37:
../hostLib/tstUtil/tstHostCrypto.c: In function ‘HOSTCRYPTO_Sign’:
../hostLib/tstUtil/tstHostCrypto.c:167:31: error: dereferencing pointer to incomplete type ‘ECDSA_SIG’ {aka ‘struct ECDSA_SIG_st’}
  167 |         if ((BN_num_bytes(pSig->r) + BN_num_bytes(pSig->s)) > (*pSignatureLength))
      |                               ^~
../hostLib/tstUtil/tstHostCrypto.c: In function ‘HOSTCRYPTO_EccCreateOpenSslEccFromComponents’:
../hostLib/tstUtil/tstHostCrypto.c:427:36: warning: implicit declaration of function ‘BN_init’ [-Wimplicit-function-declaration]
  427 |         if (bn_ecc_priv != NULL) { BN_init(bn_ecc_priv); } else { sw = ERR_MEMORY; goto err; }
      |                                    ^~~~~~~
../hostLib/tstUtil/tstHostCrypto.c: In function ‘HOSTCRYPTO_Tls1_2_P_Sha256’:
../hostLib/tstUtil/tstHostCrypto.c:713:14: error: storage size of ‘hmacCtx’ isn’t known
  713 |     HMAC_CTX hmacCtx;
      |              ^~~~~~~
../hostLib/tstUtil/tstHostCrypto.c:724:5: warning: implicit declaration of function ‘HMAC_CTX_init’; did you mean ‘HMAC_CTX_new’? [-Wimplicit-function-declaration]
  724 |     HMAC_CTX_init(&hmacCtx);
      |     ^~~~~~~~~~~~~
      |     HMAC_CTX_new
../hostLib/tstUtil/tstHostCrypto.c:761:5: warning: implicit declaration of function ‘HMAC_CTX_cleanup’; did you mean ‘CMAC_CTX_cleanup’? [-Wimplicit-function-declaration]
  761 |     HMAC_CTX_cleanup(&hmacCtx);
      |     ^~~~~~~~~~~~~~~~
      |     CMAC_CTX_cleanup
../hostLib/tstUtil/tstHostCrypto.c:713:14: warning: unused variable ‘hmacCtx’ [-Wunused-variable]
  713 |     HMAC_CTX hmacCtx;
      |              ^~~~~~~
../hostLib/tstUtil/hkdf.c: In function ‘HKDF_Expand’:
../hostLib/tstUtil/hkdf.c:71:14: error: storage size of ‘hmacCtx’ isn’t known
   71 |     HMAC_CTX hmacCtx;
      |              ^~~~~~~
../hostLib/tstUtil/hkdf.c:86:5: warning: implicit declaration of function ‘HMAC_CTX_init’; did you mean ‘HMAC_CTX_new’? [-Wimplicit-function-declaration]
   86 |     HMAC_CTX_init(&hmacCtx);
      |     ^~~~~~~~~~~~~
      |     HMAC_CTX_new
../hostLib/tstUtil/hkdf.c:126:5: warning: implicit declaration of function ‘HMAC_CTX_cleanup’ [-Wimplicit-function-declaration]
  126 |     HMAC_CTX_cleanup(&hmacCtx);
      |     ^~~~~~~~~~~~~~~~
../hostLib/tstUtil/hkdf.c:71:14: warning: unused variable ‘hmacCtx’ [-Wunused-variable]
   71 |     HMAC_CTX hmacCtx;
      |              ^~~~~~~
^Cmake: *** [Makefile_A71CH:470: default] Interrupt

 

Any help will be greatly appreciated, thanks!

Labels (1)
0 Kudos
1 Reply

1,371 Views
leonheld
Contributor I
0 Kudos