Yubico / yubihsm-shell

yubihsm-shell and libyubihsm
https://developers.yubico.com/yubihsm-shell/
Apache License 2.0
92 stars 54 forks source link

Yubihsm-shell build fails on RHEL 7.9 #237

Closed naimulhq closed 2 years ago

naimulhq commented 2 years ago

I have been trying to build yubihsm-shell on RedHat 7.9 but have been unsuccessful. When I run make, I get a bunch of errors about missing braces. I would run make -i to ignore the errors but it would end up failing afterwards when I run make install. Here are the output that I get from running the commands specified on the README.

[root@testenvironment build]# cmake ..
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_STACK_PROTECTOR_ALL
-- Performing Test HAVE_STACK_PROTECTOR_ALL - Success
-- -fstack-protector-all support detected
-- Performing Test HAVE_NO_IMPLICIT_FALLTHROUGH
-- Performing Test HAVE_NO_IMPLICIT_FALLTHROUGH - Success
-- not win32
-- Looking for memset_s
-- Looking for memset_s - not found
-- Looking for explicit_bzero
-- Looking for explicit_bzero - not found
-- Found PkgConfig: /bin/pkg-config (found version "0.27.1") 
-- Checking for one of the modules 'libcrypto'
-- Checking for one of the modules 'libedit'
-- Checking for one of the modules 'libcurl'
-- Checking for one of the modules 'libusb-1.0'
LIBCRYPTO_VERSION: 1.0.2k
CMake Warning at pkcs11/tests/CMakeLists.txt:203 (message):
  PKCS11TEST_PATH not defined, assuming that pkcs11test is in PATH

-- Using PKCS11_TESTER: /pkcs11test
-- Checking for one of the modules 'libpcsclite'
/home/lucidadmin/Downloads/yubihsm-shell-master/yubihsm-auth/cmdline.c
/home/lucidadmin/Downloads/yubihsm-shell-master/yhwrap/cmdline.c
Build summary:

        Project name:     yubihsm-shell
        Version:          2.3.0
        Host type:        Linux
        Path prefix:      
        Compiler:         /bin/cc
        Compiler ID:      GNU
        Compiler version: 4.8.5
        CMake version:    3.22.1
        CFLAGS:            -Wno-format-zero-length
        CPPFLAGS:         
        Warnings:         
        Build type:       Debug

        Install prefix:    /usr/local
        Install targets
             Libraries     /usr/local/lib
             Includes      /usr/local/include
             Binaries      /usr/local/bin
             Manuals       /usr/local/share/man
             Pkg-config    /usr/local/share/pkgconfig
-- Configuring done
-- Generating done
-- Build files have been written to: /home/lucidadmin/Downloads/yubihsm-shell-master/build
[root@testenvironment build]# make
[  0%] Building C object lib/CMakeFiles/yubihsm.dir/__/aes_cmac/aes.c.o
[  1%] Building C object lib/CMakeFiles/yubihsm.dir/__/aes_cmac/aes_cmac.c.o
[  2%] Building C object lib/CMakeFiles/yubihsm.dir/__/common/hash.c.o
[  2%] Building C object lib/CMakeFiles/yubihsm.dir/__/common/pkcs5.c.o
[  3%] Building C object lib/CMakeFiles/yubihsm.dir/__/common/rand.c.o
[  4%] Building C object lib/CMakeFiles/yubihsm.dir/__/common/ecdh.c.o
[  4%] Building C object lib/CMakeFiles/yubihsm.dir/__/common/openssl-compat.c.o
[  5%] Building C object lib/CMakeFiles/yubihsm.dir/error.c.o
[  6%] Building C object lib/CMakeFiles/yubihsm.dir/lib_util.c.o
[  6%] Building C object lib/CMakeFiles/yubihsm.dir/yubihsm.c.o
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_send_plain_msg’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:311:3: error: missing braces around initializer [-Werror=missing-braces]
   Msg msg = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:311:3: error: (near initialization for ‘msg.st’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:312:3: error: missing braces around initializer [-Werror=missing-braces]
   Msg response_msg = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:312:3: error: (near initialization for ‘response_msg.st’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘send_encrypted_msg’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:435:3: error: missing braces around initializer [-Werror=missing-braces]
   Msg msg = {0}, enc_msg = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:435:3: error: (near initialization for ‘msg.st’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:435:3: error: missing braces around initializer [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:435:3: error: (near initialization for ‘enc_msg.st’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_begin_create_session’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:868:3: error: missing braces around initializer [-Werror=missing-braces]
   Msg msg = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:868:3: error: (near initialization for ‘msg.st’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:869:3: error: missing braces around initializer [-Werror=missing-braces]
   Msg response_msg = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:869:3: error: (near initialization for ‘response_msg.st’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_finish_create_session’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1006:5: error: missing braces around initializer [-Werror=missing-braces]
     Msg msg = {0};
     ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1006:5: error: (near initialization for ‘msg.st’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1007:5: error: missing braces around initializer [-Werror=missing-braces]
     Msg response_msg = {0};
     ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1007:5: error: (near initialization for ‘response_msg.st’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_get_device_info’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1375:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1375:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_get_object_info’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1554:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1554:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1554:3: error: missing initializer for field ‘id’ of ‘struct <anonymous>’ [-Werror=missing-field-initializers]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1543:16: note: ‘id’ declared here
       uint16_t id;
                ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_sign_pkcs1v1_5’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1702:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1702:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_sign_pss’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1753:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1753:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_sign_ecdsa’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1809:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1809:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_sign_eddsa’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1850:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1850:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘import_asymmetric’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1945:3: error: missing braces around initializer [-Werror=missing-braces]
   } k = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1945:3: error: (near initialization for ‘k.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1951:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:1951:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_import_hmac_key’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2107:3: error: missing braces around initializer [-Werror=missing-braces]
   } k = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2107:3: error: (near initialization for ‘k.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2113:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2113:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘generate_key’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2179:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2179:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2186:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2186:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_generate_hmac_key’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2327:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2327:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2333:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2333:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_decrypt_pkcs1v1_5’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2385:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2385:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_decrypt_oaep’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2423:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2423:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_derive_ecdh’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2484:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2484:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_delete_object’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2518:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2518:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_export_wrapped’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2556:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2556:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_import_wrapped’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2597:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2597:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_import_wrap_key’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2648:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2648:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2655:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2655:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_generate_wrap_key’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2732:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2732:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2739:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2739:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_get_log_entries’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2790:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2790:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_import_opaque’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2923:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2923:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2930:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2930:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_sign_ssh_certificate’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2988:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:2988:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_import_template’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3067:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3067:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3074:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3074:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_import_authentication_key’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3168:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3168:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3174:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3174:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_change_authentication_key’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3266:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3266:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3272:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3272:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_create_otp_aead’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3338:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3338:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_randomize_otp_aead’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3371:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3371:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_decrypt_otp’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3403:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3403:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3412:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3412:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_rewrap_otp_aead’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3471:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3471:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_import_otp_aead_key’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3520:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3520:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3526:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3526:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_generate_otp_aead_key’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3596:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3596:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3603:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3603:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_sign_attestation_certificate’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3653:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3653:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_set_option’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3694:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3694:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_get_storage_info’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3754:3: error: missing braces around initializer [-Werror=missing-braces]
   } response = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3754:3: error: (near initialization for ‘response.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_wrap_data’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3804:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3804:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: In function ‘yh_util_unwrap_data’:
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3845:3: error: missing braces around initializer [-Werror=missing-braces]
   } data = {0};
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c:3845:3: error: (near initialization for ‘data.<anonymous>’) [-Werror=missing-braces]
/home/lucidadmin/Downloads/yubihsm-shell-master/lib/yubihsm.c: At top level:
cc1: error: unrecognized command line option "-Wno-implicit-fallthrough" [-Werror]
cc1: all warnings being treated as errors
make[2]: *** [lib/CMakeFiles/yubihsm.dir/yubihsm.c.o] Error 1
make[1]: *** [lib/CMakeFiles/yubihsm.dir/all] Error 2
make: *** [all] Error 2
qpernil commented 2 years ago

We are planning a release, if you could confirm if https://github.com/Yubico/yubihsm-shell/pull/238 fixes this it will be in that release.

naimulhq commented 2 years ago

@qpernil That did fix the issue. There was also a bunch of errors saying -Werror=missing-field-initializers so I made a PR to fix that. #239

naimulhq commented 2 years ago

When running make again, I had an error saying that it could not find #include in main.c. On RHEL, there aren't any devel packages that provides histedit.h so I had to find a version of histedit.h from online. I used the version provided here http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/lib/libedit/histedit.h. Once I moved this file to /usr/include and rerun make, I got the following:

[root@testenvironment build]# make
[  0%] Building C object lib/CMakeFiles/yubihsm.dir/__/aes_cmac/aes.c.o
[  1%] Building C object lib/CMakeFiles/yubihsm.dir/__/aes_cmac/aes_cmac.c.o
[  2%] Building C object lib/CMakeFiles/yubihsm.dir/__/common/hash.c.o
[  2%] Building C object lib/CMakeFiles/yubihsm.dir/__/common/pkcs5.c.o
[  3%] Building C object lib/CMakeFiles/yubihsm.dir/__/common/rand.c.o
[  4%] Building C object lib/CMakeFiles/yubihsm.dir/__/common/ecdh.c.o
[  4%] Building C object lib/CMakeFiles/yubihsm.dir/__/common/openssl-compat.c.o
[  5%] Building C object lib/CMakeFiles/yubihsm.dir/error.c.o
[  6%] Building C object lib/CMakeFiles/yubihsm.dir/lib_util.c.o
[  6%] Building C object lib/CMakeFiles/yubihsm.dir/yubihsm.c.o
[  7%] Linking C shared library libyubihsm.so
[  7%] Built target yubihsm
[  7%] Building C object lib/CMakeFiles/yubihsm_usb.dir/yubihsm_usb.c.o
[  8%] Building C object lib/CMakeFiles/yubihsm_usb.dir/yubihsm_libusb.c.o
[  9%] Building C object lib/CMakeFiles/yubihsm_usb.dir/lib_util.c.o
[ 10%] Linking C shared library libyubihsm_usb.so
[ 10%] Built target yubihsm_usb
[ 11%] Building C object lib/CMakeFiles/yubihsm_http.dir/yubihsm_curl.c.o
[ 12%] Building C object lib/CMakeFiles/yubihsm_http.dir/lib_util.c.o
[ 12%] Linking C shared library libyubihsm_http.so
[ 12%] Built target yubihsm_http
[ 13%] Building C object lib/tests/CMakeFiles/test_parsing.dir/test_parsing.c.o
[ 14%] Linking C executable test_parsing
[ 14%] Built target test_parsing
[ 14%] Building C object lib/tests/CMakeFiles/test_pbkdf2.dir/test_pbkdf2.c.o
[ 15%] Building C object lib/tests/CMakeFiles/test_pbkdf2.dir/__/__/common/pkcs5.c.o
[ 16%] Building C object lib/tests/CMakeFiles/test_pbkdf2.dir/__/__/common/hash.c.o
[ 17%] Linking C executable test_pbkdf2
[ 17%] Built target test_pbkdf2
[ 17%] Building C object lib/tests/CMakeFiles/test_usb_url.dir/test_usb_url.c.o
[ 18%] Building C object lib/tests/CMakeFiles/test_usb_url.dir/__/lib_util.c.o
[ 19%] Linking C executable test_usb_url
[ 19%] Built target test_usb_url
[ 19%] Building C object lib/tests/CMakeFiles/test_util.dir/test_util.c.o
[ 20%] Building C object lib/tests/CMakeFiles/test_util.dir/__/lib_util.c.o
[ 21%] Linking C executable test_util
[ 21%] Built target test_util
[ 22%] Building C object pkcs11/CMakeFiles/yubihsm_pkcs11.dir/__/common/hash.c.o
[ 22%] Building C object pkcs11/CMakeFiles/yubihsm_pkcs11.dir/__/common/util.c.o
[ 23%] Building C object pkcs11/CMakeFiles/yubihsm_pkcs11.dir/__/common/parsing.c.o
[ 24%] Building C object pkcs11/CMakeFiles/yubihsm_pkcs11.dir/__/common/openssl-compat.c.o
[ 24%] Building C object pkcs11/CMakeFiles/yubihsm_pkcs11.dir/util_pkcs11.c.o
[ 25%] Building C object pkcs11/CMakeFiles/yubihsm_pkcs11.dir/yubihsm_pkcs11.c.o
[ 26%] Building C object pkcs11/CMakeFiles/yubihsm_pkcs11.dir/list.c.o
[ 26%] Building C object pkcs11/CMakeFiles/yubihsm_pkcs11.dir/debug_p11.c.o
[ 27%] Building C object pkcs11/CMakeFiles/yubihsm_pkcs11.dir/cmdline.c.o
[ 28%] Linking C shared library yubihsm_pkcs11.so
[ 29%] Built target yubihsm_pkcs11
[ 29%] Building C object pkcs11/tests/CMakeFiles/ecdh_derive_test.dir/ecdh_derive_test.c.o
[ 30%] Building C object pkcs11/tests/CMakeFiles/ecdh_derive_test.dir/common.c.o
[ 31%] Linking C executable ecdh_derive_test
[ 31%] Built target ecdh_derive_test
[ 32%] Building C object ykhsmauth/CMakeFiles/ykhsmauth.dir/error.c.o
[ 33%] Building C object ykhsmauth/CMakeFiles/ykhsmauth.dir/ykhsmauth.c.o
[ 33%] Linking C shared library libykhsmauth.so
[ 33%] Built target ykhsmauth
[ 34%] Building C object ykhsmauth/CMakeFiles/ykhsmauth_static.dir/error.c.o
[ 35%] Building C object ykhsmauth/CMakeFiles/ykhsmauth_static.dir/ykhsmauth.c.o
[ 35%] Linking C static library libykhsmauth.a
[ 35%] Built target ykhsmauth_static
[ 35%] Building C object yubihsm-auth/CMakeFiles/yubihsm-auth.dir/main.c.o
[ 36%] Building C object yubihsm-auth/CMakeFiles/yubihsm-auth.dir/__/common/parsing.c.o
[ 37%] Building C object yubihsm-auth/CMakeFiles/yubihsm-auth.dir/__/common/pkcs5.c.o
[ 37%] Building C object yubihsm-auth/CMakeFiles/yubihsm-auth.dir/__/common/hash.c.o
[ 38%] Building C object yubihsm-auth/CMakeFiles/yubihsm-auth.dir/cmdline.c.o
[ 39%] Linking C executable yubihsm-auth
[ 40%] Built target yubihsm-auth
[ 41%] Building manpage for yubihsm-auth
[ 41%] Built target yubihsm-auth-man
[ 42%] Building C object src/CMakeFiles/yubihsm-shell.dir/commands.c.o
[ 43%] Building C object src/CMakeFiles/yubihsm-shell.dir/main.c.o
In file included from /usr/include/readline/keymaps.h:35:0,
                 from /usr/include/editline/readline.h:37,
                 from /home/lucidadmin/Downloads/yubihsm-shell-master/src/main.c:64:
/home/lucidadmin/Downloads/yubihsm-shell-master/src/main.c: In function ‘tokenize’:
/home/lucidadmin/Downloads/yubihsm-shell-master/src/main.c:933:17: error: expected identifier before '\x20'
   enum states { SPACE, WORD, QUOTE } state = SPACE;
                 ^
/home/lucidadmin/Downloads/yubihsm-shell-master/src/main.c:966:19: error: ‘QUOTE’ undeclared (first use in this function)
           state = QUOTE;
                   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/src/main.c:966:19: note: each undeclared identifier is reported only once for each function it appears in
/home/lucidadmin/Downloads/yubihsm-shell-master/src/main.c:971:19: error: ‘WORD’ undeclared (first use in this function)
           state = WORD;
                   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/src/main.c: In function ‘complete_arg’:
/home/lucidadmin/Downloads/yubihsm-shell-master/src/main.c:1005:18: error: storage size of ‘w’ isn’t known
   struct winsize w;
                  ^
/home/lucidadmin/Downloads/yubihsm-shell-master/src/main.c:1007:3: error: implicit declaration of function ‘ioctl’ [-Wimplicit-function-declaration]
   ioctl(fileno(stdout), TIOCGWINSZ, &w);
   ^
/home/lucidadmin/Downloads/yubihsm-shell-master/src/main.c:1007:25: error: ‘TIOCGWINSZ’ undeclared (first use in this function)
   ioctl(fileno(stdout), TIOCGWINSZ, &w);
                         ^
/home/lucidadmin/Downloads/yubihsm-shell-master/src/main.c: At top level:
cc1: error: unrecognized command line option "-Wno-implicit-fallthrough" [-Werror]
cc1: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/yubihsm-shell.dir/main.c.o] Error 1
make[1]: *** [src/CMakeFiles/yubihsm-shell.dir/all] Error 2
make: *** [all] Error 2
naimulhq commented 2 years ago

I was able to get it to build by adding additional flags in CMakeLists.txt and making some changes to src/main.c

qpernil commented 2 years ago

Would you care to share those changes ? If not the changes then at least a short description what you had to change. For my understanding of the situation.

naimulhq commented 2 years ago

Yes I will share those changes and put a link on it here

naimulhq commented 2 years ago

Here is the link to the PR #241 . The PR discusses the changes that were made and why they were made. There was only one minor change to the source code and CMakeLists.txt. Other than that, the rest of the changes were a result of missing header files or .pc files that did not come with the installation of the -devel packages.

qpernil commented 2 years ago

This issue will be closed for lack of activity soon.

qpernil commented 2 years ago

Closing this for lack of activity. Some issues reported were fixed.