Skip to content

Commit 3797c03

Browse files
Merge remote-tracking branch 'upstream/master' into zd20936
2 parents 63976cb + 38d5dc6 commit 3797c03

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+47162
-17475
lines changed

.github/workflows/os-check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
--enable-cert-setup-cb --enable-sessioncerts',
6666
'--disable-sni --disable-ecc --disable-tls13 --disable-secure-renegotiation-info',
6767
'CPPFLAGS=-DWOLFSSL_BLIND_PRIVATE_KEY',
68+
'--enable-all --enable-certgencache',
6869
]
6970
name: make check
7071
if: github.repository_owner == 'wolfssl'

.wolfssl_known_macro_extras

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,7 @@ WOLFSSL_ALLOW_TLS_SHA1
663663
WOLFSSL_ALTERNATIVE_DOWNGRADE
664664
WOLFSSL_ALT_NAMES_NO_REV
665665
WOLFSSL_ARM_ARCH_NEON_64BIT
666+
WOLFSSL_ARMASM_NEON_NO_TABLE_LOOKUP
666667
WOLFSSL_ASCON_UNROLL
667668
WOLFSSL_ASNC_CRYPT
668669
WOLFSSL_ASN_EXTRA

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2693,6 +2693,18 @@ if(WOLFSSL_EXAMPLES)
26932693
tests/api/test_ossl_mac.c
26942694
tests/api/test_ossl_rsa.c
26952695
tests/api/test_ossl_sk.c
2696+
tests/api/test_ossl_x509.c
2697+
tests/api/test_ossl_x509_ext.c
2698+
tests/api/test_ossl_x509_name.c
2699+
tests/api/test_ossl_x509_pk.c
2700+
tests/api/test_ossl_x509_vp.c
2701+
tests/api/test_ossl_x509_io.c
2702+
tests/api/test_ossl_x509_crypto.c
2703+
tests/api/test_ossl_x509_acert.c
2704+
tests/api/test_ossl_x509_info.c
2705+
tests/api/test_ossl_x509_str.c
2706+
tests/api/test_ossl_x509_lu.c
2707+
tests/api/test_ossl_pem.c
26962708
tests/api/test_tls13.c
26972709
tests/srp.c
26982710
tests/suites.c

IDE/Renesas/e2studio/RA6M4/include.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ EXTRA_DIST+= IDE/Renesas/e2studio/RA6M4/test/key_data/key_data_sce.c
1717
EXTRA_DIST+= IDE/Renesas/e2studio/RA6M4/test/key_data/key_data.h
1818
EXTRA_DIST+= IDE/Renesas/e2studio/RA6M4/common/wolfssl_demo.h
1919
EXTRA_DIST+= IDE/Renesas/e2studio/RA6M4/common/user_settings.h
20+
EXTRA_DIST+= IDE/Renesas/e2studio/RA6M4/tools/README.md
21+
EXTRA_DIST+= IDE/Renesas/e2studio/RA6M4/tools/example_keys/generate_SignedCA.sh
22+
EXTRA_DIST+= IDE/Renesas/e2studio/RA6M4/tools/example_keys/rsa_private.pem
23+
EXTRA_DIST+= IDE/Renesas/e2studio/RA6M4/tools/example_keys/rsa_public.pem

linuxkm/Makefile

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,41 @@ ifndef MAKE_TMPDIR
104104
endif
105105

106106
GENERATE_SECTION_MAP := $(AWK) 'BEGIN { printf("") >ENVIRON["SECTION_MAP"]; } \
107+
/^Section Headers:/ { \
108+
in_sections = 1; \
109+
in_symbols = 0; \
110+
next; \
111+
} \
112+
/^Symbol table / { \
113+
if (! in_sections) { \
114+
print "symbol table appeared before section headers." >"/dev/stderr"; \
115+
exit(1); \
116+
} \
117+
in_sections = 0; \
118+
in_symbols = 1; \
119+
next; \
120+
} \
107121
{ \
108-
if ($$7 !~ "^[0-9]+$$") \
109-
next; \
110-
if ($$4 == "SECTION") { \
111-
sections[$$7] = $$8; \
112-
next; \
122+
if (in_sections) { \
123+
if (match($$0, \
124+
"^[[:space:]]*\\[[[:space:]]*([0-9]+)[[:space:]]*\\][[:space:]]+([^[:space:]]+)[[:space:]]",\
125+
section_line_a)) { \
126+
sections[section_line_a[1]] = section_line_a[2]; \
127+
next; \
128+
} \
113129
} \
114-
if (($$4 == "NOTYPE") || ($$4 == "OBJECT") || ($$4 == "FUNC")) { \
115-
if (($$8 == "$$d") || ($$8 == "$$t")) \
130+
if (in_symbols) { \
131+
if ($$7 !~ "^[0-9]+$$") \
116132
next; \
117-
if ($$7 in sections) { \
118-
if (sections[$$7] ~ "_wolfcrypt$$") \
119-
print $$8 "\t" sections[$$7] >>ENVIRON["SECTION_MAP"]; \
120-
} else \
121-
print $$8 " is in section " $$7 " with no name mapping." >"/dev/stderr";\
133+
if (($$4 == "NOTYPE") || ($$4 == "OBJECT") || ($$4 == "FUNC")) { \
134+
if (($$8 == "$$d") || ($$8 == "$$t")) \
135+
next; \
136+
if ($$7 in sections) { \
137+
if (sections[$$7] ~ "_wolfcrypt$$") \
138+
print $$8 "\t" sections[$$7] >>ENVIRON["SECTION_MAP"]; \
139+
} else \
140+
print $$8 " is in section " $$7 " with no name mapping." >"/dev/stderr";\
141+
} \
122142
} \
123143
}'
124144

@@ -272,7 +292,7 @@ ifeq "$(ENABLED_LINUXKM_PIE)" "yes"
272292
@SECTION_MAP=$$(mktemp)
273293
@trap 'rm "$$SECTION_MAP"' EXIT
274294
@export SECTION_MAP
275-
@$(READELF) --wide --symbols "$@" | $(GENERATE_SECTION_MAP)
295+
@$(READELF) --wide --sections --symbols "$@" | $(GENERATE_SECTION_MAP)
276296
@$(READELF) --wide --relocs "$@" | $(GENERATE_RELOC_TAB) >| '$(MODULE_TOP)/linuxkm/wc_linuxkm_pie_reloc_tab.c'
277297
+$(MAKE) ARCH='$(KERNEL_ARCH)' $(OVERRIDE_PATHS) $(CROSS_COMPILE) -C '$(KERNEL_ROOT)' M='$(MODULE_TOP)' $(KBUILD_EXTRA_FLAGS) CC_FLAGS_FTRACE=
278298
@$(READELF) --wide --relocs "$@" | $(GENERATE_RELOC_TAB) >| "$$RELOC_TMP"

linuxkm/include.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ EXTRA_DIST += m4/ax_linuxkm.m4 \
2424
linuxkm/patches/5.10.236/WOLFSSL_LINUXKM_HAVE_GET_RANDOM_CALLBACKS-5v10v236.patch \
2525
linuxkm/patches/5.15/WOLFSSL_LINUXKM_HAVE_GET_RANDOM_CALLBACKS-5v15.patch \
2626
linuxkm/patches/5.17/WOLFSSL_LINUXKM_HAVE_GET_RANDOM_CALLBACKS-5v17.patch \
27+
linuxkm/patches/5.17-ubuntu-jammy-tegra/WOLFSSL_LINUXKM_HAVE_GET_RANDOM_CALLBACKS-5v17-ubuntu-jammy-tegra.patch \
2728
linuxkm/patches/6.1.73/WOLFSSL_LINUXKM_HAVE_GET_RANDOM_CALLBACKS-6v1v73.patch \
2829
linuxkm/patches/6.12/WOLFSSL_LINUXKM_HAVE_GET_RANDOM_CALLBACKS-6v12.patch \
2930
linuxkm/patches/6.15/WOLFSSL_LINUXKM_HAVE_GET_RANDOM_CALLBACKS-6v15.patch

linuxkm/lkcapi_sha_glue.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,17 +1073,17 @@ static inline struct wc_rng_inst *get_drbg(struct crypto_rng *tfm) {
10731073
return NULL;
10741074
}
10751075

1076-
#if defined(CONFIG_SMP) && !defined(CONFIG_PREEMPT_COUNT) && \
1077-
(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0))
10781076
if (tfm == crypto_default_rng) {
1077+
#if defined(CONFIG_SMP) && (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0))
10791078
migrate_disable(); /* this actually makes irq_count() nonzero, so that
10801079
* DISABLE_VECTOR_REGISTERS() is superfluous, but
10811080
* don't depend on that.
10821081
*/
1082+
#endif
1083+
local_bh_disable();
10831084
new_lock_value = 2;
10841085
}
10851086
else
1086-
#endif
10871087
{
10881088
new_lock_value = 1;
10891089
}
@@ -1104,7 +1104,9 @@ static inline struct wc_rng_inst *get_drbg(struct crypto_rng *tfm) {
11041104
}
11051105

11061106
/* get_drbg_n() is used by bulk seed, mix-in, and reseed operations. It expects
1107-
* the caller to be able to wait until the requested DRBG is available.
1107+
* the caller to be able to wait until the requested DRBG is available. If the
1108+
* caller can't sleep and the requested DRBG is busy, it returns immediately --
1109+
* this avoids priority inversions and deadlocks.
11081110
*/
11091111
static inline struct wc_rng_inst *get_drbg_n(struct wc_linuxkm_drbg_ctx *ctx, int n) {
11101112
int can_sleep = (preempt_count() == 0);
@@ -1119,23 +1121,22 @@ static inline struct wc_rng_inst *get_drbg_n(struct wc_linuxkm_drbg_ctx *ctx, in
11191121
cond_resched();
11201122
}
11211123
else
1122-
cpu_relax();
1124+
return NULL;
11231125
}
11241126

11251127
__builtin_unreachable();
11261128
}
11271129

11281130
static inline void put_drbg(struct wc_rng_inst *drbg) {
1129-
#if defined(CONFIG_SMP) && !defined(CONFIG_PREEMPT_COUNT) && \
1130-
(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0))
11311131
int migration_disabled = (drbg->lock == 2);
1132-
#endif
11331132
__atomic_store_n(&(drbg->lock),0,__ATOMIC_RELEASE);
1134-
#if defined(CONFIG_SMP) && !defined(CONFIG_PREEMPT_COUNT) && \
1135-
(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0))
1136-
if (migration_disabled)
1133+
1134+
if (migration_disabled) {
1135+
local_bh_enable();
1136+
#if defined(CONFIG_SMP) && (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0))
11371137
migrate_enable();
1138-
#endif
1138+
#endif
1139+
}
11391140
}
11401141

11411142
static int wc_linuxkm_drbg_generate(struct crypto_rng *tfm,

0 commit comments

Comments
 (0)