1- From b7f3fefcc4d946c78c2ab0a500e969632e593723 Mon Sep 17 00:00:00 2001
1+ From 44b9d6c118b6dc4d7693c35cb1d193934de20ac3 Mon Sep 17 00:00:00 2001
22From: Pete Batard <pete@akeo.ie>
3- Date: Mon, 27 Jan 2025 20:38:04 +0000
3+ Date: Fri, 21 Nov 2025 18:43:36 +0000
44Subject: [PATCH] OpenSSL submodule fixes for RISCV64 compilation
55
66---
@@ -9,17 +9,17 @@ Subject: [PATCH] OpenSSL submodule fixes for RISCV64 compilation
99 crypto/ec/ec_ameth.c | 3 ++-
1010 crypto/evp/evp_enc.c | 2 +-
1111 providers/implementations/include/prov/ciphercommon.h | 2 +-
12- providers/implementations/include/prov/digestcommon.h | 2 + -
12+ providers/implementations/include/prov/digestcommon.h | 4 ++- -
1313 providers/implementations/macs/hmac_prov.c | 2 +-
1414 providers/implementations/signature/ecdsa_sig.c | 2 +-
1515 providers/implementations/signature/rsa_sig.c | 2 +-
16- 9 files changed, 10 insertions(+), 9 deletions(-)
16+ 9 files changed, 11 insertions(+), 10 deletions(-)
1717
1818diff --git a/crypto/ec/curve448/curve448.c b/crypto/ec/curve448/curve448.c
19- index 6928d9693c..7ddd617a73 100644
19+ index 1db78ee5c6..44217c74ac 100644
2020--- a/crypto/ec/curve448/curve448.c
2121+++ b/crypto/ec/curve448/curve448.c
22- @@ -509 ,7 +509 ,7 @@ struct smvt_control {
22+ @@ -510 ,7 +510 ,7 @@ struct smvt_control {
2323 int power, addend;
2424 };
2525
@@ -29,7 +29,7 @@ index 6928d9693c..7ddd617a73 100644
2929 #else
3030 # define NUMTRAILINGZEROS numtrailingzeros
3131diff --git a/crypto/ec/curve448/point_448.h b/crypto/ec/curve448/point_448.h
32- index e67ea68044..72536c2471 100644
32+ index 96a54558d6..dfe01ecaa2 100644
3333--- a/crypto/ec/curve448/point_448.h
3434+++ b/crypto/ec/curve448/point_448.h
3535@@ -181,7 +181,7 @@ static ossl_inline void curve448_scalar_copy(curve448_scalar_t out,
@@ -42,7 +42,7 @@ index e67ea68044..72536c2471 100644
4242
4343 /*
4444diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c
45- index d4348ff244..cac8672354 100644
45+ index ad28ba6827..ea67f35769 100644
4646--- a/crypto/ec/ec_ameth.c
4747+++ b/crypto/ec/ec_ameth.c
4848@@ -161,12 +161,13 @@ static int eckey_priv_decode_ex(EVP_PKEY *pkey, const PKCS8_PRIV_KEY_INFO *p8,
@@ -61,10 +61,10 @@ index d4348ff244..cac8672354 100644
6161 ERR_raise(ERR_LIB_EC, EC_R_DECODE_ERROR);
6262 return 0;
6363diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c
64- index 4e6f83e3d0..6cac709644 100644
64+ index eee00a0780..37108a6a5c 100644
6565--- a/crypto/evp/evp_enc.c
6666+++ b/crypto/evp/evp_enc.c
67- @@ -1423 ,7 +1423 ,7 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in)
67+ @@ -1790 ,7 +1790 ,7 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in)
6868
6969 EVP_CIPHER_CTX_reset(out);
7070
@@ -74,10 +74,10 @@ index 4e6f83e3d0..6cac709644 100644
7474
7575 if (in->fetched_cipher != NULL && !EVP_CIPHER_up_ref(in->fetched_cipher)) {
7676diff --git a/providers/implementations/include/prov/ciphercommon.h b/providers/implementations/include/prov/ciphercommon.h
77- index aacd49707f..03c25cbb1f 100644
77+ index 46efdc8003..0c54c6e57a 100644
7878--- a/providers/implementations/include/prov/ciphercommon.h
7979+++ b/providers/implementations/include/prov/ciphercommon.h
80- @@ -317 ,7 +317 ,7 @@ static void name(PROV_CIPHER_CTX *dst, const PROV_CIPHER_CTX *src) \
80+ @@ -327 ,7 +327 ,7 @@ static void name(PROV_CIPHER_CTX *dst, const PROV_CIPHER_CTX *src) \
8181 CTX_TYPE *sctx = (CTX_TYPE *)src; \
8282 CTX_TYPE *dctx = (CTX_TYPE *)dst; \
8383 \
@@ -87,23 +87,31 @@ index aacd49707f..03c25cbb1f 100644
8787 }
8888
8989diff --git a/providers/implementations/include/prov/digestcommon.h b/providers/implementations/include/prov/digestcommon.h
90- index abdb8bb2ad..7e299501c4 100644
90+ index 332d473490..d12ce27126 100644
9191--- a/providers/implementations/include/prov/digestcommon.h
9292+++ b/providers/implementations/include/prov/digestcommon.h
93- @@ -67,7 +67,7 @@ static void *name##_dupctx(void *ctx) \
93+ @@ -67,14 +67,14 @@ static void *name##_dupctx(void *ctx) \
9494 CTX *in = (CTX *)ctx; \
9595 CTX *ret = ossl_prov_is_running() ? OPENSSL_malloc(sizeof(*ret)) : NULL; \
9696 if (ret != NULL) \
9797- *ret = *in; \
9898+ memcpy(ret, in, sizeof(*ret)); \
9999 return ret; \
100100 } \
101+ static void name##_copyctx(void *voutctx, void *vinctx) \
102+ { \
103+ CTX *outctx = (CTX *)voutctx; \
104+ CTX *inctx = (CTX *)vinctx; \
105+ - *outctx = *inctx; \
106+ + memcpy(outctx, inctx, sizeof(CTX)); \
107+ } \
101108 PROV_FUNC_DIGEST_FINAL(name, dgstsize, fin) \
109+ PROV_FUNC_DIGEST_GET_PARAM(name, blksize, dgstsize, flags) \
102110diff --git a/providers/implementations/macs/hmac_prov.c b/providers/implementations/macs/hmac_prov.c
103- index 52ebb08b8f..4bfe4ca675 100644
111+ index e9c3087027..d8ca1fb974 100644
104112--- a/providers/implementations/macs/hmac_prov.c
105113+++ b/providers/implementations/macs/hmac_prov.c
106- @@ -112 ,7 +112 ,7 @@ static void *hmac_dup(void *vsrc)
114+ @@ -116 ,7 +116 ,7 @@ static void *hmac_dup(void *vsrc)
107115 return NULL;
108116
109117 ctx = dst->ctx;
@@ -113,31 +121,31 @@ index 52ebb08b8f..4bfe4ca675 100644
113121 dst->key = NULL;
114122 memset(&dst->digest, 0, sizeof(dst->digest));
115123diff --git a/providers/implementations/signature/ecdsa_sig.c b/providers/implementations/signature/ecdsa_sig.c
116- index 865d49d100..472add01f2 100644
124+ index 4018a772ff..bc496ffa35 100644
117125--- a/providers/implementations/signature/ecdsa_sig.c
118126+++ b/providers/implementations/signature/ecdsa_sig.c
119- @@ -399 ,7 +399 ,7 @@ static void *ecdsa_dupctx(void *vctx)
127+ @@ -638 ,7 +638 ,7 @@ static void *ecdsa_dupctx(void *vctx)
120128 if (dstctx == NULL)
121129 return NULL;
122130
123131- *dstctx = *srcctx;
124132+ memcpy(dstctx, srcctx, sizeof(*dstctx));
125133 dstctx->ec = NULL;
126- dstctx->md = NULL;
127- dstctx->mdctx = NULL;
134+ dstctx->propq = NULL;
135+
128136diff --git a/providers/implementations/signature/rsa_sig.c b/providers/implementations/signature/rsa_sig.c
129- index 919ef17269..540bea8814 100644
137+ index e75b90840b..8e83a7a67c 100644
130138--- a/providers/implementations/signature/rsa_sig.c
131139+++ b/providers/implementations/signature/rsa_sig.c
132- @@ -994,7 +994,7 @@ static void *rsa_dupctx(void *vprsactx)
140+ @@ -1343,7 +1343,7 @@ static void *rsa_dupctx(void *vprsactx)
141+ if (dstctx == NULL)
133142 return NULL;
134- }
135143
136144- *dstctx = *srcctx;
137145+ memcpy(dstctx, srcctx, sizeof(*dstctx));
138146 dstctx->rsa = NULL;
139147 dstctx->md = NULL;
140148 dstctx->mgf1_md = NULL;
141149- -
142- 2.45.2 .windows.1
150+ 2.52.0 .windows.1
143151
0 commit comments