Skip to content

Commit 42990f7

Browse files
authored
Merge branch 'master' into doc
2 parents 0c9a562 + 0aa789a commit 42990f7

41 files changed

Lines changed: 466 additions & 314 deletions

Some content is hidden

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

.github/workflows/hostap-vm.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ jobs:
232232
working-directory: hostap/tests/hwsim/auth_serv
233233
run: |
234234
./update.sh
235+
./sha512-generate.sh
235236
# Force regeneration of rsa3072-ca.key to get rsa3072-generate.sh to
236237
# correctly update all the certs
237238
rm rsa3072-ca.key
@@ -331,6 +332,10 @@ jobs:
331332
rm -r /tmp/hwsim-test-logs
332333
done < $GITHUB_WORKSPACE/wolfssl/.github/workflows/hostap-files/configs/${{ matrix.config.hostap_ref }}/tests
333334
335+
- name: show errors
336+
if: ${{ failure() && steps.testing.outcome == 'failure' }}
337+
run: grep -riP 'fail|error' /tmp/hwsim-test-logs/latest
338+
334339
# The logs are quite big. It hasn't been useful so far so let's not waste
335340
# precious gh space.
336341
#- name: zip logs

.wolfssl_known_macro_extras

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ CONFIG_ARCH_CHIP_STM32F746ZG
5252
CONFIG_ARCH_CHIP_STM32H743ZI
5353
CONFIG_ARCH_CHIP_STM32L552ZE
5454
CONFIG_ARCH_POSIX
55+
CONFIG_ARCH_TEGRA
5556
CONFIG_ARM
5657
CONFIG_ARM64
5758
CONFIG_BOARD_NATIVE_POSIX

bsdkm/wolfkmod.c

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ static int wolfkmod_init(void)
5252
ret = wolfCrypt_Init();
5353
if (ret != 0) {
5454
printf("error: wolfCrypt_Init failed: %s\n", wc_GetErrorString(ret));
55-
return -ECANCELED;
55+
return (ECANCELED);
5656
}
5757
#else
5858
ret = wolfSSL_Init();
5959
if (ret != WOLFSSL_SUCCESS) {
6060
printf("error: wolfSSL_Init failed: %s\n", wc_GetErrorString(ret));
61-
return -ECANCELED;
61+
return (ECANCELED);
6262
}
6363
#endif
6464

65-
return ret;
65+
return (0);
6666
}
6767

6868
static int wolfkmod_cleanup(void)
@@ -73,25 +73,21 @@ static int wolfkmod_cleanup(void)
7373
ret = wolfCrypt_Cleanup();
7474
if (ret != 0) {
7575
printf("error: wolfCrypt_Cleanup failed: %s\n", wc_GetErrorString(ret));
76-
}
77-
else {
78-
#if defined(WOLFSSL_BSDKM_VERBOSE_DEBUG)
79-
printf("info: wolfCrypt " LIBWOLFSSL_VERSION_STRING " cleanup complete.\n");
80-
#endif /* WOLFSSL_BSDKM_VERBOSE_DEBUG */
76+
return (ECANCELED);
8177
}
8278
#else
8379
ret = wolfSSL_Cleanup();
8480
if (ret != WOLFSSL_SUCCESS) {
8581
printf("error: wolfSSL_Cleanup failed: %s\n", wc_GetErrorString(ret));
82+
return (ECANCELED);
8683
}
87-
else {
88-
#if defined(WOLFSSL_BSDKM_VERBOSE_DEBUG)
89-
printf("info: wolfSSL " LIBWOLFSSL_VERSION_STRING " cleanup complete.\n");
90-
#endif /* WOLFSSL_BSDKM_VERBOSE_DEBUG */
91-
}
92-
#endif
84+
#endif /* WOLFCRYPT_ONLY */
9385

94-
return ret;
86+
#if defined(WOLFSSL_BSDKM_VERBOSE_DEBUG)
87+
printf("info: libwolfssl " LIBWOLFSSL_VERSION_STRING " cleanup complete.\n");
88+
#endif /* WOLFSSL_BSDKM_VERBOSE_DEBUG */
89+
90+
return (0);
9591
}
9692

9793
static int wolfkmod_load(void)
@@ -100,33 +96,29 @@ static int wolfkmod_load(void)
10096

10197
ret = wolfkmod_init();
10298
if (ret != 0) {
103-
return -ECANCELED;
99+
return (ECANCELED);
104100
}
105101

106102
#ifndef NO_CRYPT_TEST
107103
ret = wolfcrypt_test(NULL);
108104
if (ret != 0) {
109105
printf("error: wolfcrypt test failed with return code: %d\n", ret);
110106
(void)wolfkmod_cleanup();
111-
return -ECANCELED;
112-
}
113-
else {
114-
#if defined(WOLFSSL_BSDKM_VERBOSE_DEBUG)
115-
printf("wolfCrypt self-test passed.\n");
116-
#endif /* WOLFSSL_BSDKM_VERBOSE_DEBUG */
107+
return (ECANCELED);
117108
}
109+
#if defined(WOLFSSL_BSDKM_VERBOSE_DEBUG)
110+
printf("info: wolfCrypt self-test passed.\n");
111+
#endif /* WOLFSSL_BSDKM_VERBOSE_DEBUG */
118112
#endif /* NO_CRYPT_TEST */
119113

120114
/**
121115
* todo: register wolfcrypt algs here with crypto_get_driverid
122116
* and related.
123117
* */
124118

125-
if (ret == 0) {
126-
printf("info: libwolfssl loaded\n");
127-
}
119+
printf("info: libwolfssl loaded\n");
128120

129-
return ret;
121+
return (0);
130122
}
131123

132124
static int wolfkmod_unload(void)
@@ -144,7 +136,7 @@ static int wolfkmod_unload(void)
144136
printf("info: libwolfssl unloaded\n");
145137
}
146138

147-
return ret;
139+
return (ret);
148140
}
149141

150142
/* see /usr/include/sys/module.h for more info. */
@@ -172,7 +164,7 @@ wolfkmod_event(struct module * m, int what, void * arg)
172164
(void)m;
173165
(void)arg;
174166

175-
return ret;
167+
return (ret);
176168
}
177169

178170
static moduledata_t libwolfmod = {

doc/dox_comments/header_files/aes.h

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ int wc_AesInit(Aes* aes, void* heap, int devId);
10211021
10221022
\sa wc_AesInit
10231023
*/
1024-
int wc_AesFree(Aes* aes);
1024+
void wc_AesFree(Aes* aes);
10251025

10261026
/*!
10271027
\ingroup AES
@@ -1203,19 +1203,19 @@ int wc_AesSivDecrypt(const byte* key, word32 keySz, const byte* assoc,
12031203
\return other negative error values returned if AES or CMAC operations
12041204
fail.
12051205
1206-
\param key buffer containing the key to use
1207-
\param keySz length of the key buffer in bytes
1206+
\param [in] key buffer containing the key to use
1207+
\param [in] keySz length of the key buffer in bytes
12081208
\param[out] out buffer to hold the ciphertext. Should be the same length as
12091209
the plaintext buffer
1210-
\param in plaintext buffer to encrypt
1211-
\param inSz length of plaintext buffer
1212-
\param nonce the cryptographic nonce to use for EAX operations
1213-
\param nonceSz length of nonce buffer in bytes
1210+
\param [in] in plaintext buffer to encrypt
1211+
\param [in] inSz length of plaintext buffer
1212+
\param [in] nonce the cryptographic nonce to use for EAX operations
1213+
\param [in] nonceSz length of nonce buffer in bytes
12141214
\param[out] authTag pointer to the buffer in which to store the
12151215
authentication tag
1216-
\param authTagSz length of the desired authentication tag
1217-
\param authIn pointer to the buffer containing input data to authenticate
1218-
\param authInSz length of the input authentication data
1216+
\param [in] authTagSz length of the desired authentication tag
1217+
\param [in] authIn pointer to the buffer containing input data to authenticate
1218+
\param [in] authInSz length of the input authentication data
12191219
12201220
_Example_
12211221
\code
@@ -1266,19 +1266,19 @@ WOLFSSL_API int wc_AesEaxEncryptAuth(const byte* key, word32 keySz, byte* out,
12661266
\return other negative error values returned if AES or CMAC operations
12671267
fail.
12681268
1269-
\param key byte buffer containing the key to use
1270-
\param keySz length of the key buffer in bytes
1269+
\param [in] key byte buffer containing the key to use
1270+
\param [in] keySz length of the key buffer in bytes
12711271
\param[out] out buffer to hold the plaintext. Should be the same length as
12721272
the input ciphertext buffer
1273-
\param in ciphertext buffer to decrypt
1274-
\param inSz length of ciphertext buffer
1275-
\param nonce the cryptographic nonce to use for EAX operations
1276-
\param nonceSz length of nonce buffer in bytes
1277-
\param authTag buffer that holds the authentication tag to check the
1273+
\param [in] in ciphertext buffer to decrypt
1274+
\param [in] inSz length of ciphertext buffer
1275+
\param [in] nonce the cryptographic nonce to use for EAX operations
1276+
\param [in] nonceSz length of nonce buffer in bytes
1277+
\param [in] authTag buffer that holds the authentication tag to check the
12781278
authenticity of the data against
1279-
\param authTagSz Length of the input authentication tag
1280-
\param authIn pointer to the buffer containing input data to authenticate
1281-
\param authInSz length of the input authentication data
1279+
\param [in] authTagSz Length of the input authentication tag
1280+
\param [in] authIn pointer to the buffer containing input data to authenticate
1281+
\param [in] authInSz length of the input authentication data
12821282
12831283
_Example_
12841284
\code
@@ -1390,13 +1390,13 @@ WOLFSSL_API int wc_AesEaxInit(AesEax* eax,
13901390
\return 0 on success
13911391
\return error code on failure
13921392
1393-
\param eax AES EAX structure holding the context of the AEAD operation
1393+
\param [in] eax AES EAX structure holding the context of the AEAD operation
13941394
\param[out] out output buffer holding the ciphertext
1395-
\param in input buffer holding the plaintext to encrypt
1396-
\param inSz size in bytes of the input data buffer
1397-
\param authIn (optional) input data to add to the authentication stream
1395+
\param [in] in input buffer holding the plaintext to encrypt
1396+
\param [in] inSz size in bytes of the input data buffer
1397+
\param [in] authIn (optional) input data to add to the authentication stream
13981398
This argument should be NULL if not used
1399-
\param authInSz size in bytes of the input authentication data
1399+
\param [in] authInSz size in bytes of the input authentication data
14001400
14011401
_Example_
14021402
\code
@@ -1455,13 +1455,13 @@ WOLFSSL_API int wc_AesEaxEncryptUpdate(AesEax* eax, byte* out,
14551455
\return 0 on success
14561456
\return error code on failure
14571457
1458-
\param eax AES EAX structure holding the context of the AEAD operation
1458+
\param [in] eax AES EAX structure holding the context of the AEAD operation
14591459
\param[out] out output buffer holding the decrypted plaintext
1460-
\param in input buffer holding the ciphertext
1461-
\param inSz size in bytes of the input data buffer
1462-
\param authIn (optional) input data to add to the authentication stream
1460+
\param [in] in input buffer holding the ciphertext
1461+
\param [in] inSz size in bytes of the input data buffer
1462+
\param [in] authIn (optional) input data to add to the authentication stream
14631463
This argument should be NULL if not used
1464-
\param authInSz size in bytes of the input authentication data
1464+
\param [in] authInSz size in bytes of the input authentication data
14651465
14661466
14671467
_Example_
@@ -1742,13 +1742,13 @@ WOLFSSL_API int wc_AesEaxFree(AesEax* eax);
17421742
\return BAD_FUNC_ARG if input arguments are invalid.
17431743
\return other negative error codes for encryption failures.
17441744
1745-
\param key pointer to the AES key used for encryption.
1746-
\param keySz size of the AES key in bytes (16, 24, or 32 bytes).
1745+
\param [in] key pointer to the AES key used for encryption.
1746+
\param [in] keySz size of the AES key in bytes (16, 24, or 32 bytes).
17471747
\param[out] out buffer to hold the encrypted ciphertext. Must be at least
17481748
the size of the input.
1749-
\param in pointer to the plaintext input data to encrypt.
1750-
\param inSz size of the plaintext input data in bytes.
1751-
\param iv pointer to the initialization vector (IV) used for encryption.
1749+
\param [in] in pointer to the plaintext input data to encrypt.
1750+
\param [in] inSz size of the plaintext input data in bytes.
1751+
\param [in] iv pointer to the initialization vector (IV) used for encryption.
17521752
Must be 16 bytes.
17531753
17541754
_Example_
@@ -1780,13 +1780,13 @@ int wc_AesCtsEncrypt(const byte* key, word32 keySz, byte* out,
17801780
\return BAD_FUNC_ARG if input arguments are invalid.
17811781
\return other negative error codes for encryption failures.
17821782
1783-
\param key pointer to the AES key used for encryption.
1784-
\param keySz size of the AES key in bytes (16, 24, or 32 bytes).
1783+
\param [in] key pointer to the AES key used for encryption.
1784+
\param [in] keySz size of the AES key in bytes (16, 24, or 32 bytes).
17851785
\param[out] out buffer to hold the encrypted ciphertext. Must be at least
17861786
the same size as the input plaintext.
1787-
\param in pointer to the plaintext input data to encrypt.
1788-
\param inSz size of the plaintext input data in bytes.
1789-
\param iv pointer to the initialization vector (IV) used for encryption.
1787+
\param [in] in pointer to the plaintext input data to encrypt.
1788+
\param [in] inSz size of the plaintext input data in bytes.
1789+
\param [in] iv pointer to the initialization vector (IV) used for encryption.
17901790
Must be 16 bytes.
17911791
_Example_
17921792
\code
@@ -1813,13 +1813,13 @@ int wc_AesCtsEncrypt(const byte* key, word32 keySz, byte* out,
18131813
\return 0 on successful decryption.
18141814
\return BAD_FUNC_ARG if input arguments are invalid.
18151815
\return other negative error codes for decryption failures.
1816-
\param key pointer to the AES key used for decryption.
1817-
\param keySz size of the AES key in bytes (16, 24, or 32 bytes).
1816+
\param [in] key pointer to the AES key used for decryption.
1817+
\param [in] keySz size of the AES key in bytes (16, 24, or 32 bytes).
18181818
\param[out] out buffer to hold the decrypted plaintext. Must be at least
18191819
the same size as the input ciphertext.
1820-
\param in pointer to the ciphertext input data to decrypt.
1821-
\param inSz size of the ciphertext input data in bytes.
1822-
\param iv pointer to the initialization vector (IV) used for decryption.
1820+
\param [in] in pointer to the ciphertext input data to decrypt.
1821+
\param [in] inSz size of the ciphertext input data in bytes.
1822+
\param [in] iv pointer to the initialization vector (IV) used for decryption.
18231823
Must be 16 bytes.
18241824
_Example_
18251825
\code
@@ -1845,14 +1845,14 @@ int wc_AesCtsDecrypt(const byte* key, word32 keySz, byte* out,
18451845
It processes a chunk of plaintext and stores intermediate data.
18461846
\return 0 on successful processing.
18471847
\return BAD_FUNC_ARG if input arguments are invalid.
1848-
\param aes pointer to the Aes structure holding the context of the operation.
1848+
\param [in] aes pointer to the Aes structure holding the context of the operation.
18491849
\param[out] out buffer to hold the encrypted ciphertext. Must be large enough
18501850
to store the output from this update step.
18511851
\param[out] outSz size in bytes of the output data written to the \c out buffer.
1852-
On input, it should contain the maximum number of bytes that can
1853-
be written to the \c out buffer.
1854-
\param in pointer to the plaintext input data to encrypt.
1855-
\param inSz size of the plaintext input data in bytes.
1852+
On input, it should contain the maximum number of bytes that can
1853+
be written to the \c out buffer.
1854+
\param [in] in pointer to the plaintext input data to encrypt.
1855+
\param [in] inSz size of the plaintext input data in bytes.
18561856
_Example_
18571857
\code
18581858
Aes aes;
@@ -1880,7 +1880,7 @@ int wc_AesCtsEncryptUpdate(Aes* aes, byte* out, word32* outSz,
18801880
It processes any remaining plaintext and completes the encryption.
18811881
\return 0 on successful encryption completion.
18821882
\return BAD_FUNC_ARG if input arguments are invalid.
1883-
\param aes pointer to the Aes structure holding the context of the operation.
1883+
\param [in] aes pointer to the Aes structure holding the context of the operation.
18841884
\param[out] out buffer to hold the final encrypted ciphertext. Must be large
18851885
enough to store any remaining ciphertext from this final step.
18861886
\param[out] outSz size in bytes of the output data written to the \c out buffer.
@@ -1913,14 +1913,14 @@ int wc_AesCtsEncryptFinal(Aes* aes, byte* out, word32* outSz);
19131913
It processes a chunk of ciphertext and stores intermediate data.
19141914
\return 0 on successful processing.
19151915
\return BAD_FUNC_ARG if input arguments are invalid.
1916-
\param aes pointer to the Aes structure holding the context of the operation.
1916+
\param [in] aes pointer to the Aes structure holding the context of the operation.
19171917
\param[out] out buffer to hold the decrypted plaintext. Must be large enough
19181918
to store the output from this update step.
19191919
\param[out] outSz size in bytes of the output data written to the \c out buffer.
19201920
On input, it should contain the maximum number of bytes that can
19211921
be written to the \c out buffer.
1922-
\param in pointer to the ciphertext input data to decrypt.
1923-
\param inSz size of the ciphertext input data in bytes.
1922+
\param [in] in pointer to the ciphertext input data to decrypt.
1923+
\param [in] inSz size of the ciphertext input data in bytes.
19241924
_Example_
19251925
\code
19261926
Aes aes;
@@ -1948,7 +1948,7 @@ int wc_AesCtsDecryptUpdate(Aes* aes, byte* out, word32* outSz,
19481948
It processes any remaining ciphertext and completes the decryption.
19491949
\return 0 on successful decryption completion.
19501950
\return BAD_FUNC_ARG if input arguments are invalid.
1951-
\param aes pointer to the Aes structure holding the context of the operation.
1951+
\param [in] aes pointer to the Aes structure holding the context of the operation.
19521952
\param[out] out buffer to hold the final decrypted plaintext. Must be large
19531953
enough to store any remaining plaintext from this final step.
19541954
\param[out] outSz size in bytes of the output data written to the \c out buffer.

doc/dox_comments/header_files/asn_public.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
\sa wc_MakeCert
2020
\sa wc_MakeCertReq
2121
*/
22-
int wc_InitCert(Cert*);
22+
int wc_InitCert(Cert* cert);
2323

2424
/*!
2525
\ingroup ASN
@@ -2524,4 +2524,3 @@ int wc_Asn1_SetFile(Asn1* asn1, XFILE file);
25242524
*/
25252525
int wc_Asn1_PrintAll(Asn1* asn1, Asn1PrintOptions* opts, unsigned char* data,
25262526
word32 len);
2527-

0 commit comments

Comments
 (0)