Skip to content
Open
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
8 changes: 8 additions & 0 deletions .github/workflows/no-malloc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: No Malloc Tests

# START OF COMMON SECTION
Expand Down Expand Up @@ -74,6 +74,14 @@
"--enable-curve448", "--enable-mlkem", "--enable-staticmemory",
"CFLAGS=-DWOLFSSL_NO_MALLOC -pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE"],
"check": false,
"run": [["./wolfcrypt/test/testwolfcrypt"]]},
{"name": "tps-staticmemory", "minutes": 0.8,
"configure": ["--enable-ecc", "--enable-rsa", "--enable-keygen",
"--enable-ed25519", "--enable-curve25519", "--enable-ed448",
"--enable-curve448", "--enable-mlkem", "--enable-tsp",
"--enable-staticmemory",
"CFLAGS=-DWOLFSSL_NO_MALLOC -pedantic -Wdeclaration-after-statement -Wnull-dereference -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE"],
"check": false,
"run": [["./wolfcrypt/test/testwolfcrypt"]]}
]
EOF
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/os-check.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: Ubuntu-Macos-Windows Tests

# START OF COMMON SECTION
Expand Down Expand Up @@ -306,6 +306,37 @@
{"name": "pkcs7", "minutes": 1.3,
"comment": "PKCS#7 without RSA-PSS",
"configure": ["--enable-pkcs7"]},
{"name": "tsp", "minutes": 1.3,
"comment": "Time-Stamp Protocol",
"configure": ["--enable-tsp"]},
{"name": "tsp-openssl", "minutes": 1.3,
"comment": "Time-Stamp Protocol with OpenSSL compat",
"configure": ["--enable-tsp", "--enable-opensslall"]},
{"name": "tsp-no-ecc", "minutes": 1.3,
"comment": "Time-Stamp Protocol without ECC",
"configure": ["--enable-tsp", "--disable-ecc"]},
{"name": "tsp-no-rsa", "minutes": 1.3,
"comment": "Time-Stamp Protocol without RSA",
"configure": ["--enable-tsp", "--disable-rsa"]},
{"name": "tsp-smallstack", "minutes": 1.3,
"comment": "Time-Stamp Protocol Small Stack",
"configure": ["--enable-tsp", "CPPFLAGS=-DWOLFSSL_SMALL_STACK"]},
{"name": "tsp-min-hash-str", "minutes": 1.3,
"comment": "Time-Stamp Protocol Minimum 128-bit hash strength",
"configure": ["--enable-tsp",
"CPPFLAGS=-DWC_TSP_MIN_HASH_STRENGTH_BITS=128"]},
{"name": "tsp-requester", "minutes": 1.3,
"comment": "Time-Stamp Protocol Requester",
"configure": ["--enable-tsp", "--enable-opensslall",
"CPPFLAGS=-DWOLFSSL_TSP_REQUESTER"]},
{"name": "tsp-responder", "minutes": 1.3,
"comment": "Time-Stamp Protocol Responder",
"configure": ["--enable-tsp", "--enable-opensslall",
"CPPFLAGS=-DWOLFSSL_TSP_RESPONDER"]},
{"name": "tsp-verifier", "minutes": 1.3,
"comment": "Time-Stamp Protocol Verifier",
"configure": ["--enable-tsp", "--enable-opensslall",
"CPPFLAGS=-DWOLFSSL_TSP_VERIFIER"]},
{"name": "no-tls-cryptocb-aesgcm-setkey-free", "minutes": 1.3,
"configure": ["--disable-tls", "--enable-cryptocb", "--enable-aesgcm",
"CPPFLAGS=-DWOLF_CRYPTO_CB_AES_SETKEY -DWOLF_CRYPTO_CB_FREE"]},
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ examples/sctp/sctp-client-dtls
examples/asn1/asn1
examples/pem/pem
examples/ocsp_responder/ocsp_responder
examples/tsp/tsp_query
examples/tsp/tsp_reply
examples/tsp/tsp_verify
server_ready
snifftest
output
Expand Down
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2021,6 +2021,9 @@ endif()
set(WOLFSSL_PKCS7_HELP_STRING "Enable PKCS7 (default: disabled)")
add_option(WOLFSSL_PKCS7 ${WOLFSSL_PKCS7_HELP_STRING} "no" "yes;no")

set(WOLFSSL_TSP_HELP_STRING "Enable RFC 3161 Time-Stamp Protocol (default: disabled)")
add_option(WOLFSSL_TSP ${WOLFSSL_TSP_HELP_STRING} "no" "yes;no")

set(WOLFSSL_TPM_HELP_STRING "Enable wolfTPM options (default: disabled)")
add_option(WOLFSSL_TPM ${WOLFSSL_TPM_HELP_STRING} "no" "yes;no")

Expand Down Expand Up @@ -2412,6 +2415,12 @@ if(WOLFSSL_AESCFB)
endif()


if(WOLFSSL_TSP)
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_TSP")
# Requires PKCS7 for time-stamp token creation and verification
override_cache(WOLFSSL_PKCS7 "yes")
endif()

if(WOLFSSL_PKCS7)
list(APPEND WOLFSSL_DEFINITIONS "-DHAVE_PKCS7")
override_cache(WOLFSSL_AESKEYWRAP "yes")
Expand Down Expand Up @@ -2965,6 +2974,8 @@ if(WOLFSSL_EXAMPLES)
tests/api/test_asn.c
tests/api/test_pkcs7.c
tests/api/test_pkcs12.c
tests/api/test_tsp.c
tests/api/test_ossl_tsp.c
tests/api/test_pwdbased.c
tests/api/test_ossl_asn1.c
tests/api/test_ossl_bio.c
Expand Down
1 change: 1 addition & 0 deletions IDE/INTIME-RTOS/libwolfssl.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<ClCompile Include="..\..\wolfcrypt\src\sp_x86_64.c" />
<ClCompile Include="..\..\wolfcrypt\src\srp.c" />
<ClCompile Include="..\..\wolfcrypt\src\tfm.c" />
<ClCompile Include="..\..\wolfcrypt\src\tsp.c" />
<ClCompile Include="..\..\wolfcrypt\src\wc_encrypt.c" />
<ClCompile Include="..\..\wolfcrypt\src\wc_port.c" />
<ClCompile Include="..\..\wolfcrypt\src\wolfevent.c" />
Expand Down
1 change: 1 addition & 0 deletions IDE/INTIME-RTOS/wolfssl-lib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
<ClCompile Include="..\..\wolfcrypt\src\signature.c" />
<ClCompile Include="..\..\wolfcrypt\src\srp.c" />
<ClCompile Include="..\..\wolfcrypt\src\tfm.c" />
<ClCompile Include="..\..\wolfcrypt\src\tsp.c" />
<ClCompile Include="..\..\wolfcrypt\src\wc_encrypt.c" />
<ClCompile Include="..\..\wolfcrypt\src\wc_port.c" />
<ClCompile Include="..\..\wolfcrypt\src\wc_slhdsa.c" />
Expand Down
1 change: 1 addition & 0 deletions IDE/WIN10/wolfssl-fips.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@
<ClCompile Include="..\..\wolfcrypt\src\integer.c" />
<ClCompile Include="..\..\wolfcrypt\src\pkcs7.c" />
<ClCompile Include="..\..\wolfcrypt\src\tfm.c" />
<ClCompile Include="..\..\wolfcrypt\src\tsp.c" />
<ClCompile Include="..\..\src\internal.c" />
<ClCompile Include="..\..\src\wolfio.c" />
<ClCompile Include="..\..\wolfcrypt\src\kdf.c" />
Expand Down
16 changes: 16 additions & 0 deletions certs/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ EXTRA_DIST += \
certs/client-ca-cert.pem \
certs/dh2048.pem \
certs/server-cert.pem \
certs/tsa-bad-ku-cert.pem \
certs/tsa-extra-eku-cert.pem \
certs/tsa-chain-cert.pem \
certs/tsa-chain-key.pem \
certs/tsa-cert.pem \
certs/tsa-ecc-cert.pem \
certs/tsa-ecc-key.pem \
certs/tsa-key.pem \
certs/server-ecc.pem \
certs/server-ecc-self.pem \
certs/server-ecc-comp.pem \
Expand Down Expand Up @@ -119,6 +127,14 @@ EXTRA_DIST += \
certs/ecc-keyPub.der \
certs/server-key.der \
certs/server-cert.der \
certs/tsa-key.der \
certs/tsa-cert.der \
certs/tsa-ecc-key.der \
certs/tsa-ecc-cert.der \
certs/tsa-bad-ku-cert.der \
certs/tsa-extra-eku-cert.der \
certs/tsa-chain-cert.der \
certs/tsa-chain-key.der \
certs/server-ecc-comp.der \
certs/server-ecc.der \
certs/server-ecc-self.der \
Expand Down
116 changes: 116 additions & 0 deletions certs/renewcerts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@
# aia/multi-aia-cert.pem
# aia/overflow-aia-cert.pem
# sia/timestamping-sia-cert.pem
# tsa-cert.pem
# tsa-cert.der
# tsa-ecc-cert.pem
# tsa-ecc-cert.der
# tsa-bad-ku-cert.pem
# tsa-bad-ku-cert.der
# tsa-extra-eku-cert.pem
# tsa-extra-eku-cert.der
# tsa-chain-cert.pem
# tsa-chain-cert.der
# updates the following crls:
# crl/cliCrl.pem
# crl/crl.pem
Expand Down Expand Up @@ -216,6 +226,112 @@ run_renewcerts(){
echo "End of section"
echo "---------------------------------------------------------------------"

############################################################
######## update the self-signed (2048-bit) tsa-cert.pem ###
############################################################
echo "Updating 2048-bit tsa-cert.pem"
echo ""
openssl req -new -key tsa-key.pem -config ./renewcerts/wolfssl.cnf -nodes -subj "/C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=TSA-2048/CN=www.wolfssl.com/emailAddress=info@wolfssl.com" -out tsa-cert.csr
check_result $? "Step 1"

openssl x509 -req -in tsa-cert.csr -days 1000 -extfile ./renewcerts/wolfssl.cnf -extensions tsa_cert -signkey tsa-key.pem -out tsa-cert.pem
check_result $? "Step 2"
rm tsa-cert.csr

openssl x509 -in tsa-cert.pem -text > tmp.pem
check_result $? "Step 3"
mv tmp.pem tsa-cert.pem

openssl x509 -in tsa-cert.pem -outform der -out tsa-cert.der
check_result $? "Step 4"
echo "End of section"
echo "---------------------------------------------------------------------"

############################################################
## update the intermediate-issued tsa-chain-cert.pem ######
############################################################
echo "Updating 2048-bit tsa-chain-cert.pem"
echo ""
openssl req -new -key tsa-chain-key.pem -config ./renewcerts/wolfssl.cnf -nodes -subj "/C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=TSA-chain-2048/CN=www.wolfssl.com/emailAddress=info@wolfssl.com" -out tsa-chain-cert.csr
check_result $? "Step 1"

openssl x509 -req -in tsa-chain-cert.csr -days 1000 -extfile ./renewcerts/wolfssl.cnf -extensions tsa_cert -CA intermediate/ca-int-cert.pem -CAkey intermediate/ca-int-key.pem -CAcreateserial -out tsa-chain-cert.pem
check_result $? "Step 2"
rm tsa-chain-cert.csr
rm -f intermediate/ca-int-cert.srl

openssl x509 -in tsa-chain-cert.pem -text > tmp.pem
check_result $? "Step 3"
mv tmp.pem tsa-chain-cert.pem

openssl x509 -in tsa-chain-cert.pem -outform der -out tsa-chain-cert.der
check_result $? "Step 4"
echo "End of section"
echo "---------------------------------------------------------------------"

############################################################
########## update the self-signed tsa-ecc-cert.pem ########
############################################################
echo "Updating tsa-ecc-cert.pem"
echo ""
openssl req -new -key tsa-ecc-key.pem -config ./renewcerts/wolfssl.cnf -nodes -subj "/C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=TSA-ECC/CN=www.wolfssl.com/emailAddress=info@wolfssl.com" -out tsa-ecc-cert.csr
check_result $? "Step 1"

openssl x509 -req -in tsa-ecc-cert.csr -days 1000 -extfile ./renewcerts/wolfssl.cnf -extensions tsa_cert -signkey tsa-ecc-key.pem -out tsa-ecc-cert.pem
check_result $? "Step 2"
rm tsa-ecc-cert.csr

openssl x509 -in tsa-ecc-cert.pem -text > tmp.pem
check_result $? "Step 3"
mv tmp.pem tsa-ecc-cert.pem

openssl x509 -in tsa-ecc-cert.pem -outform der -out tsa-ecc-cert.der
check_result $? "Step 4"
echo "End of section"
echo "---------------------------------------------------------------------"

############################################################
## update the self-signed (2048-bit) tsa-bad-ku-cert.pem ##
############################################################
echo "Updating 2048-bit tsa-bad-ku-cert.pem"
echo ""
openssl req -new -key tsa-key.pem -config ./renewcerts/wolfssl.cnf -nodes -subj "/C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=TSA-bad-ku-2048/CN=www.wolfssl.com/emailAddress=info@wolfssl.com" -out tsa-bad-ku-cert.csr
check_result $? "Step 1"

openssl x509 -req -in tsa-bad-ku-cert.csr -days 1000 -extfile ./renewcerts/wolfssl.cnf -extensions tsa_bad_ku_cert -signkey tsa-key.pem -out tsa-bad-ku-cert.pem
check_result $? "Step 2"
rm tsa-bad-ku-cert.csr

openssl x509 -in tsa-bad-ku-cert.pem -text > tmp.pem
check_result $? "Step 3"
mv tmp.pem tsa-bad-ku-cert.pem

openssl x509 -in tsa-bad-ku-cert.pem -outform der -out tsa-bad-ku-cert.der
check_result $? "Step 4"
echo "End of section"
echo "---------------------------------------------------------------------"

###############################################################
## update the self-signed (2048-bit) tsa-extra-eku-cert.pem ##
###############################################################
echo "Updating 2048-bit tsa-extra-eku-cert.pem"
echo ""
openssl req -new -key tsa-key.pem -config ./renewcerts/wolfssl.cnf -nodes -subj "/C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=TSA-extra-eku-2048/CN=www.wolfssl.com/emailAddress=info@wolfssl.com" -out tsa-extra-eku-cert.csr
check_result $? "Step 1"

openssl x509 -req -in tsa-extra-eku-cert.csr -days 1000 -extfile ./renewcerts/wolfssl.cnf -extensions tsa_extra_eku_cert -signkey tsa-key.pem -out tsa-extra-eku-cert.pem
check_result $? "Step 2"
rm tsa-extra-eku-cert.csr

openssl x509 -in tsa-extra-eku-cert.pem -text > tmp.pem
check_result $? "Step 3"
mv tmp.pem tsa-extra-eku-cert.pem

openssl x509 -in tsa-extra-eku-cert.pem -outform der -out tsa-extra-eku-cert.der
check_result $? "Step 4"
echo "End of section"
echo "---------------------------------------------------------------------"

############################################################
#### update the self-signed (1024-bit) client-cert.pem #####
############################################################
Expand Down
27 changes: 27 additions & 0 deletions certs/renewcerts/wolfssl.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -452,3 +452,30 @@ DNS.1 = www.example.org
URI.1 = https://www.wolfssl.com/
otherName.2 = 2.16.840.1.101.3.6.6;FORMAT:HEX,OCT:D1:38:10:D8:28:AF:2C:10:84:35:15:A1:68:58:28:AF:02:10:86:A2:84:E7:39:C3:EB


# TSA certificate extensions - RFC 3161 time-stamping only
[ tsa_cert ]
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer:always
basicConstraints = CA:false
subjectAltName = DNS:tsa.wolfssl.com
keyUsage = critical, digitalSignature
extendedKeyUsage = critical, timeStamping

# TSA certificate extensions with wrong key usage - for failure testing
[ tsa_bad_ku_cert ]
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer:always
basicConstraints = CA:false
keyUsage = critical, keyEncipherment
extendedKeyUsage = critical, timeStamping

# TSA certificate extensions with an extra (non-timeStamping) extended key
# usage - for failure testing. The extra purpose is an unrecognized OID so the
# time-stamping bit is still the only one set; rejection relies on the count.
[ tsa_extra_eku_cert ]
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer:always
basicConstraints = CA:false
keyUsage = critical, digitalSignature
extendedKeyUsage = critical, timeStamping, 1.3.6.1.4.1.99999.1
Binary file added certs/tsa-bad-ku-cert.der
Binary file not shown.
Loading
Loading