From 8719b888ebddd51908007e52b1d50ec9198f9680 Mon Sep 17 00:00:00 2001 From: abrahamsonn Date: Thu, 6 Sep 2018 13:02:30 -0600 Subject: [PATCH 01/12] Added some files to the .gitignore Specifically, added doc/doxygen_warnings doc/html doc/pdf --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 78276af57..2119a329d 100644 --- a/.gitignore +++ b/.gitignore @@ -248,3 +248,8 @@ wolfcrypt/src/port/intel/qat_test # Arduino Generated Files /IDE/ARDUINO/wolfSSL scripts/memtest.txt + +# Doxygen generated files +doc/doxygen_warnings +doc/html +doc/pdf From 6981d48a4d4fdc667d5260c178188ca1e20e4c8f Mon Sep 17 00:00:00 2001 From: abrahamsonn Date: Thu, 6 Sep 2018 14:54:13 -0600 Subject: [PATCH 02/12] Made some general Doxygen fixes --- doc/dox_comments/header_files/doxygen_pages.h | 77 ++++++++++--------- doc/formats/html/header.html | 2 + doc/formats/html/mainpage.dox | 6 +- 3 files changed, 45 insertions(+), 40 deletions(-) diff --git a/doc/dox_comments/header_files/doxygen_pages.h b/doc/dox_comments/header_files/doxygen_pages.h index e6c4a2c9e..71894aec0 100644 --- a/doc/dox_comments/header_files/doxygen_pages.h +++ b/doc/dox_comments/header_files/doxygen_pages.h @@ -12,41 +12,44 @@ */ /*! \page wolfcrypt_API wolfCrypt API Reference - - \ref ASN - - \ref Base_Encoding - - \ref Compression - - \ref Error - - \ref Keys - - \ref Logging - - \ref Math - - \ref Random - - \ref Signature - - \ref wolfCrypt - - - \ref DES - - \ref AES - - \ref ARC4 - - \ref BLAKE2 - - \ref Camellia - - \ref ChaCha - - \ref ChaCha20Poly1305 - - \ref Curve25519 - - \ref DSA - - \ref Diffie-Hellman - - \ref ECC - - \ref ED25519 - - \ref HC128 - - \ref HMAC - - \ref IDEA - - \ref MD2 - - \ref MD4 - - \ref MD5 - - \ref Password - - \ref PKCS7 - - \ref Poly1305 - - \ref Rabbit - - \ref RIPEMD - - \ref RSA - - \ref SHA - - \ref SRP + + */ diff --git a/doc/formats/html/header.html b/doc/formats/html/header.html index 693f31d79..ce59bb90c 100644 --- a/doc/formats/html/header.html +++ b/doc/formats/html/header.html @@ -5,6 +5,7 @@ + $projectname: $title $title @@ -15,6 +16,7 @@ $search $mathjax $extrastylesheet +
diff --git a/doc/formats/html/mainpage.dox b/doc/formats/html/mainpage.dox index a34554192..47ec3459d 100644 --- a/doc/formats/html/mainpage.dox +++ b/doc/formats/html/mainpage.dox @@ -7,9 +7,9 @@ \section apiRef API Reference - Complete API Reference
- wolfSSL Data Structures
- Useful guides/documentation
+ Complete API Reference
+ wolfSSL Data Structures
+ Useful guides/documentation

From 6876b7d98ea03b704fff55db1b5bf11a18250129 Mon Sep 17 00:00:00 2001 From: abrahamsonn Date: Tue, 11 Sep 2018 13:35:49 -0600 Subject: [PATCH 03/12] Removed comment from HTML header --- doc/formats/html/header.html | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/formats/html/header.html b/doc/formats/html/header.html index ce59bb90c..e6bba6932 100644 --- a/doc/formats/html/header.html +++ b/doc/formats/html/header.html @@ -16,7 +16,6 @@ $search $mathjax $extrastylesheet -
From 8aae8ceb2a9d4777fef9ea6fd2e15c830180916b Mon Sep 17 00:00:00 2001 From: abrahamsonn Date: Wed, 12 Sep 2018 10:16:45 -0600 Subject: [PATCH 04/12] Changed mobile viewport scale --- doc/formats/html/header.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/formats/html/header.html b/doc/formats/html/header.html index e6bba6932..171abf524 100644 --- a/doc/formats/html/header.html +++ b/doc/formats/html/header.html @@ -5,7 +5,7 @@ - + $projectname: $title $title From e809fc2d5d7df0ed0171a6f70a762e0980c1cad0 Mon Sep 17 00:00:00 2001 From: abrahamsonn Date: Wed, 12 Sep 2018 16:45:18 -0600 Subject: [PATCH 05/12] Updated some of the links on the Doxygen page --- doc/formats/html/mainpage.dox | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/formats/html/mainpage.dox b/doc/formats/html/mainpage.dox index 47ec3459d..c7ab7abee 100644 --- a/doc/formats/html/mainpage.dox +++ b/doc/formats/html/mainpage.dox @@ -5,17 +5,17 @@ \mainpage This Documentation Covers %wolfSSL, %wolfCrypt, and %CertManager API \section apiRef API Reference - - - Complete API Reference
- wolfSSL Data Structures
- Useful guides/documentation
+ Complete API Reference
+ wolfSSL SSL/TLS API Reference
+ wolfCrypt Encryption API Reference
+ wolfSSL Data Structures
+ Useful guides/documentation

\subsection website Useful Links - https://wolfssl.com/wolfSSL/Home.html - Main website
- https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-17-wolfssl-api-reference.html - %wolfSSL Manual
+ https://www.wolfssl.com/wolfSSL/Home.html - Main website
+ https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-17-wolfssl-api-reference.html - %wolfSSL Manual
https://www.wolfssl.com/docs/wolfssl-manual/ch18/ - wolfCrypt Manual
https://github.com/wolfssl/wolfssl.git - Git repository */ From 4f95ba0f6904f15d8dcb5ca81da965f66e1c7ea8 Mon Sep 17 00:00:00 2001 From: abrahamsonn Date: Wed, 12 Sep 2018 16:51:45 -0600 Subject: [PATCH 06/12] Where did a bunch of those links even come from? --- doc/formats/html/mainpage.dox | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/formats/html/mainpage.dox b/doc/formats/html/mainpage.dox index c7ab7abee..22539b19d 100644 --- a/doc/formats/html/mainpage.dox +++ b/doc/formats/html/mainpage.dox @@ -14,8 +14,8 @@
\subsection website Useful Links - https://www.wolfssl.com/wolfSSL/Home.html - Main website
- https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-17-wolfssl-api-reference.html - %wolfSSL Manual
- https://www.wolfssl.com/docs/wolfssl-manual/ch18/ - wolfCrypt Manual
+ https://www.wolfssl.com/ - Main website
+ https://www.wolfssl.com/docs/wolfssl-manual/ - %wolfSSL Manual
+ https://www.wolfssl.com/docs/wolfssl-manual/ch10/ - wolfCrypt Usage Reference
https://github.com/wolfssl/wolfssl.git - Git repository */ From 1c25fc801ea9ffe2350ab48054e4a43a4036dcea Mon Sep 17 00:00:00 2001 From: abrahamsonn Date: Wed, 12 Sep 2018 16:58:32 -0600 Subject: [PATCH 07/12] Changed up some words --- doc/formats/html/mainpage.dox | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/formats/html/mainpage.dox b/doc/formats/html/mainpage.dox index 22539b19d..82151eed8 100644 --- a/doc/formats/html/mainpage.dox +++ b/doc/formats/html/mainpage.dox @@ -6,8 +6,8 @@ \section apiRef API Reference Complete API Reference
- wolfSSL SSL/TLS API Reference
- wolfCrypt Encryption API Reference
+ wolfSSL API Reference
+ wolfCrypt API Reference
wolfSSL Data Structures
Useful guides/documentation
From c4919d191b16acbc420549e1fa57bdb5ecf7b673 Mon Sep 17 00:00:00 2001 From: abrahamsonn Date: Wed, 28 Nov 2018 13:36:00 -0700 Subject: [PATCH 08/12] Added doxygen comment page The new doxygen comment page (pkcs11.h) lets Doxygen know when running that there are new API and that they will need a page created. --- doc/dox_comments/header_files/pkcs11.h | 43 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 doc/dox_comments/header_files/pkcs11.h diff --git a/doc/dox_comments/header_files/pkcs11.h b/doc/dox_comments/header_files/pkcs11.h new file mode 100644 index 000000000..784b13217 --- /dev/null +++ b/doc/dox_comments/header_files/pkcs11.h @@ -0,0 +1,43 @@ +/*! + \ingroup PKCS11 +*/ +WOLFSSL_API int wc_Pkcs11_Initialize(Pkcs11Dev* dev, const char* library, + void* heap); + +/*! + \ingroup PKCS11 +*/ +WOLFSSL_API void wc_Pkcs11_Finalize(Pkcs11Dev* dev); + +/*! + \ingroup PKCS11 +*/ +WOLFSSL_API int wc_Pkcs11Token_Init(Pkcs11Token* token, Pkcs11Dev* dev, + int slotId, const char* tokenName, const unsigned char *userPin, + int userPinSz); + +/*! + \ingroup PKCS11 +*/ +WOLFSSL_API void wc_Pkcs11Token_Final(Pkcs11Token* token); + +/*! + \ingroup PKCS11 + */ +WOLFSSL_API int wc_Pkcs11Token_Open(Pkcs11Token* token, int readWrite); + +/*! + \ingroup PKCS11 + */ +WOLFSSL_API void wc_Pkcs11Token_Close(Pkcs11Token* token); + +/*! + \ingroup PKCS11 + */ +WOLFSSL_API int wc_Pkcs11StoreKey(Pkcs11Token* token, int type, int clear, + +/*! + \ingroup PKCS11 + */ +WOLFSSL_API int wc_Pkcs11_CryptoDevCb(int devId, wc_CryptoInfo* info, + void* ctx); From 424196cb0365394253ca0515b465aeac5018bf8e Mon Sep 17 00:00:00 2001 From: abrahamsonn Date: Wed, 28 Nov 2018 13:45:19 -0700 Subject: [PATCH 09/12] Doxygen format updates Updated the doxygen page list to include PKCS#11, and create the PKCS#11 page --- doc/dox_comments/header_files/doxygen_groups.h | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/dox_comments/header_files/doxygen_groups.h b/doc/dox_comments/header_files/doxygen_groups.h index e5a4975cf..86e225298 100644 --- a/doc/dox_comments/header_files/doxygen_groups.h +++ b/doc/dox_comments/header_files/doxygen_groups.h @@ -18,6 +18,7 @@ \defgroup MD4 Algorithms - MD4 \defgroup MD5 Algorithms - MD5 \defgroup PKCS7 Algorithms - PKCS7 + \defgroup PKCS11 Algorithms - PKCS11 \defgroup Password Algorithms - Password Based \defgroup Poly1305 Algorithms - Poly1305 \defgroup RIPEMD Algorithms - RIPEMD From a3d1ea20ffb4c5a6de9deae934b57bedd06ca290 Mon Sep 17 00:00:00 2001 From: abrahamsonn Date: Wed, 28 Nov 2018 14:49:42 -0700 Subject: [PATCH 10/12] updated page list to include PKCS#11 page --- doc/dox_comments/header_files/doxygen_pages.h | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/dox_comments/header_files/doxygen_pages.h b/doc/dox_comments/header_files/doxygen_pages.h index 71894aec0..741b396bf 100644 --- a/doc/dox_comments/header_files/doxygen_pages.h +++ b/doc/dox_comments/header_files/doxygen_pages.h @@ -45,6 +45,7 @@
  • \ref MD5
  • \ref Password
  • \ref PKCS7
  • +
  • \ref PKCS11
  • \ref Poly1305
  • \ref Rabbit
  • \ref RIPEMD
  • From 95c6c0df28693b201183f5f59d4b533847071417 Mon Sep 17 00:00:00 2001 From: abrahamsonn Date: Wed, 28 Nov 2018 15:03:01 -0700 Subject: [PATCH 11/12] Updated doxygen with some more API Added new DH API function signatures/some descriptions --- doc/dox_comments/header_files/dh.h | 127 +++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/doc/dox_comments/header_files/dh.h b/doc/dox_comments/header_files/dh.h index d38d37af9..ba29346d4 100644 --- a/doc/dox_comments/header_files/dh.h +++ b/doc/dox_comments/header_files/dh.h @@ -271,3 +271,130 @@ WOLFSSL_API int wc_DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g */ WOLFSSL_API int wc_DhParamsLoad(const byte* input, word32 inSz, byte* p, word32* pInOutSz, byte* g, word32* gInOutSz); + +/*! + \ingroup Diffie-Hellman + + \brief This function returns ... and requires that HAVE_FFDHE_2048 be + defined. + + \sa wc_Dh_ffdhe3072_Get + \sa wc_Dh_ffdhe4096_Get + \sa wc_Dh_ffdhe6144_Get + \sa wc_Dh_ffdhe8192_Get +*/ +WOLFSSL_API const DhParams* wc_Dh_ffdhe2048_Get(void); + +/*! + \ingroup Diffie-Hellman + + \brief This function returns ... and requires that HAVE_FFDHE_3072 be + defined. + + \sa wc_Dh_ffdhe2048_Get + \sa wc_Dh_ffdhe4096_Get + \sa wc_Dh_ffdhe6144_Get + \sa wc_Dh_ffdhe8192_Get +*/ +WOLFSSL_API const DhParams* wc_Dh_ffdhe3072_Get(void); + +/*! + \ingroup Diffie-Hellman + + \brief This function returns ... and requires that HAVE_FFDHE_4096 be + defined. + + \sa wc_Dh_ffdhe2048_Get + \sa wc_Dh_ffdhe3072_Get + \sa wc_Dh_ffdhe6144_Get + \sa wc_Dh_ffdhe8192_Get +*/ +WOLFSSL_API const DhParams* wc_Dh_ffdhe4096_Get(void); + +/*! + \ingroup Diffie-Hellman + + \brief This function returns ... and requires that HAVE_FFDHE_6144 be + defined. + + \sa wc_Dh_ffdhe2048_Get + \sa wc_Dh_ffdhe3072_Get + \sa wc_Dh_ffdhe4096_Get + \sa wc_Dh_ffdhe8192_Get +*/ +WOLFSSL_API const DhParams* wc_Dh_ffdhe6144_Get(void); + +/*! + \ingroup Diffie-Hellman + + \brief This function returns ... and requires that HAVE_FFDHE_8192 be + defined. + + \sa wc_Dh_ffdhe2048_Get + \sa wc_Dh_ffdhe3072_Get + \sa wc_Dh_ffdhe4096_Get + \sa wc_Dh_ffdhe6144_Get +*/ +WOLFSSL_API const DhParams* wc_Dh_ffdhe8192_Get(void); + +/*! + \ingroup Diffie-Hellman + + \brief Checks DH keys for pair-wise consistency per process in SP 800-56Ar3, + section 5.6.2.1.4, method (b) for FFC. +*/ +WOLFSSL_API int wc_DhCheckKeyPair(DhKey* key, const byte* pub, word32 pubSz, + const byte* priv, word32 privSz); + +/*! + \ingroup Diffie-Hellman + + \brief Check DH private key for invalid numbers +*/ +WOLFSSL_API int wc_DhCheckPrivKey(DhKey* key, const byte* priv, word32 pubSz); + +/*! + \ingroup Diffie-Hellman +*/ +WOLFSSL_API int wc_DhCheckPrivKey_ex(DhKey* key, const byte* priv, word32 pubSz, + const byte* prime, word32 primeSz); + +/*! + \ingroup Diffie-Hellman +*/ +WOLFSSL_API int wc_DhCheckPubKey(DhKey* key, const byte* pub, word32 pubSz); + +/*! + \ingroup Diffie-Hellman +*/ +WOLFSSL_API int wc_DhCheckPubKey_ex(DhKey* key, const byte* pub, word32 pubSz, + const byte* prime, word32 primeSz); + +/*! + \ingroup Diffie-Hellman +*/ +WOLFSSL_API int wc_DhExportParamsRaw(DhKey* dh, byte* p, word32* pSz, + byte* q, word32* qSz, byte* g, word32* gSz); + +/*! + \ingroup Diffie-Hellman +*/ +WOLFSSL_API int wc_DhGenerateParams(WC_RNG *rng, int modSz, DhKey *dh); + +/*! + \ingroup Diffie-Hellman +*/ +WOLFSSL_API int wc_DhSetCheckKey(DhKey* key, const byte* p, word32 pSz, + const byte* g, word32 gSz, const byte* q, word32 qSz, + int trusted, WC_RNG* rng); + +/*! + \ingroup Diffie-Hellman +*/ +WOLFSSL_API int wc_DhSetKey_ex(DhKey* key, const byte* p, word32 pSz, + const byte* g, word32 gSz, const byte* q, word32 qSz); + +/*! + \ingroup Diffie-Hellman +*/ +WOLFSSL_API int wc_FreeDhKey(DhKey* key); From 1b5ac2ea8dcdc4076d64b0438b81365b7bb51652 Mon Sep 17 00:00:00 2001 From: abrahamsonn Date: Thu, 29 Nov 2018 10:03:38 -0700 Subject: [PATCH 12/12] Updated an API's documented return codes Added ASN_BEFORE_DATE_E and ASN_AFTER_DATE_E to wolfSSL_CTX_load_verify_locations --- doc/dox_comments/header_files/ssl.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/dox_comments/header_files/ssl.h b/doc/dox_comments/header_files/ssl.h index 72312307c..c0a88c101 100644 --- a/doc/dox_comments/header_files/ssl.h +++ b/doc/dox_comments/header_files/ssl.h @@ -907,6 +907,10 @@ WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_file(WOLFSSL_CTX*, const char*, int); read, or is corrupted. \return MEMORY_E will be returned if an out of memory condition occurs. \return ASN_INPUT_E will be returned if Base16 decoding fails on the file. + \return ASN_BEFORE_DATE_E will be returned if the current date is before the + before date. + \return ASN_AFTER_DATE_E will be returned if the current date is after the + after date. \return BUFFER_E will be returned if a chain buffer is bigger than the receiving buffer. \return BAD_PATH_ERROR will be returned if opendir() fails when trying