Skip to content

Upgrade openssl to 3.5.1 #3035

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

Merged
merged 4 commits into from
Jul 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ For other architectures, refer to [build](https://github.com/DMTF/libspdm/blob/m

1) [Mbed TLS](https://tls.mbed.org) as cryptography library. Version 3.6.2.

2) [OpenSSL](https://www.openssl.org) as cryptography library. Version 3.0.14.
2) [OpenSSL](https://www.openssl.org) as cryptography library. Version 3.5.1.

### Unit Test framework

Expand Down
95 changes: 91 additions & 4 deletions os_stub/openssllib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ target_include_directories(openssllib
${LIBSPDM_DIR}/os_stub/openssllib/openssl/providers/common/include
${LIBSPDM_DIR}/os_stub/openssllib/openssl/providers/implementations/include
${LIBSPDM_DIR}/os_stub/openssllib/openssl/providers/implementations/ciphers
${LIBSPDM_DIR}/os_stub/openssllib/openssl/providers/fips/include
)

target_sources(openssllib
Expand Down Expand Up @@ -231,9 +232,12 @@ target_sources(openssllib
openssl/crypto/buffer/buf_err.c
openssl/crypto/buffer/buffer.c
openssl/crypto/chacha/chacha_enc.c
openssl/crypto/comp/c_brotli.c
openssl/crypto/comp/c_zlib.c
openssl/crypto/comp/c_zstd.c
openssl/crypto/comp/comp_err.c
openssl/crypto/comp/comp_lib.c
openssl/crypto/comp_methods.c
openssl/crypto/conf/conf_api.c
openssl/crypto/conf/conf_def.c
openssl/crypto/conf/conf_err.c
Expand All @@ -251,7 +255,9 @@ target_sources(openssllib
openssl/crypto/cryptlib.c
openssl/crypto/ctype.c
openssl/crypto/cversion.c
openssl/crypto/defaults.c
openssl/crypto/der_writer.c
openssl/crypto/deterministic_nonce.c
openssl/crypto/dh/dh_ameth.c
openssl/crypto/dh/dh_asn1.c
openssl/crypto/dh/dh_backend.c
Expand Down Expand Up @@ -325,7 +331,9 @@ target_sources(openssllib
openssl/crypto/encode_decode/encoder_pkey.c
openssl/crypto/err/err.c
openssl/crypto/err/err_blocks.c
openssl/crypto/err/err_mark.c
openssl/crypto/err/err_prn.c
openssl/crypto/err/err_save.c
openssl/crypto/evp/asymcipher.c
openssl/crypto/evp/bio_b64.c
openssl/crypto/evp/bio_enc.c
Expand Down Expand Up @@ -389,6 +397,8 @@ target_sources(openssllib
openssl/crypto/evp/pmeth_gn.c
openssl/crypto/evp/pmeth_lib.c
openssl/crypto/evp/signature.c
openssl/crypto/evp/s_lib.c
openssl/crypto/evp/skeymgmt_meth.c
openssl/crypto/ex_data.c
openssl/crypto/ffc/ffc_backend.c
openssl/crypto/ffc/ffc_dh.c
Expand All @@ -398,10 +408,15 @@ target_sources(openssllib
openssl/crypto/ffc/ffc_params_validate.c
openssl/crypto/ffc/ffc_params.c
openssl/crypto/getenv.c
openssl/crypto/hashtable/hashfunc.c
openssl/crypto/hashtable/hashtable.c
openssl/crypto/hmac/hmac.c
openssl/crypto/hpke/hpke.c
openssl/crypto/hpke/hpke_util.c
openssl/crypto/http/http_lib.c
openssl/crypto/http/http_err.c
openssl/crypto/http/http_client.c
openssl/crypto/indicator_core.c
openssl/crypto/init.c
openssl/crypto/initthread.c
openssl/crypto/kdf/kdf_err.c
Expand All @@ -413,6 +428,15 @@ target_sources(openssllib
openssl/crypto/mem.c
openssl/crypto/mem_clr.c
openssl/crypto/mem_sec.c
openssl/crypto/ml_dsa/ml_dsa_encoders.c
openssl/crypto/ml_dsa/ml_dsa_key.c
openssl/crypto/ml_dsa/ml_dsa_key_compress.c
openssl/crypto/ml_dsa/ml_dsa_matrix.c
openssl/crypto/ml_dsa/ml_dsa_ntt.c
openssl/crypto/ml_dsa/ml_dsa_params.c
openssl/crypto/ml_dsa/ml_dsa_sample.c
openssl/crypto/ml_dsa/ml_dsa_sign.c
openssl/crypto/ml_kem/ml_kem.c
openssl/crypto/modes/cbc128.c
openssl/crypto/modes/ccm128.c
openssl/crypto/modes/cfb128.c
Expand All @@ -423,6 +447,7 @@ target_sources(openssllib
openssl/crypto/modes/ofb128.c
openssl/crypto/modes/wrap128.c
openssl/crypto/modes/xts128.c
openssl/crypto/modes/xts128gb.c
openssl/crypto/o_dir.c
openssl/crypto/o_fopen.c
openssl/crypto/o_init.c
Expand Down Expand Up @@ -494,6 +519,7 @@ target_sources(openssllib
openssl/crypto/rand/rand_lib.c
openssl/crypto/rand/rand_meth.c
openssl/crypto/rand/rand_pool.c
openssl/crypto/rand/rand_uniform.c
openssl/crypto/rsa/rsa_ameth.c
openssl/crypto/rsa/rsa_asn1.c
openssl/crypto/rsa/rsa_backend.c
Expand Down Expand Up @@ -528,6 +554,17 @@ target_sources(openssllib
openssl/crypto/sha/sha3.c
openssl/crypto/self_test_core.c
openssl/crypto/siphash/siphash.c
openssl/crypto/sleep.c
openssl/crypto/slh_dsa/slh_adrs.c
openssl/crypto/slh_dsa/slh_dsa.c
openssl/crypto/slh_dsa/slh_dsa_hash_ctx.c
openssl/crypto/slh_dsa/slh_dsa_key.c
openssl/crypto/slh_dsa/slh_fors.c
openssl/crypto/slh_dsa/slh_hash.c
openssl/crypto/slh_dsa/slh_hypertree.c
openssl/crypto/slh_dsa/slh_params.c
openssl/crypto/slh_dsa/slh_wots.c
openssl/crypto/slh_dsa/slh_xmss.c
openssl/crypto/sm2/sm2_crypt.c
openssl/crypto/sm2/sm2_err.c
openssl/crypto/sm2/sm2_key.c
Expand All @@ -538,6 +575,7 @@ target_sources(openssllib
openssl/crypto/sparse_array.c
openssl/crypto/stack/stack.c
openssl/crypto/store/store_meth.c
openssl/crypto/time.c
openssl/crypto/threads_lib.c
openssl/crypto/threads_none.c
openssl/crypto/threads_pthread.c
Expand All @@ -555,6 +593,7 @@ target_sources(openssllib
openssl/crypto/x509/t_crl.c
openssl/crypto/x509/t_req.c
openssl/crypto/x509/t_x509.c
openssl/crypto/x509/x509_acert.c
openssl/crypto/x509/x509_att.c
openssl/crypto/x509/x509_cmp.c
openssl/crypto/x509/x509_d2.c
Expand Down Expand Up @@ -592,11 +631,18 @@ target_sources(openssllib
openssl/crypto/x509/pcy_map.c
openssl/crypto/x509/pcy_node.c
openssl/crypto/x509/pcy_tree.c
openssl/crypto/x509/v3_aaa.c
openssl/crypto/x509/v3_ac_tgt.c
openssl/crypto/x509/v3_addr.c
openssl/crypto/x509/v3_admis.c
openssl/crypto/x509/v3_akeya.c
openssl/crypto/x509/v3_akid.c
openssl/crypto/x509/v3_asid.c
openssl/crypto/x509/v3_attrdesc.c
openssl/crypto/x509/v3_attrmap.c
openssl/crypto/x509/v3_audit_id.c
openssl/crypto/x509/v3_authattid.c
openssl/crypto/x509/v3_battcons.c
openssl/crypto/x509/v3_bcons.c
openssl/crypto/x509/v3_bitst.c
openssl/crypto/x509/v3_conf.c
Expand All @@ -605,39 +651,52 @@ target_sources(openssllib
openssl/crypto/x509/v3_enum.c
openssl/crypto/x509/v3_extku.c
openssl/crypto/x509/v3_genn.c
openssl/crypto/x509/v3_group_ac.c
openssl/crypto/x509/v3_ia5.c
openssl/crypto/x509/v3_ind_iss.c
openssl/crypto/x509/v3_info.c
openssl/crypto/x509/v3_int.c
openssl/crypto/x509/v3_iobo.c
openssl/crypto/x509/v3_ist.c
openssl/crypto/x509/v3_lib.c
openssl/crypto/x509/v3_ncons.c
openssl/crypto/x509/v3_no_ass.c
openssl/crypto/x509/v3_no_rev_avail.c
openssl/crypto/x509/v3_pci.c
openssl/crypto/x509/v3_pcia.c
openssl/crypto/x509/v3_pcons.c
openssl/crypto/x509/v3_pku.c
openssl/crypto/x509/v3_pmaps.c
openssl/crypto/x509/v3_prn.c
openssl/crypto/x509/v3_purp.c
openssl/crypto/x509/v3_rolespec.c
openssl/crypto/x509/v3_san.c
openssl/crypto/x509/v3_sda.c
openssl/crypto/x509/v3_single_use.c
openssl/crypto/x509/v3_soa_id.c
openssl/crypto/x509/v3_skid.c
openssl/crypto/x509/v3_sxnet.c
openssl/crypto/x509/v3_timespec.c
openssl/crypto/x509/v3_tlsf.c
openssl/crypto/x509/v3_usernotice.c
openssl/crypto/x509/v3_utf8.c
openssl/crypto/x509/v3_utl.c
openssl/crypto/x509/v3err.c

openssl/providers/baseprov.c
openssl/providers/defltprov.c
openssl/providers/legacyprov.c
# openssl/providers/legacyprov.c
openssl/providers/nullprov.c
openssl/providers/prov_running.c
openssl/providers/common/bio_prov.c
openssl/providers/common/capabilities.c
openssl/providers/common/der/der_ec_key.c
openssl/providers/common/der/der_ec_sig.c
openssl/providers/common/der/der_ecx_key.c
openssl/providers/common/der/der_ml_dsa_key.c
openssl/providers/common/der/der_rsa_key.c
openssl/providers/common/der/der_rsa_sig.c
openssl/providers/common/der/der_slh_dsa_key.c
openssl/providers/common/der/der_sm2_key.c
openssl/providers/common/der/der_sm2_sig.c
openssl/providers/common/digest_to_nid.c
Expand Down Expand Up @@ -680,6 +739,12 @@ target_sources(openssllib
openssl/providers/implementations/ciphers/cipher_chacha20_poly1305.c
openssl/providers/implementations/ciphers/cipher_sm4.c
openssl/providers/implementations/ciphers/cipher_sm4_hw.c
openssl/providers/implementations/ciphers/cipher_sm4_ccm.c
openssl/providers/implementations/ciphers/cipher_sm4_ccm_hw.c
openssl/providers/implementations/ciphers/cipher_sm4_gcm.c
openssl/providers/implementations/ciphers/cipher_sm4_gcm_hw.c
openssl/providers/implementations/ciphers/cipher_sm4_xts.c
openssl/providers/implementations/ciphers/cipher_sm4_xts_hw.c
openssl/providers/implementations/digests/digestcommon.c
openssl/providers/implementations/digests/sm3_prov.c
openssl/providers/implementations/digests/sha3_prov.c
Expand All @@ -698,6 +763,9 @@ target_sources(openssllib
openssl/providers/implementations/encode_decode/decode_epki2pki.c
openssl/providers/implementations/encode_decode/decode_der2key.c
openssl/providers/implementations/encode_decode/endecoder_common.c
openssl/providers/implementations/encode_decode/ml_common_codecs.c
openssl/providers/implementations/encode_decode/ml_dsa_codecs.c
openssl/providers/implementations/encode_decode/ml_kem_codecs.c
openssl/providers/implementations/exchange/dh_exch.c
openssl/providers/implementations/exchange/ecdh_exch.c
openssl/providers/implementations/exchange/ecx_exch.c
Expand All @@ -713,8 +781,19 @@ target_sources(openssllib
openssl/providers/implementations/keymgmt/kdf_legacy_kmgmt.c
openssl/providers/implementations/keymgmt/mac_legacy_kmgmt.c
openssl/providers/implementations/keymgmt/rsa_kmgmt.c
openssl/providers/implementations/keymgmt/ml_dsa_kmgmt.c
openssl/providers/implementations/keymgmt/ml_kem_kmgmt.c
openssl/providers/implementations/keymgmt/mlx_kmgmt.c
openssl/providers/implementations/keymgmt/slh_dsa_kmgmt.c
openssl/providers/implementations/kem/ec_kem.c
openssl/providers/implementations/kem/ecx_kem.c
openssl/providers/implementations/kem/rsa_kem.c
openssl/providers/implementations/kem/kem_util.c
openssl/providers/implementations/kem/ml_kem_kem.c
openssl/providers/implementations/kem/mlx_kem.c
openssl/providers/implementations/kdfs/x942kdf.c
openssl/providers/implementations/kdfs/pbkdf1.c
openssl/providers/implementations/kdfs/pvkkdf.c
openssl/providers/implementations/kdfs/tls1_prf.c
openssl/providers/implementations/kdfs/sskdf.c
openssl/providers/implementations/kdfs/sshkdf.c
Expand All @@ -725,6 +804,7 @@ target_sources(openssllib
openssl/providers/implementations/kdfs/krb5kdf.c
openssl/providers/implementations/kdfs/kbkdf.c
openssl/providers/implementations/kdfs/hkdf.c
openssl/providers/implementations/kdfs/hmacdrbg_kdf.c
openssl/providers/implementations/rands/seeding/rand_win.c
openssl/providers/implementations/rands/seeding/rand_unix.c
openssl/providers/implementations/rands/seeding/rand_tsc.c
Expand All @@ -735,22 +815,29 @@ target_sources(openssllib
openssl/providers/implementations/rands/drbg_hash.c
openssl/providers/implementations/rands/drbg_ctr.c
openssl/providers/implementations/rands/drbg.c
openssl/providers/implementations/rands/crngt.c
openssl/providers/implementations/signature/ecdsa_sig.c
openssl/providers/implementations/signature/eddsa_sig.c
openssl/providers/implementations/signature/mac_legacy_sig.c
openssl/providers/implementations/signature/ml_dsa_sig.c
openssl/providers/implementations/signature/rsa_sig.c
openssl/providers/implementations/signature/slh_dsa_sig.c
openssl/providers/implementations/signature/sm2_sig.c
openssl/providers/implementations/skeymgmt/aes_skmgmt.c
openssl/providers/implementations/skeymgmt/generic.c

openssl/ssl/record/tls_pad.c
openssl/ssl/s3_cbc.c
openssl/ssl/record/methods/ssl3_cbc.c
openssl/ssl/record/methods/tls_pad.c

openssl_gen/der_digests_gen.c
openssl_gen/der_ec_gen.c
openssl_gen/der_ecx_gen.c
openssl_gen/der_ml_dsa_gen.c
openssl_gen/der_rsa_gen.c
openssl_gen/der_slh_dsa_gen.c
openssl_gen/der_sm2_gen.c
openssl_gen/der_wrap_gen.c
openssl_gen/params_idx.c
rand_pool.c
ossl_store.c
timer_wrapper.c
)
21 changes: 14 additions & 7 deletions os_stub/openssllib/include/crt_support.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright Notice:
* Copyright 2021-2022 DMTF. All rights reserved.
* Copyright 2021-2025 DMTF. All rights reserved.
* License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
**/

Expand All @@ -19,6 +19,10 @@
#if defined(_MSC_VER) && defined(__clang__)
#include <corecrt.h>
#endif

#if defined(_MSC_VER) && _MSC_VER>=1300
#include <intrin.h>
#endif
#define OPENSSLDIR ""
#define ENGINESDIR ""
#define MODULESDIR ""
Expand Down Expand Up @@ -244,7 +248,7 @@ typedef uint8_t sa_family_t;
typedef uint8_t u_char;
typedef uint32_t uid_t;
typedef uint32_t gid_t;

typedef long off_t;

/* file operations are not required for EFI building,
* so FILE is mapped to void * to pass build*/
Expand Down Expand Up @@ -273,6 +277,11 @@ struct timeval {
long tv_usec; /* time value, in microseconds */
};

struct timezone {
int tz_minuteswest;
int tz_dsttime;
};

struct sockaddr {
__uint8_t sa_len; /* total length */
sa_family_t sa_family; /* address family */
Expand Down Expand Up @@ -302,6 +311,7 @@ int tolower(int);
int strcmp(const char *, const char *);
int strncasecmp(const char *, const char *, size_t);
char *strchr(const char *, int);
char *strpbrk(const char *, const char *);
char *strrchr(const char *, int);
unsigned long strtoul(const char *, char **, int);
long strtol(const char *, char **, int);
Expand Down Expand Up @@ -348,10 +358,7 @@ int sprintf(char *string, const char *format, ...);
#define localtime(timer) NULL
#define assert(expression)
int atoi(const char *nptr);
#define gettimeofday(tvp, tz) \
do { \
(tvp)->tv_sec = time(NULL); \
(tvp)->tv_usec = 0; \
} while (0)
unsigned int sleep (unsigned int seconds);
int gettimeofday (struct timeval *tv, struct timezone *tz);

#endif
Loading