tpm2-software / tpm2-tss-engine

OpenSSL Engine for TPM2 devices
https://tpm2-software.github.io
BSD 3-Clause "New" or "Revised" License
151 stars 100 forks source link

OpenSSL 3.x support #281

Closed cristoferteneyck closed 7 months ago

cristoferteneyck commented 7 months ago

Hi, I am getting the following error when running make.

make -j$(nproc) GEN man/man1/tpm2tss-genkey.1 GEN man/man3/tpm2tss_tpm2data_write.3 GEN man/man3/tpm2tss_rsa_makekey.3 GEN man/man3/tpm2tss_rsa_genkey.3 GEN man/man3/tpm2tss_ecc_makekey.3 GEN man/man3/tpm2tss_ecc_genkey.3 GEN man/man3/tpm2tss_ecc_getappdata.3 GEN man/man3/tpm2tss_tpm2data_read.3 CC src/tpm2tss_genkey-tpm2tss-genkey.o CC src/libtpm2tss_la-tpm2-tss-engine.lo CC src/libtpm2tss_la-tpm2-tss-engine-common.lo src/tpm2-tss-engine-common.c: In function 'tpm2tss_tpm2data_readtpm': src/tpm2-tss-engine-common.c:263:9: error: 'RAND_get_rand_method' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 263 | const RAND_METHOD *rand_save = RAND_get_rand_method(); | ^~~~~ In file included from /usr/include/openssl/engine.h:29, from src/tpm2-tss-engine-common.c:39: /usr/include/openssl/rand.h:50:42: note: declared here 50 | OSSL_DEPRECATEDIN_3_0 const RAND_METHOD *RAND_get_rand_method(void); | ^~~~~~~~~~~~~~~~~~~~ src/tpm2tss-genkey.c: In function ‘genkey_rsa’: src/tpm2-tss-engine-common.c:267:9: error: 'RAND_set_rand_method' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 267 | RAND_set_rand_method(RAND_OpenSSL()); | ^~~~~~~~~~~~~~~~~~~~ /usr/include/openssl/rand.h:49:27: note: declared here 49 | OSSL_DEPRECATEDIN_3_0 int RAND_set_rand_method(const RAND_METHOD *meth); | ^~~~~~~~~~~~~~~~~~~~ src/tpm2tss-genkey.c:253:5: error: ‘RSA_new’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 253 | rsa = RSA_new(); | ^~~ src/tpm2-tss-engine-common.c:267:9: error: 'RAND_OpenSSL' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 267 | RAND_set_rand_method(RAND_OpenSSL()); | ^~~~~~~~~~~~~~~~~~~~ /usr/include/openssl/rand.h:55:36: note: declared here 55 | OSSL_DEPRECATEDIN_3_0 RAND_METHOD *RAND_OpenSSL(void); | ^~~~~~~~~~~~ In file included from /usr/include/openssl/engine.h:25, from src/tpm2tss-genkey.c:39: /usr/include/openssl/rsa.h:201:28: note: declared here 201 | OSSL_DEPRECATEDIN_3_0 RSA *RSA_new(void); | ^~~~~~~ src/tpm2tss-genkey.c:261:9: error: ‘RSA_free’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 261 | RSA_free(rsa); | ^~~~~~~~ /usr/include/openssl/rsa.h:293:28: note: declared here 293 | OSSL_DEPRECATEDIN_3_0 void RSA_free(RSA *r); | ^~~~~~~~ src/tpm2-tss-engine-common.c:296:9: error: 'RAND_set_rand_method' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 296 | RAND_set_rand_method(rand_save); | ^~~~~~~~~~~~~~~~~~~~ /usr/include/openssl/rand.h:49:27: note: declared here 49 | OSSL_DEPRECATEDIN_3_0 int RAND_set_rand_method(const RAND_METHOD *meth); | ^~~~~~~~~~~~~~~~~~~~ src/tpm2tss-genkey.c:272:9: error: ‘RSA_free’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 272 | RSA_free(rsa); | ^~~~~~~~ /usr/include/openssl/rsa.h:293:28: note: declared here 293 | OSSL_DEPRECATEDIN_3_0 void RSA_free(RSA *r); | ^~~~~~~~ src/tpm2tss-genkey.c:275:5: error: ‘RSA_get_ex_data’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 275 | memcpy(tpm2Data, RSA_get_app_data(rsa), sizeof(*tpm2Data)); | ^~~~~~ /usr/include/openssl/rsa.h:446:29: note: declared here 446 | OSSL_DEPRECATEDIN_3_0 void *RSA_get_ex_data(const RSA *r, int idx); | ^~~~~~~~~~~~~~~ src/tpm2tss-genkey.c:278:5: error: ‘RSA_free’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 278 | RSA_free(rsa); | ^~~~~~~~ /usr/include/openssl/rsa.h:293:28: note: declared here 293 | OSSL_DEPRECATEDIN_3_0 void RSA_free(RSA *r); | ^~~~~~~~ src/tpm2tss-genkey.c: In function ‘genkey_ecdsa’: src/tpm2tss-genkey.c:294:5: error: ‘EC_KEY_new’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 294 | eckey = EC_KEY_new(); | ^~~~~ In file included from /usr/include/openssl/engine.h:28: /usr/include/openssl/ec.h:968:31: note: declared here 968 | OSSL_DEPRECATEDIN_3_0 EC_KEY *EC_KEY_new(void); | ^~~~~~~~~~ src/tpm2tss-genkey.c:300:9: error: ‘EC_KEY_free’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 300 | EC_KEY_free(eckey); | ^~~~~~~~~~~ /usr/include/openssl/ec.h:1003:28: note: declared here 1003 | OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key); | ^~~~~~~~~~~ src/tpm2tss-genkey.c:308:9: error: ‘EC_KEY_free’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 308 | EC_KEY_free(eckey); | ^~~~~~~~~~~ /usr/include/openssl/ec.h:1003:28: note: declared here 1003 | OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key); | ^~~~~~~~~~~ src/tpm2tss-genkey.c:313:5: error: ‘EC_KEY_free’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 313 | EC_KEY_free(eckey); | ^~~~~~~~~~~ /usr/include/openssl/ec.h:1003:28: note: declared here 1003 | OSSL_DEPRECATEDIN_3_0 void EC_KEY_free(EC_KEY *key); | ^~~~~~~~~~~ src/tpm2tss-genkey.c: In function ‘main’: src/tpm2tss-genkey.c:346:5: error: ‘ENGINE_by_id’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 346 | ENGINE *tpm_engine = ENGINE_by_id("tpm2tss"); | ^~~~~~ /usr/include/openssl/engine.h:336:31: note: declared here 336 | OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_by_id(const char *id); | ^~~~~~~~~~~~ src/tpm2tss-genkey.c:348:9: error: ‘ENGINE_by_id’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 348 | tpm_engine = ENGINE_by_id("libtpm2tss"); | ^~~~~~~~~~ /usr/include/openssl/engine.h:336:31: note: declared here 336 | OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_by_id(const char *id); | ^~~~~~~~~~~~ src/tpm2tss-genkey.c:354:5: error: ‘ENGINE_init’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 354 | int init_res = ENGINE_init(tpm_engine); | ^~~ /usr/include/openssl/engine.h:620:27: note: declared here 620 | OSSL_DEPRECATEDIN_3_0 int ENGINE_init(ENGINE *e); | ^~~~~~~~~~~ src/tpm2tss-genkey.c:355:5: error: ‘ENGINE_get_name’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 355 | VERB("Engine name: %s\nInit result: %d \n", ENGINE_get_name(tpm_engine), | ^~~~ /usr/include/openssl/engine.h:553:35: note: declared here 553 | OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_name(const ENGINE *e); | ^~~~~~~~~~~~~~~ src/tpm2tss-genkey.c:361:13: error: ‘ENGINE_ctrl’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 361 | !ENGINE_ctrl(tpm_engine, TPM2TSS_SET_OWNERAUTH, 0, opt.ownerpw, NULL)) { | ^ /usr/include/openssl/engine.h:429:27: note: declared here 429 | OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, | ^~~~~~~~~~~ src/tpm2tss-genkey.c:367:13: error: ‘ENGINE_ctrl’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 367 | !ENGINE_ctrl(tpm_engine, TPM2TSS_SET_PARENTAUTH, 0, opt.parentpw, NULL)) { | ^ /usr/include/openssl/engine.h:429:27: note: declared here 429 | OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, | ^~~~~~~~~~~ src/tpm2tss-genkey.c:373:13: error: ‘ENGINE_ctrl’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 373 | !ENGINE_ctrl(tpm_engine, TPM2TSS_SET_TCTI, 0, opt.tcti_conf, NULL)) { | ^ /usr/include/openssl/engine.h:429:27: note: declared here 429 | OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, | ^~~~~~~~~~~ src/tpm2-tss-engine.c: In function 'bind': src/tpm2-tss-engine.c:329:5: error: 'ENGINE_set_id' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 329 | if (!ENGINE_set_id(e, engine_id)) { | ^~ In file included from src/tpm2-tss-engine.c:36: /usr/include/openssl/engine.h:495:27: note: declared here 495 | OSSL_DEPRECATEDIN_3_0 int ENGINE_set_id(ENGINE *e, const char *id); | ^~~~~~~~~~~~~ src/tpm2-tss-engine.c:333:5: error: 'ENGINE_set_name' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 333 | if (!ENGINE_set_name(e, engine_name)) { | ^~ /usr/include/openssl/engine.h:496:27: note: declared here 496 | OSSL_DEPRECATEDIN_3_0 int ENGINE_set_name(ENGINE *e, const char *name); | ^~~~~~~~~~~~~~~ src/tpm2-tss-engine.c:345:5: error: 'ENGINE_set_load_privkey_function' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 345 | if (!ENGINE_set_load_privkey_function(e, loadkey)) { | ^~ /usr/include/openssl/engine.h:511:5: note: declared here 511 | int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/tpm2-tss-engine.c:350:5: error: 'ENGINE_set_destroy_function' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 350 | if (!ENGINE_set_destroy_function(e, destroy_engine)) { | ^~ /usr/include/openssl/engine.h:503:5: note: declared here 503 | int ENGINE_set_destroy_function(ENGINE *e,ENGINE_GEN_INT_FUNC_PTR destroy_f); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ src/tpm2-tss-engine.c:355:5: error: 'ENGINE_set_ctrl_function' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 355 | if (!ENGINE_set_ctrl_function(e, engine_ctrl)) { | ^~ /usr/include/openssl/engine.h:509:5: note: declared here 509 | int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f); | ^~~~~~~~~~~~~~~~~~~~~~~~ src/tpm2-tss-engine.c:360:5: error: 'ENGINE_set_cmd_defns' is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] 360 | if (!ENGINE_set_cmd_defns(e, cmd_defns)) { | ^~ /usr/include/openssl/engine.h:526:27: note: declared here 526 | OSSL_DEPRECATEDIN_3_0 int ENGINE_set_cmd_defns(ENGINE *e,

Do you plan on adding support for OpenSSL3?

cristoferteneyck commented 7 months ago

Disregard, I see the OpenSSL 3.x branch.

cristoferteneyck commented 7 months ago

Closing

mkr1d commented 2 months ago

Disregard, I see the OpenSSL 3.x branch.

Where do you see the OpenSSL 3.x branch exactly?