From 59bb9a9a011050c2a9af55c6da2f37a22337b527 Mon Sep 17 00:00:00 2001 From: dongheng Date: Fri, 23 Sep 2016 14:50:27 +0800 Subject: [PATCH] components/openssl: [TW7411] supply doxygen type note --- .../openssl/include/internal/ssl_cert.h | 17 +- .../openssl/include/internal/ssl_code.h | 1 + .../openssl/include/internal/ssl_methods.h | 18 + .../openssl/include/internal/ssl_pkey.h | 25 + .../openssl/include/internal/ssl_x509.h | 25 +- components/openssl/include/openssl/ssl.h | 953 +++++++++--------- components/openssl/library/ssl_cert.c | 24 +- components/openssl/library/ssl_lib.c | 677 +++---------- components/openssl/library/ssl_methods.c | 16 +- components/openssl/library/ssl_pkey.c | 113 +-- components/openssl/library/ssl_x509.c | 136 +-- components/openssl/platform/ssl_pm.c | 9 + 12 files changed, 782 insertions(+), 1232 deletions(-) diff --git a/components/openssl/include/internal/ssl_cert.h b/components/openssl/include/internal/ssl_cert.h index 109012a19..b0bd09d48 100644 --- a/components/openssl/include/internal/ssl_cert.h +++ b/components/openssl/include/internal/ssl_cert.h @@ -17,7 +17,22 @@ #include "ssl_types.h" +/** + * @brief create a certification object include private key object + * + * @param none + * + * @return certification object point + */ CERT* ssl_cert_new(void); -void ssl_cert_free(CERT *c); + +/** + * @brief free a certification object + * + * @param cert - certification object point + * + * @return none + */ +void ssl_cert_free(CERT *cert); #endif diff --git a/components/openssl/include/internal/ssl_code.h b/components/openssl/include/internal/ssl_code.h index e76b35abe..34107d432 100644 --- a/components/openssl/include/internal/ssl_code.h +++ b/components/openssl/include/internal/ssl_code.h @@ -72,6 +72,7 @@ typedef enum { MSG_FLOW_FINISHED } MSG_FLOW_STATE; +/* SSL subsystem states */ typedef enum { TLS_ST_BEFORE, TLS_ST_OK, diff --git a/components/openssl/include/internal/ssl_methods.h b/components/openssl/include/internal/ssl_methods.h index 244eec38d..68737b438 100644 --- a/components/openssl/include/internal/ssl_methods.h +++ b/components/openssl/include/internal/ssl_methods.h @@ -15,6 +15,9 @@ #ifndef _SSL_METHODS_H_ #define _SSL_METHODS_H_ +/** + * TLS method function implement + */ #define IMPLEMENT_TLS_METHOD_FUNC(func_name, \ new, free, \ handshake, shutdown, clear, \ @@ -89,7 +92,22 @@ return &func_name##_data; \ } +/** + * @brief get X509 object method + * + * @param none + * + * @return X509 object method point + */ const X509_METHOD* X509_method(void); + +/** + * @brief get private key object method + * + * @param none + * + * @return private key object method point + */ const PKEY_METHOD* EVP_PKEY_method(void); #endif diff --git a/components/openssl/include/internal/ssl_pkey.h b/components/openssl/include/internal/ssl_pkey.h index 34be294ef..d9a22ee02 100644 --- a/components/openssl/include/internal/ssl_pkey.h +++ b/components/openssl/include/internal/ssl_pkey.h @@ -17,13 +17,38 @@ #include "ssl_types.h" +/** + * @brief create a private key object + * + * @param none + * + * @return private key object point + */ EVP_PKEY* EVP_PKEY_new(void); +/** + * @brief load a character key context into system context. If '*a' is pointed to the + * private key, then load key into it. Or create a new private key object + * + * @param type - private key type + * @param a - a point pointed to a private key point + * @param pp - a point pointed to the key context memory point + * @param length - key bytes + * + * @return private key object point + */ EVP_PKEY* d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, long length); +/** + * @brief free a private key object + * + * @param pkey - private key object point + * + * @return none + */ void EVP_PKEY_free(EVP_PKEY *x); #endif diff --git a/components/openssl/include/internal/ssl_x509.h b/components/openssl/include/internal/ssl_x509.h index ee3448544..9359073b6 100644 --- a/components/openssl/include/internal/ssl_x509.h +++ b/components/openssl/include/internal/ssl_x509.h @@ -20,17 +20,34 @@ DEFINE_STACK_OF(X509_NAME) -/* - * sk_X509_NAME_new_null - create a X509 certification object +/** + * @brief create a X509 certification object * * @param none * - * @return X509 certification object point or NULL if failed + * @return X509 certification object point */ X509* X509_new(void); +/** + * @brief load a character certification context into system context. If '*cert' is pointed to the + * certification, then load certification into it. Or create a new X509 certification object + * + * @param cert - a point pointed to X509 certification + * @param buffer - a point pointed to the certification context memory point + * @param length - certification bytes + * + * @return X509 certification object point + */ X509* d2i_X509(X509 **cert, const unsigned char *buffer, long len); -void X509_free(X509 *cert); +/** + * @brief free a X509 certification object + * + * @param x - X509 certification object point + * + * @return none + */ +void X509_free(X509 *x); #endif diff --git a/components/openssl/include/openssl/ssl.h b/components/openssl/include/openssl/ssl.h index 865405d86..3f92a68d7 100644 --- a/components/openssl/include/openssl/ssl.h +++ b/components/openssl/include/openssl/ssl.h @@ -22,17 +22,17 @@ { */ -/* - * SSL_CTX_new - create a SSL context +/** + * @brief create a SSL context * * @param method - the SSL context method point * - * @return the context point, if create failed return NULL + * @return the context point */ SSL_CTX* SSL_CTX_new(const SSL_METHOD *method); -/* - * SSL_CTX_free - free a SSL context +/** + * @brief free a SSL context * * @param method - the SSL context point * @@ -40,17 +40,17 @@ SSL_CTX* SSL_CTX_new(const SSL_METHOD *method); */ void SSL_CTX_free(SSL_CTX *ctx); -/* - * SSL_new - create a SSL +/** + * @brief create a SSL * * @param ctx - the SSL context point * - * @return the SSL point or NULL if failed + * @return the SSL point */ SSL* SSL_new(SSL_CTX *ctx); -/* - * SSL_free - free the SSL +/** + * @brief free the SSL * * @param ssl - the SSL point * @@ -58,58 +58,58 @@ SSL* SSL_new(SSL_CTX *ctx); */ void SSL_free(SSL *ssl); -/* - * SSL_connect - connect to the remote SSL server +/** + * @brief connect to the remote SSL server * * @param ssl - the SSL point * - * @return - * 1 : OK - * -1 : failed + * @return result + * 1 : OK + * -1 : failed */ int SSL_connect(SSL *ssl); -/* - * SSL_accept - accept the remote connection +/** + * @brief accept the remote connection * * @param ssl - the SSL point * - * @return - * 1 : OK - * -1 : failed + * @return result + * 1 : OK + * -1 : failed */ int SSL_accept(SSL *ssl); -/* - * SSL_read - read data from to remote +/** + * @brief read data from to remote * * @param ssl - the SSL point which has been connected * @param buffer - the received data buffer point * @param len - the received data length * - * @return - * > 0 : OK, and return received data bytes - * = 0 : connection is closed - * < 0 : an error catch + * @return result + * > 0 : OK, and return received data bytes + * = 0 : connection is closed + * < 0 : an error catch */ int SSL_read(SSL *ssl, void *buffer, int len); -/* - * SSL_write - send the data to remote +/** + * @brief send the data to remote * * @param ssl - the SSL point which has been connected * @param buffer - the send data buffer point * @param len - the send data length * - * @return - * > 0 : OK, and return sent data bytes - * = 0 : connection is closed - * < 0 : an error catch + * @return result + * > 0 : OK, and return sent data bytes + * = 0 : connection is closed + * < 0 : an error catch */ int SSL_write(SSL *ssl, const void *buffer, int len); -/* - * SSL_get_verify_result - get the verifying result of the SSL certification +/** + * @brief get the verifying result of the SSL certification * * @param ssl - the SSL point * @@ -117,56 +117,56 @@ int SSL_write(SSL *ssl, const void *buffer, int len); */ long SSL_get_verify_result(const SSL *ssl); -/* - * SSL_shutdown - shutdown the connection +/** + * @brief shutdown the connection * * @param ssl - the SSL point * - * @return - * 1 : OK - * 0 : shutdown is not finished - * -1 : an error catch + * @return result + * 1 : OK + * 0 : shutdown is not finished + * -1 : an error catch */ int SSL_shutdown(SSL *ssl); -/* - * SSL_set_fd - bind the socket file description into the SSL +/** + * @brief bind the socket file description into the SSL * * @param ssl - the SSL point * @param fd - socket handle * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_set_fd(SSL *ssl, int fd); -/* - * SSL_CTX_use_PrivateKey - These functions load the private key into the SSL_CTX or SSL object +/** + * @brief These functions load the private key into the SSL_CTX or SSL object * * @param ctx - the SSL context point * @param pkey - private key object point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey); -/* - * SSL_CTX_use_PrivateKey - These functions load the certification into the SSL_CTX or SSL object +/** + * @brief These functions load the certification into the SSL_CTX or SSL object * * @param ctx - the SSL context point * @param pkey - certification object point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x); -/* - * SSLv23_client_method - create the target SSL context client method +/** + * @brief create the target SSL context client method * * @param none * @@ -174,8 +174,8 @@ int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x); */ const SSL_METHOD* SSLv23_client_method(void); -/* - * TLSv1_client_method - create the target SSL context client method +/** + * @brief create the target SSL context client method * * @param none * @@ -183,8 +183,8 @@ const SSL_METHOD* SSLv23_client_method(void); */ const SSL_METHOD* TLSv1_client_method(void); -/* - * SSLv3_client_method - create the target SSL context client method +/** + * @brief create the target SSL context client method * * @param none * @@ -192,8 +192,8 @@ const SSL_METHOD* TLSv1_client_method(void); */ const SSL_METHOD* SSLv3_client_method(void); -/* - * TLSv1_1_client_method - create the target SSL context client method +/** + * @brief create the target SSL context client method * * @param none * @@ -201,8 +201,8 @@ const SSL_METHOD* SSLv3_client_method(void); */ const SSL_METHOD* TLSv1_1_client_method(void); -/* - * TLSv1_1_client_method - create the target SSL context client method +/** + * @brief create the target SSL context client method * * @param none * @@ -211,8 +211,8 @@ const SSL_METHOD* TLSv1_1_client_method(void); const SSL_METHOD* TLSv1_2_client_method(void); -/* - * SSLv23_server_method - create the target SSL context server method +/** + * @brief create the target SSL context server method * * @param none * @@ -220,8 +220,8 @@ const SSL_METHOD* TLSv1_2_client_method(void); */ const SSL_METHOD* SSLv23_server_method(void); -/* - * TLSv1_1_server_method - create the target SSL context server method +/** + * @brief create the target SSL context server method * * @param none * @@ -229,8 +229,8 @@ const SSL_METHOD* SSLv23_server_method(void); */ const SSL_METHOD* TLSv1_1_server_method(void); -/* - * TLSv1_1_server_method - create the target SSL context server method +/** + * @brief create the target SSL context server method * * @param none * @@ -238,8 +238,8 @@ const SSL_METHOD* TLSv1_1_server_method(void); */ const SSL_METHOD* TLSv1_2_server_method(void); -/* - * TLSv1_server_method - create the target SSL context server method +/** + * @brief create the target SSL context server method * * @param none * @@ -247,8 +247,8 @@ const SSL_METHOD* TLSv1_2_server_method(void); */ const SSL_METHOD* TLSv1_server_method(void); -/* - * SSLv3_server_method - create the target SSL context server method +/** + * @brief create the target SSL context server method * * @param none * @@ -256,8 +256,8 @@ const SSL_METHOD* TLSv1_server_method(void); */ const SSL_METHOD* SSLv3_server_method(void); -/* - * SSL_CTX_set_alpn_select_cb - set the SSL context ALPN select callback function +/** + * @brief set the SSL context ALPN select callback function * * @param ctx - SSL context point * @param cb - ALPN select callback function @@ -275,21 +275,21 @@ void SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx, void *arg); -/* - * SSL_CTX_set_alpn_protos - set the SSL context ALPN select protocol +/** + * @brief set the SSL context ALPN select protocol * * @param ctx - SSL context point * @param protos - ALPN protocol name * @param protos_len - ALPN protocol name bytes * - * @return - * 0 : OK - * 1 : failed + * @return result + * 0 : OK + * 1 : failed */ int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos, unsigned int protos_len); -/* - * SSL_CTX_set_next_proto_select_cb - set the SSL context next ALPN select callback function +/** + * @brief set the SSL context next ALPN select callback function * * @param ctx - SSL context point * @param cb - ALPN select callback function @@ -306,8 +306,8 @@ void SSL_CTX_set_next_proto_select_cb(SSL_CTX *ctx, void *arg), void *arg); -/* - * SSL_get_error - get SSL error code +/** + * @brief get SSL error code * * @param ssl - SSL point * @param ret_code - SSL return code @@ -316,8 +316,8 @@ void SSL_CTX_set_next_proto_select_cb(SSL_CTX *ctx, */ int SSL_get_error(const SSL *ssl, int ret_code); -/* - * ERR_clear_error - clear the SSL error code +/** + * @brief clear the SSL error code * * @param none * @@ -325,8 +325,8 @@ int SSL_get_error(const SSL *ssl, int ret_code); */ void ERR_clear_error(void); -/* - * ERR_get_error - get the current SSL error code +/** + * @brief get the current SSL error code * * @param none * @@ -334,8 +334,8 @@ void ERR_clear_error(void); */ int ERR_get_error(void); -/* - * ERR_load_SSL_strings - register the SSL error strings +/** + * @brief register the SSL error strings * * @param none * @@ -343,8 +343,8 @@ int ERR_get_error(void); */ void ERR_load_SSL_strings(void); -/* - * SSL_library_init - initialize the SSL library +/** + * @brief initialize the SSL library * * @param none * @@ -352,9 +352,9 @@ void ERR_load_SSL_strings(void); */ void SSL_library_init(void); -/* - * ERR_error_string - generates a human-readable string representing the error code e - * and store it into the "ret" point memory +/** + * @brief generates a human-readable string representing the error code e + * and store it into the "ret" point memory * * @param e - error code * @param ret - memory point to store the string @@ -363,8 +363,8 @@ void SSL_library_init(void); */ char *ERR_error_string(unsigned long e, char *ret); -/* - * SSL_CTX_set_options - add the SSL context option +/** + * @brief add the SSL context option * * @param ctx - SSL context point * @param opt - new SSL context option @@ -373,15 +373,15 @@ char *ERR_error_string(unsigned long e, char *ret); */ unsigned long SSL_CTX_set_options(SSL_CTX *ctx, unsigned long opt); -/* - * SSL_CTX_set_options - add the SSL context mode +/** + * @brief add the SSL context mode * * @param ctx - SSL context point * @param mod - new SSL context mod * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_set_mode(SSL_CTX *ctx, int mod); @@ -389,20 +389,20 @@ int SSL_CTX_set_mode(SSL_CTX *ctx, int mod); } */ -/* - * SSL_do_handshake - perform the SSL handshake +/** + * @brief perform the SSL handshake * * @param ssl - SSL point * - * @return - * 1 : OK - * 0 : failed - * -1 : a error catch + * @return result + * 1 : OK + * 0 : failed + * -1 : a error catch */ int SSL_do_handshake(SSL *ssl); -/* - * SSL_get_version - get the SSL current version +/** + * @brief get the SSL current version * * @param ssl - SSL point * @@ -410,20 +410,20 @@ int SSL_do_handshake(SSL *ssl); */ const char *SSL_get_version(const SSL *ssl); -/* - * SSL_CTX_set_ssl_version - set the SSL context version +/** + * @brief set the SSL context version * * @param ctx - SSL context point * @param meth - SSL method point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth); -/* - * SSL_CTX_get_ssl_method - get the SSL context current method +/** + * @brief get the SSL context current method * * @param ctx - SSL context point * @@ -431,8 +431,8 @@ int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth); */ const SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *ctx); -/* - * SSL_CTX_get_ssl_method - get the SSL current method +/** + * @brief get the SSL current method * * @param ssl - SSL point * @@ -440,44 +440,44 @@ const SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *ctx); */ const SSL_METHOD *SSL_get_ssl_method(SSL *ssl); -/* - * SSL_set_ssl_method - set the SSL method +/** + * @brief set the SSL method * * @param ssl - SSL point * @param meth - SSL method point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_set_ssl_method(SSL *ssl, const SSL_METHOD *method); -/* - * SSL_add_client_CA - add CA client certification into the SSL +/** + * @brief add CA client certification into the SSL * * @param ssl - SSL point * @param x - CA certification point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_add_client_CA(SSL *ssl, X509 *x); -/* - * SSL_add_client_CA - add CA client certification into the SSL context +/** + * @brief add CA client certification into the SSL context * * @param ctx - SSL context point * @param x - CA certification point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x); -/* - * SSL_set_client_CA_list - set the SSL CA certification list +/** + * @brief set the SSL CA certification list * * @param ssl - SSL point * @param name_list - CA certification list @@ -486,8 +486,8 @@ int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x); */ void SSL_set_client_CA_list(SSL *ssl, STACK_OF(X509_NAME) *name_list); -/* - * SSL_CTX_set_client_CA_list - set the SSL context CA certification list +/** + * @brief set the SSL context CA certification list * * @param ctx - SSL context point * @param name_list - CA certification list @@ -496,8 +496,8 @@ void SSL_set_client_CA_list(SSL *ssl, STACK_OF(X509_NAME) *name_list); */ void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list); -/* - * SSL_get_client_CA_list - get the SSL CA certification list +/** + * @briefget the SSL CA certification list * * @param ssl - SSL point * @@ -505,8 +505,8 @@ void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list); */ STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *ssl); -/* - * SSL_CTX_get_client_CA_list - get the SSL context CA certification list +/** + * @brief get the SSL context CA certification list * * @param ctx - SSL context point * @@ -514,8 +514,8 @@ STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *ssl); */ STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *ctx); -/* - * SSL_get_certificate - get the SSL certification point +/** + * @brief get the SSL certification point * * @param ssl - SSL point * @@ -523,8 +523,8 @@ STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *ctx); */ X509 *SSL_get_certificate(const SSL *ssl); -/* - * SSL_get_privatekey - get the SSL private key point +/** + * @brief get the SSL private key point * * @param ssl - SSL point * @@ -532,8 +532,8 @@ X509 *SSL_get_certificate(const SSL *ssl); */ EVP_PKEY *SSL_get_privatekey(const SSL *ssl); -/* - * SSL_set_info_callback - set the SSL information callback function +/** + * @brief set the SSL information callback function * * @param ssl - SSL point * @param cb - information callback function @@ -542,8 +542,8 @@ EVP_PKEY *SSL_get_privatekey(const SSL *ssl); */ void SSL_set_info_callback(SSL *ssl, void (*cb) (const SSL *ssl, int type, int val)); -/* - * SSL_get_state - get the SSL state +/** + * @brief get the SSL state * * @param ssl - SSL point * @@ -551,8 +551,8 @@ void SSL_set_info_callback(SSL *ssl, void (*cb) (const SSL *ssl, int type, int v */ OSSL_HANDSHAKE_STATE SSL_get_state(const SSL *ssl); -/* - * SSL_CTX_set_default_read_buffer_len - set the SSL context read buffer length +/** + * @brief set the SSL context read buffer length * * @param ctx - SSL context point * @param len - read buffer length @@ -561,8 +561,8 @@ OSSL_HANDSHAKE_STATE SSL_get_state(const SSL *ssl); */ void SSL_CTX_set_default_read_buffer_len(SSL_CTX *ctx, size_t len); -/* - * SSL_set_default_read_buffer_len - set the SSL read buffer length +/** + * @brief set the SSL read buffer length * * @param ssl - SSL point * @param len - read buffer length @@ -571,8 +571,8 @@ void SSL_CTX_set_default_read_buffer_len(SSL_CTX *ctx, size_t len); */ void SSL_set_default_read_buffer_len(SSL *ssl, size_t len); -/* - * SSL_set_security_level - set the SSL security level +/** + * @brief set the SSL security level * * @param ssl - SSL point * @param level - security level @@ -581,8 +581,8 @@ void SSL_set_default_read_buffer_len(SSL *ssl, size_t len); */ void SSL_set_security_level(SSL *ssl, int level); -/* - * SSL_get_security_level - get the SSL security level +/** + * @brief get the SSL security level * * @param ssl - SSL point * @@ -590,8 +590,8 @@ void SSL_set_security_level(SSL *ssl, int level); */ int SSL_get_security_level(const SSL *ssl); -/* - * SSL_CTX_get_verify_mode - get the SSL verifying mode of the SSL context +/** + * @brief get the SSL verifying mode of the SSL context * * @param ctx - SSL context point * @@ -599,8 +599,8 @@ int SSL_get_security_level(const SSL *ssl); */ int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); -/* - * SSL_CTX_get_verify_depth - get the SSL verifying depth of the SSL context +/** + * @brief get the SSL verifying depth of the SSL context * * @param ctx - SSL context point * @@ -608,8 +608,8 @@ int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); */ int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); -/* - * SSL_CTX_set_verify - set the SSL context verifying of the SSL context +/** + * @brief set the SSL context verifying of the SSL context * * @param ctx - SSL context point * @param mode - verifying mode @@ -619,8 +619,8 @@ int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); */ void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, int (*verify_callback)(int, X509_STORE_CTX *)); -/* - * SSL_set_verify - set the SSL verifying of the SSL context +/** + * @brief set the SSL verifying of the SSL context * * @param ctx - SSL point * @param mode - verifying mode @@ -630,18 +630,18 @@ void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, int (*verify_callback)(int, X509 */ void SSL_set_verify(SSL *s, int mode, int (*verify_callback)(int, X509_STORE_CTX *)); -/* - * SSL_CTX_set_verify_depth - set the SSL verify depth of the SSL context +/** + * @brief set the SSL verify depth of the SSL context * * @param ctx - SSL context point * @param depth - verifying depth * - * @return one + * @return none */ void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth); -/* - * verify_callback - certification verifying callback function +/** + * @brief certification verifying callback function * * @param preverify_ok - verifying result * @param x509_ctx - X509 certification point @@ -650,8 +650,8 @@ void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth); */ int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx); -/* - * SSL_CTX_set_timeout - set the session timeout time +/** + * @brief set the session timeout time * * @param ctx - SSL context point * @param t - new session timeout time @@ -660,8 +660,8 @@ int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx); */ long SSL_CTX_set_timeout(SSL_CTX *ctx, long t); -/* - * SSL_CTX_get_timeout - get the session timeout time +/** + * @brief get the session timeout time * * @param ctx - SSL context point * @@ -669,32 +669,32 @@ long SSL_CTX_set_timeout(SSL_CTX *ctx, long t); */ long SSL_CTX_get_timeout(const SSL_CTX *ctx); -/* - * SSL_CTX_set_cipher_list - set the SSL context cipher through the list string +/** + * @brief set the SSL context cipher through the list string * * @param ctx - SSL context point * @param str - cipher controller list string * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str); -/* - * SSL_set_cipher_list - set the SSL cipher through the list string +/** + * @brief set the SSL cipher through the list string * * @param ssl - SSL point * @param str - cipher controller list string * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_set_cipher_list(SSL *ssl, const char *str); -/* - * SSL_get_cipher_list - get the SSL cipher list string +/** + * @brief get the SSL cipher list string * * @param ssl - SSL point * @@ -702,8 +702,8 @@ int SSL_set_cipher_list(SSL *ssl, const char *str); */ const char *SSL_get_cipher_list(const SSL *ssl, int n); -/* - * SSL_get_current_cipher - get the SSL cipher +/** + * @brief get the SSL cipher * * @param ssl - SSL point * @@ -711,8 +711,8 @@ const char *SSL_get_cipher_list(const SSL *ssl, int n); */ const SSL_CIPHER *SSL_get_current_cipher(const SSL *ssl); -/* - * SSL_get_cipher - get the SSL cipher string +/** + * @brief get the SSL cipher string * * @param ssl - SSL point * @@ -720,8 +720,8 @@ const SSL_CIPHER *SSL_get_current_cipher(const SSL *ssl); */ const char *SSL_get_cipher(const SSL *ssl); -/* - * SSL_CTX_get_cert_store - get the SSL context object X509 certification storage +/** + * @brief get the SSL context object X509 certification storage * * @param ctx - SSL context point * @@ -729,8 +729,8 @@ const char *SSL_get_cipher(const SSL *ssl); */ X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *ctx); -/* - * SSL_CTX_set_cert_store - set the SSL context object X509 certification store +/** + * @brief set the SSL context object X509 certification store * * @param ctx - SSL context point * @param store - X509 certification store @@ -739,8 +739,8 @@ X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *ctx); */ void SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store); -/* - * SSL_want - get the SSL specifical statement +/** + * @brief get the SSL specifical statement * * @param ssl - SSL point * @@ -748,63 +748,63 @@ void SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store); */ int SSL_want(const SSL *ssl); -/* - * SSL_want_x509_lookup - check if the SSL is SSL_X509_LOOKUP state +/** + * @brief check if the SSL is SSL_X509_LOOKUP state * * @param ssl - SSL point * - * @return - * 1 : yes - * 0 : no + * @return result + * 1 : OK + * 0 : failed */ int SSL_want_x509_lookup(const SSL *ssl); -/* - * SSL_clear - reset the SSL +/** + * @brief reset the SSL * * @param ssl - SSL point * - * @return - * 1 : yes - * 0 : no + * @return result + * 1 : OK + * 0 : failed */ int SSL_clear(SSL *ssl); -/* - * SSL_get_fd - get the socket handle of the SSL +/** + * @brief get the socket handle of the SSL * * @param ssl - SSL point * - * @return - * >= 0 : yes, and return socket handle - * < 0 : a error catch + * @return result + * >= 0 : yes, and return socket handle + * < 0 : a error catch */ int SSL_get_fd(const SSL *ssl); -/* - * SSL_get_rfd - get the read only socket handle of the SSL +/** + * @brief get the read only socket handle of the SSL * * @param ssl - SSL point * - * @return - * >= 0 : yes, and return socket handle - * < 0 : a error catch + * @return result + * >= 0 : yes, and return socket handle + * < 0 : a error catch */ int SSL_get_rfd(const SSL *ssl); -/* - * SSL_get_wfd - get the write only socket handle of the SSL +/** + * @brief get the write only socket handle of the SSL * * @param ssl - SSL point * - * @return - * >= 0 : yes, and return socket handle - * < 0 : a error catch + * @return result + * >= 0 : yes, and return socket handle + * < 0 : a error catch */ int SSL_get_wfd(const SSL *ssl); -/* - * SSL_set_read_ahead - set the SSL if we can read as many as data +/** + * @brief set the SSL if we can read as many as data * * @param ssl - SSL point * @param yes - enable the function @@ -813,8 +813,8 @@ int SSL_get_wfd(const SSL *ssl); */ void SSL_set_read_ahead(SSL *s, int yes); -/* - * SSL_set_read_ahead - set the SSL context if we can read as many as data +/** + * @brief set the SSL context if we can read as many as data * * @param ctx - SSL context point * @param yes - enbale the function @@ -823,8 +823,8 @@ void SSL_set_read_ahead(SSL *s, int yes); */ void SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes); -/* - * SSL_set_read_ahead - get the SSL ahead signal if we can read as many as data +/** + * @brief get the SSL ahead signal if we can read as many as data * * @param ssl - SSL point * @@ -832,8 +832,8 @@ void SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes); */ int SSL_get_read_ahead(const SSL *ssl); -/* - * SSL_set_read_ahead - get the SSL context ahead signal if we can read as many as data +/** + * @brief get the SSL context ahead signal if we can read as many as data * * @param ctx - SSL context point * @@ -841,8 +841,8 @@ int SSL_get_read_ahead(const SSL *ssl); */ long SSL_CTX_get_read_ahead(SSL_CTX *ctx); -/* - * SSL_has_pending - check if some data can be read +/** + * @brief check if some data can be read * * @param ssl - SSL point * @@ -852,160 +852,160 @@ long SSL_CTX_get_read_ahead(SSL_CTX *ctx); */ int SSL_has_pending(const SSL *ssl); -/* - * SSL_CTX_use_certificate - load the X509 certification into SSL context +/** + * @brief load the X509 certification into SSL context * * @param ctx - SSL context point * @param x - X509 certification point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x);//loads the certificate x into ctx -/* - * SSL_CTX_use_certificate_ASN1 - load the ASN1 certification into SSL context +/** + * @brief load the ASN1 certification into SSL context * * @param ctx - SSL context point * @param len - certification length * @param d - data point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, const unsigned char *d); -/* - * SSL_CTX_use_certificate_file - load the certification file into SSL context +/** + * @brief load the certification file into SSL context * * @param ctx - SSL context point * @param file - certification file name * @param type - certification encoding type * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type); -/* - * SSL_CTX_use_certificate_chain_file - load the certification chain file into SSL context +/** + * @brief load the certification chain file into SSL context * * @param ctx - SSL context point * @param file - certification chain file name * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file); -/* - * SSL_CTX_use_certificate_ASN1 - load the ASN1 private key into SSL context +/** + * @brief load the ASN1 private key into SSL context * * @param ctx - SSL context point * @param d - data point * @param len - private key length * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_use_PrivateKey_ASN1(int pk, SSL_CTX *ctx, const unsigned char *d, long len);//adds the private key of type pk stored at memory location d (length len) to ctx -/* - * SSL_CTX_use_certificate_file - load the private key file into SSL context +/** + * @brief load the private key file into SSL context * * @param ctx - SSL context point * @param file - private key file name * @param type - private key encoding type * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type); -/* - * SSL_CTX_use_certificate - load the RSA private key into SSL context +/** + * @brief load the RSA private key into SSL context * * @param ctx - SSL context point * @param x - RSA private key point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa); -/* - * SSL_CTX_use_certificate_ASN1 - load the RSA ASN1 private key into SSL context +/** + * @brief load the RSA ASN1 private key into SSL context * * @param ctx - SSL context point * @param d - data point * @param len - RSA private key length * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, long len); -/* - * SSL_CTX_use_certificate_file - load the RSA private key file into SSL context +/** + * @brief load the RSA private key file into SSL context * * @param ctx - SSL context point * @param file - RSA private key file name * @param type - private key encoding type * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type); -/* - * SSL_CTX_check_private_key - check if the private key and certification is matched +/** + * @brief check if the private key and certification is matched * * @param ctx - SSL context point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_check_private_key(const SSL_CTX *ctx); -/* - * SSL_CTX_use_serverinfo - set the SSL context server information +/** + * @brief set the SSL context server information * * @param ctx - SSL context point * @param serverinfo - server information string * @param serverinfo_length - server information length * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo, size_t serverinfo_length); -/* - * SSL_CTX_use_serverinfo - load the SSL context server infomation file into SSL context +/** + * @brief load the SSL context server infomation file into SSL context * * @param ctx - SSL context point * @param file - server information file * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file); -/* - * SSL_select_next_proto - SSL select next function +/** + * @brief SSL select next function * * @param out - point of output data point * @param outlen - output data length @@ -1014,7 +1014,7 @@ int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file); * @param client - client data point * @param client_len -client data length * - * @return + * @return NPN state * OPENSSL_NPN_UNSUPPORTED : not support * OPENSSL_NPN_NEGOTIATED : negotiated * OPENSSL_NPN_NO_OVERLAP : no overlap @@ -1023,34 +1023,34 @@ int SSL_select_next_proto(unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, const unsigned char *client, unsigned int client_len); -/* - * SSL_CTX_add_extra_chain_cert - load the extra certification chain into the SSL context +/** + * @brief load the extra certification chain into the SSL context * * @param ctx - SSL context point * @param x509 - X509 certification * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ long SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *); -/* - * SSL_CTX_ctrl - control the SSL context +/** + * @brief control the SSL context * * @param ctx - SSL context point * @param cmd - command * @param larg - parameter length * @param parg - parameter point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, char *parg); -/* - * SSL_CTX_get_ciphers - get the SSL context cipher +/** + * @brief get the SSL context cipher * * @param ctx - SSL context point * @@ -1058,19 +1058,19 @@ long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, char *parg); */ STACK *SSL_CTX_get_ciphers(const SSL_CTX *ctx); -/* - * SSL_CTX_get_ciphers - check if the SSL context can read as many as data +/** + * @brief check if the SSL context can read as many as data * * @param ctx - SSL context point * - * @return - * 1 : Yes - * 0 : No + * @return result + * 1 : OK + * 0 : failed */ long SSL_CTX_get_default_read_ahead(SSL_CTX *ctx); -/* - * SSL_CTX_get_ex_data - get the SSL context extra data +/** + * @brief get the SSL context extra data * * @param ctx - SSL context point * @param idx - index @@ -1079,8 +1079,8 @@ long SSL_CTX_get_default_read_ahead(SSL_CTX *ctx); */ char *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx); -/* - * SSL_CTX_get_quiet_shutdown - get the SSL context quiet shutdown option +/** + * @brief get the SSL context quiet shutdown option * * @param ctx - SSL context point * @@ -1088,44 +1088,44 @@ char *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx); */ int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx); -/* - * SSL_CTX_get_quiet_shutdown - load the SSL context CA file +/** + * @brief load the SSL context CA file * * @param ctx - SSL context point * @param CAfile - CA certification file * @param CApath - CA certification file path * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, const char *CApath); -/* - * SSL_CTX_up_ref - add SSL context reference count by '1' +/** + * @brief add SSL context reference count by '1' * * @param ctx - SSL context point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_up_ref(SSL_CTX *ctx); -/* - * SSL_CTX_set_app_data - set SSL context application private data +/** + * @brief set SSL context application private data * * @param ctx - SSL context point * @param arg - private data * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_set_app_data(SSL_CTX *ctx, void *arg); -/* - * SSL_CTX_set_client_cert_cb - set SSL context client certification callback function +/** + * @brief set SSL context client certification callback function * * @param ctx - SSL context point * @param cb - callback function @@ -1134,8 +1134,8 @@ int SSL_CTX_set_app_data(SSL_CTX *ctx, void *arg); */ void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey)); -/* - * SSL_CTX_set_default_read_ahead - set the SSL context if we can read as many as data +/** + * @brief set the SSL context if we can read as many as data * * @param ctx - SSL context point * @param m - enable the fuction @@ -1144,54 +1144,54 @@ void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, X509 **x509, E */ void SSL_CTX_set_default_read_ahead(SSL_CTX *ctx, int m); -/* - * SSL_CTX_set_default_verify_paths - set SSL context default verifying path +/** + * @brief set SSL context default verifying path * * @param ctx - SSL context point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); -/* - * SSL_CTX_set_default_verify_paths - set SSL context default verifying directory +/** + * @brief set SSL context default verifying directory * * @param ctx - SSL context point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_set_default_verify_dir(SSL_CTX *ctx); -/* - * SSL_CTX_set_default_verify_paths - set SSL context default verifying file +/** + * @brief set SSL context default verifying file * * @param ctx - SSL context point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_set_default_verify_file(SSL_CTX *ctx); -/* - * SSL_CTX_set_ex_data - set SSL context extra data +/** + * @brief set SSL context extra data * * @param ctx - SSL context point * @param idx - data index * @param arg - data point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, char *arg); -/* - * SSL_CTX_clear_options - clear the SSL context option bit of "op" +/** + * @brief clear the SSL context option bit of "op" * * @param ctx - SSL context point * @param op - option @@ -1200,8 +1200,8 @@ int SSL_CTX_set_ex_data(SSL_CTX *s, int idx, char *arg); */ unsigned long SSL_CTX_clear_options(SSL_CTX *ctx, unsigned long op); -/* - * SSL_CTX_clear_options - get the SSL context option +/** + * @brief get the SSL context option * * @param ctx - SSL context point * @param op - option @@ -1210,8 +1210,8 @@ unsigned long SSL_CTX_clear_options(SSL_CTX *ctx, unsigned long op); */ unsigned long SSL_CTX_get_options(SSL_CTX *ctx); -/* - * SSL_CTX_set_quiet_shutdown - set the SSL context quiet shutdown mode +/** + * @brief set the SSL context quiet shutdown mode * * @param ctx - SSL context point * @param mode - mode @@ -1220,8 +1220,8 @@ unsigned long SSL_CTX_get_options(SSL_CTX *ctx); */ void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode); -/* - * SSL_CTX_get0_certificate - get the SSL context X509 certification +/** + * @brief get the SSL context X509 certification * * @param ctx - SSL context point * @@ -1229,8 +1229,8 @@ void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode); */ X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx); -/* - * SSL_CTX_get0_certificate - get the SSL context private key +/** + * @brief get the SSL context private key * * @param ctx - SSL context point * @@ -1238,32 +1238,33 @@ X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx); */ EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx); -/* - * SSL_CTX_use_psk_identity_hint - set SSL context PSK identity hint +/** + * @brief set SSL context PSK identity hint * * @param ctx - SSL context point * @param hint - PSK identity hint * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *hint); -/* - * SSL_CTX_set_psk_server_callback - set SSL context PSK server callback function +/** + * @brief set SSL context PSK server callback function * * @param ctx - SSL context point * @param callback - callback function * + * @return none */ void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx, unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len)); -/* - * SSL_alert_desc_string - get alert description string +/** + * @brief get alert description string * * @param value - alert value * @@ -1271,8 +1272,8 @@ void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx, */ const char *SSL_alert_desc_string(int value); -/* - * SSL_alert_desc_string - get alert description long string +/** + * @brief get alert description long string * * @param value - alert value * @@ -1280,8 +1281,8 @@ const char *SSL_alert_desc_string(int value); */ const char *SSL_alert_desc_string_long(int value); -/* - * SSL_alert_type_string - get alert type string +/** + * @brief get alert type string * * @param value - alert value * @@ -1289,8 +1290,8 @@ const char *SSL_alert_desc_string_long(int value); */ const char *SSL_alert_type_string(int value); -/* - * SSL_alert_type_string_long - get alert type long string +/** + * @brief get alert type long string * * @param value - alert value * @@ -1298,8 +1299,8 @@ const char *SSL_alert_type_string(int value); */ const char *SSL_alert_type_string_long(int value); -/* - * SSL_get_SSL_CTX - get SSL context of the SSL +/** + * @brief get SSL context of the SSL * * @param ssl - SSL point * @@ -1307,8 +1308,8 @@ const char *SSL_alert_type_string_long(int value); */ SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl); -/* - * SSL_get_app_data - get SSL application data +/** + * @brief get SSL application data * * @param ssl - SSL point * @@ -1316,8 +1317,8 @@ SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl); */ char *SSL_get_app_data(SSL *ssl); -/* - * SSL_get_cipher_bits - get SSL cipher bits +/** + * @brief get SSL cipher bits * * @param ssl - SSL point * @param alg_bits - algorithm bits @@ -1326,8 +1327,8 @@ char *SSL_get_app_data(SSL *ssl); */ int SSL_get_cipher_bits(const SSL *ssl, int *alg_bits); -/* - * SSL_get_cipher_name - get SSL cipher name +/** + * @brief get SSL cipher name * * @param ssl - SSL point * @@ -1335,8 +1336,8 @@ int SSL_get_cipher_bits(const SSL *ssl, int *alg_bits); */ char *SSL_get_cipher_name(const SSL *ssl); -/* - * SSL_get_cipher_version - get SSL cipher version +/** + * @brief get SSL cipher version * * @param ssl - SSL point * @@ -1344,8 +1345,8 @@ char *SSL_get_cipher_name(const SSL *ssl); */ char *SSL_get_cipher_version(const SSL *ssl); -/* - * SSL_get_ex_data - get SSL extra data +/** + * @brief get SSL extra data * * @param ssl - SSL point * @param idx - data index @@ -1354,8 +1355,8 @@ char *SSL_get_cipher_version(const SSL *ssl); */ char *SSL_get_ex_data(const SSL *ssl, int idx); -/* - * SSL_get_ex_data_X509_STORE_CTX_idx - get index of the SSL extra data X509 storage context +/** + * @brief get index of the SSL extra data X509 storage context * * @param none * @@ -1363,8 +1364,8 @@ char *SSL_get_ex_data(const SSL *ssl, int idx); */ int SSL_get_ex_data_X509_STORE_CTX_idx(void); -/* - * SSL_get_peer_cert_chain - get peer certification chain +/** + * @brief get peer certification chain * * @param ssl - SSL point * @@ -1372,8 +1373,8 @@ int SSL_get_ex_data_X509_STORE_CTX_idx(void); */ STACK *SSL_get_peer_cert_chain(const SSL *ssl); -/* - * SSL_get_peer_certificate - get peer certification +/** + * @brief get peer certification * * @param ssl - SSL point * @@ -1381,8 +1382,8 @@ STACK *SSL_get_peer_cert_chain(const SSL *ssl); */ X509 *SSL_get_peer_certificate(const SSL *ssl); -/* - * SSL_get_quiet_shutdown - get SSL quiet shutdown mode +/** + * @brief get SSL quiet shutdown mode * * @param ssl - SSL point * @@ -1390,8 +1391,8 @@ X509 *SSL_get_peer_certificate(const SSL *ssl); */ int SSL_get_quiet_shutdown(const SSL *ssl); -/* - * SSL_get_rbio - get SSL read only IO handle +/** + * @brief get SSL read only IO handle * * @param ssl - SSL point * @@ -1399,19 +1400,19 @@ int SSL_get_quiet_shutdown(const SSL *ssl); */ BIO *SSL_get_rbio(const SSL *ssl); -/* - * SSL_get_shared_ciphers - get SSL shared ciphers +/** + * @brief get SSL shared ciphers * * @param ssl - SSL point * @param buf - buffer to store the ciphers * @param len - buffer len * - * @return shared ciphers or NULL if failed + * @return shared ciphers */ char *SSL_get_shared_ciphers(const SSL *ssl, char *buf, int len); -/* - * SSL_get_shutdown - get SSL shutdown mode +/** + * @brief get SSL shutdown mode * * @param ssl - SSL point * @@ -1419,8 +1420,8 @@ char *SSL_get_shared_ciphers(const SSL *ssl, char *buf, int len); */ int SSL_get_shutdown(const SSL *ssl); -/* - * SSL_get_time - get SSL session time +/** + * @brief get SSL session time * * @param ssl - SSL point * @@ -1428,8 +1429,8 @@ int SSL_get_shutdown(const SSL *ssl); */ long SSL_get_time(const SSL *ssl); -/* - * SSL_get_timeout - get SSL session timeout time +/** + * @brief get SSL session timeout time * * @param ssl - SSL point * @@ -1437,8 +1438,8 @@ long SSL_get_time(const SSL *ssl); */ long SSL_get_timeout(const SSL *ssl); -/* - * SSL_get_verify_mode - get SSL verifying mode +/** + * @brief get SSL verifying mode * * @param ssl - SSL point * @@ -1446,8 +1447,8 @@ long SSL_get_timeout(const SSL *ssl); */ int SSL_get_verify_mode(const SSL *ssl); -/* - * SSL_get_wbio - get SSL write only IO handle +/** + * @brief get SSL write only IO handle * * @param ssl - SSL point * @@ -1455,8 +1456,8 @@ int SSL_get_verify_mode(const SSL *ssl); */ BIO *SSL_get_wbio(const SSL *ssl); -/* - * SSL_load_client_CA_file - load SSL client CA certification file +/** + * @brief load SSL client CA certification file * * @param file - file name * @@ -1464,44 +1465,44 @@ BIO *SSL_get_wbio(const SSL *ssl); */ STACK *SSL_load_client_CA_file(const char *file); -/* - * SSL_up_ref - add SSL reference by '1' +/** + * @brief add SSL reference by '1' * * @param ssl - SSL point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_up_ref(SSL *ssl); -/* - * SSL_peek - read and put data into buf, but not clear the SSL low-level storage +/** + * @brief read and put data into buf, but not clear the SSL low-level storage * * @param ssl - SSL point * @param buf - storage buffer point * @param num - data bytes * - * @return - * > 0 : OK, and return read bytes - * = 0 : connect is closed - * < 0 : a error catch + * @return result + * > 0 : OK, and return read bytes + * = 0 : connect is closed + * < 0 : a error catch */ int SSL_peek(SSL *ssl, void *buf, int num); -/* - * SSL_renegotiate - make SSL renegotiate +/** + * @brief make SSL renegotiate * * @param ssl - SSL point * - * @return - * 1 : OK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_renegotiate(SSL *ssl); -/* - * SSL_rstate_string - get the state string where SSL is reading +/** + * @brief get the state string where SSL is reading * * @param ssl - SSL point * @@ -1509,8 +1510,8 @@ int SSL_renegotiate(SSL *ssl); */ const char *SSL_rstate_string(SSL *ssl); -/* - * SSL_rstate_string_long - get the statement long string where SSL is reading +/** + * @brief get the statement long string where SSL is reading * * @param ssl - SSL point * @@ -1518,8 +1519,8 @@ const char *SSL_rstate_string(SSL *ssl); */ const char *SSL_rstate_string_long(SSL *ssl); -/* - * SSL_set_accept_state - set SSL accept statement +/** + * @brief set SSL accept statement * * @param ssl - SSL point * @@ -1527,8 +1528,8 @@ const char *SSL_rstate_string_long(SSL *ssl); */ void SSL_set_accept_state(SSL *ssl); -/* - * SSL_set_app_data - set SSL application data +/** + * @brief set SSL application data * * @param ssl - SSL point * @param arg - SSL application data point @@ -1537,8 +1538,8 @@ void SSL_set_accept_state(SSL *ssl); */ void SSL_set_app_data(SSL *ssl, char *arg); -/* - * SSL_set_bio - set SSL BIO +/** + * @brief set SSL BIO * * @param ssl - SSL point * @param rbio - read only IO @@ -1548,8 +1549,8 @@ void SSL_set_app_data(SSL *ssl, char *arg); */ void SSL_set_bio(SSL *ssl, BIO *rbio, BIO *wbio); -/* - * SSL_clear_options - clear SSL option +/** + * @brief clear SSL option * * @param ssl - SSL point * @param op - clear option @@ -1558,8 +1559,8 @@ void SSL_set_bio(SSL *ssl, BIO *rbio, BIO *wbio); */ unsigned long SSL_clear_options(SSL *ssl, unsigned long op); -/* - * SSL_clear_options - get SSL option +/** + * @brief get SSL option * * @param ssl - SSL point * @@ -1567,8 +1568,8 @@ unsigned long SSL_clear_options(SSL *ssl, unsigned long op); */ unsigned long SSL_get_options(SSL *ssl); -/* - * SSL_clear_options - clear SSL option +/** + * @brief clear SSL option * * @param ssl - SSL point * @param op - setting option @@ -1577,8 +1578,8 @@ unsigned long SSL_get_options(SSL *ssl); */ unsigned long SSL_set_options(SSL *ssl, unsigned long op); -/* - * SSL_set_quiet_shutdown - set SSL quiet shutdown mode +/** + * @brief set SSL quiet shutdown mode * * @param ssl - SSL point * @param mode - quiet shutdown mode @@ -1587,8 +1588,8 @@ unsigned long SSL_set_options(SSL *ssl, unsigned long op); */ void SSL_set_quiet_shutdown(SSL *ssl, int mode); -/* - * SSL_set_quiet_shutdown - set SSL shutdown mode +/** + * @brief set SSL shutdown mode * * @param ssl - SSL point * @param mode - shutdown mode @@ -1597,8 +1598,8 @@ void SSL_set_quiet_shutdown(SSL *ssl, int mode); */ void SSL_set_shutdown(SSL *ssl, int mode); -/* - * SSL_set_time - set SSL session time +/** + * @brief set SSL session time * * @param ssl - SSL point * @param t - session time @@ -1607,8 +1608,8 @@ void SSL_set_shutdown(SSL *ssl, int mode); */ void SSL_set_time(SSL *ssl, long t); -/* - * SSL_set_time - set SSL session timeout time +/** + * @brief set SSL session timeout time * * @param ssl - SSL point * @param t - session timeout time @@ -1617,8 +1618,8 @@ void SSL_set_time(SSL *ssl, long t); */ void SSL_set_timeout(SSL *ssl, long t); -/* - * SSL_state_string - get SSL statement string +/** + * @brief get SSL statement string * * @param ssl - SSL point * @@ -1626,8 +1627,8 @@ void SSL_set_timeout(SSL *ssl, long t); */ char *SSL_state_string(const SSL *ssl); -/* - * SSL_state_string_long - get SSL statement long string +/** + * @brief get SSL statement long string * * @param ssl - SSL point * @@ -1635,8 +1636,8 @@ char *SSL_state_string(const SSL *ssl); */ char *SSL_state_string_long(const SSL *ssl); -/* - * SSL_total_renegotiations - get SSL renegotiation count +/** + * @brief get SSL renegotiation count * * @param ssl - SSL point * @@ -1644,8 +1645,8 @@ char *SSL_state_string_long(const SSL *ssl); */ long SSL_total_renegotiations(SSL *ssl); -/* - * SSL_version - get SSL version +/** + * @brief get SSL version * * @param ssl - SSL point * @@ -1653,20 +1654,20 @@ long SSL_total_renegotiations(SSL *ssl); */ int SSL_version(const SSL *ssl); -/* - * SSL_use_psk_identity_hint - set SSL PSK identity hint +/** + * @brief set SSL PSK identity hint * * @param ssl - SSL point * @param hint - identity hint * - * @return - * 1 : oK - * 0 : failed + * @return result + * 1 : OK + * 0 : failed */ int SSL_use_psk_identity_hint(SSL *ssl, const char *hint); -/* - * SSL_get_psk_identity_hint - get SSL PSK identity hint +/** + * @brief get SSL PSK identity hint * * @param ssl - SSL point * @@ -1674,8 +1675,8 @@ int SSL_use_psk_identity_hint(SSL *ssl, const char *hint); */ const char *SSL_get_psk_identity_hint(SSL *ssl); -/* - * SSL_get_psk_identity - get SSL PSK identity +/** + * @brief get SSL PSK identity * * @param ssl - SSL point * diff --git a/components/openssl/library/ssl_cert.c b/components/openssl/library/ssl_cert.c index 2d82e62aa..fd05bc831 100644 --- a/components/openssl/library/ssl_cert.c +++ b/components/openssl/library/ssl_cert.c @@ -18,12 +18,8 @@ #include "ssl_dbg.h" #include "ssl_port.h" -/* - * ssl_cert_new - create a certification object include private key object - * - * @param none - * - * @return certification object point or NULL if failed +/** + * @brief create a certification object include private key object */ CERT *ssl_cert_new(void) { @@ -51,18 +47,14 @@ failed1: return NULL; } -/* - * ssl_cert_free - free a certification object - * - * @param c - certification object point - * - * @return none +/** + * @brief free a certification object */ -void ssl_cert_free(CERT *c) +void ssl_cert_free(CERT *cert) { - X509_free(c->x509); + X509_free(cert->x509); - EVP_PKEY_free(c->pkey); + EVP_PKEY_free(cert->pkey); - ssl_free(c); + ssl_free(cert); } diff --git a/components/openssl/library/ssl_lib.c b/components/openssl/library/ssl_lib.c index ae517b0a4..a84b89e06 100644 --- a/components/openssl/library/ssl_lib.c +++ b/components/openssl/library/ssl_lib.c @@ -21,14 +21,8 @@ #define SSL_SEND_DATA_MAX_LENGTH 1460 -/* - * ossl_statem_in_error - Discover whether the current connection is in the error state - * - * @param ssl - SSL point - * - * @return - * 1 : Yes - * 0 : no +/** + * @brief Discover whether the current connection is in the error state */ int ossl_statem_in_error(const SSL *ssl) { @@ -38,81 +32,48 @@ int ossl_statem_in_error(const SSL *ssl) return 0; } -/* - * SSL_want - get the SSL specifical statement - * - * @param ssl - SSL point - * - * @return specifical statement +/** + * @brief get the SSL specifical statement */ int SSL_want(const SSL *ssl) { return ssl->rwstate; } -/* - * SSL_want_nothing - check if SSL want nothing - * - * @param ssl - SSL point - * - * @return - * 1 : yes - * 0 : no +/** + * @brief check if SSL want nothing */ int SSL_want_nothing(const SSL *ssl) { return (SSL_want(ssl) == SSL_NOTHING); } -/* - * SSL_want_read - check if SSL want to read - * - * @param ssl - SSL point - * - * @return - * 1 : yes - * 0 : no +/** + * @brief check if SSL want to read */ int SSL_want_read(const SSL *ssl) { return (SSL_want(ssl) == SSL_READING); } -/* - * SSL_want_read - check if SSL want to write - * - * @param ssl - SSL point - * - * @return - * 1 : yes - * 0 : no +/** + * @brief check if SSL want to write */ int SSL_want_write(const SSL *ssl) { return (SSL_want(ssl) == SSL_WRITING); } -/* - * SSL_want_read - check if SSL want to lookup X509 certification - * - * @param ssl - SSL point - * - * @return - * 1 : yes - * 0 : no +/** + * @brief check if SSL want to lookup X509 certification */ int SSL_want_x509_lookup(const SSL *ssl) { return (SSL_want(ssl) == SSL_WRITING); } -/* - * SSL_get_error - get SSL error code - * - * @param ssl - SSL point - * @param ret_code - SSL return code - * - * @return SSL error number +/** + * @brief get SSL error code */ int SSL_get_error(const SSL *ssl, int ret_code) { @@ -142,12 +103,8 @@ int SSL_get_error(const SSL *ssl, int ret_code) return ret; } -/* - * SSL_get_state - get the SSL state - * - * @param ssl - SSL point - * - * @return SSL state +/** + * @brief get the SSL state */ OSSL_HANDSHAKE_STATE SSL_get_state(const SSL *ssl) { @@ -160,12 +117,8 @@ OSSL_HANDSHAKE_STATE SSL_get_state(const SSL *ssl) return state; } -/* - * SSL_CTX_new - create a SSL context - * - * @param method - the SSL context configuration file - * - * @return the context point, if create failed return NULL +/** + * @brief create a SSL context */ SSL_CTX* SSL_CTX_new(const SSL_METHOD *method) { @@ -203,12 +156,8 @@ go_failed1: return NULL; } -/* - * SSL_CTX_free - free a SSL context - * - * @param method - the SSL context point - * - * @return none +/** + * @brief free a SSL context */ void SSL_CTX_free(SSL_CTX* ctx) { @@ -221,15 +170,8 @@ void SSL_CTX_free(SSL_CTX* ctx) ssl_free(ctx); } -/* - * SSL_CTX_set_ssl_version - set the SSL context version - * - * @param ctx - SSL context point - * @param meth - SSL method point - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief set the SSL context version */ int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth) { @@ -243,12 +185,8 @@ int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth) return 1; } -/* - * SSL_CTX_get_ssl_method - get the SSL context current method - * - * @param ctx - SSL context point - * - * @return the SSL context current method +/** + * @brief get the SSL context current method */ const SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *ctx) { @@ -257,12 +195,8 @@ const SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *ctx) return ctx->method; } -/* - * SSL_new - create a SSL - * - * @param ctx - the SSL context point - * - * @return the SSL point or NULL if failed +/** + * @brief create a SSL */ SSL *SSL_new(SSL_CTX *ctx) { @@ -300,12 +234,8 @@ failed1: return NULL; } -/* - * SSL_free - free the SSL - * - * @param ssl - the SSL point - * - * @return none +/** + * @brief free the SSL */ void SSL_free(SSL *ssl) { @@ -322,15 +252,8 @@ void SSL_free(SSL *ssl) ssl_free(ssl); } -/* - * SSL_do_handshake - perform the SSL handshake - * - * @param ssl - SSL point - * - * @return - * 1 : OK - * 0 : failed - * -1 : a error catch +/** + * @brief perform the SSL handshake */ int SSL_do_handshake(SSL *ssl) { @@ -343,14 +266,8 @@ int SSL_do_handshake(SSL *ssl) return ret; } -/* - * SSL_connect - connect to the remote SSL server - * - * @param ssl - the SSL point - * - * @return - * 1 : OK - * -1 : failed +/** + * @brief connect to the remote SSL server */ int SSL_connect(SSL *ssl) { @@ -359,14 +276,8 @@ int SSL_connect(SSL *ssl) return SSL_do_handshake(ssl); } -/* - * SSL_accept - accept the remote connection - * - * @param ssl - the SSL point - * - * @return - * 1 : OK - * -1 : failed +/** + * @brief accept the remote connection */ int SSL_accept(SSL *ssl) { @@ -375,15 +286,8 @@ int SSL_accept(SSL *ssl) return SSL_do_handshake(ssl); } -/* - * SSL_shutdown - shutdown the connection - * - * @param ssl - the SSL point - * - * @return - * 1 : OK - * 0 : shutdown is not finished - * -1 : an error catch +/** + * @brief shutdown the connection */ int SSL_shutdown(SSL *ssl) { @@ -398,14 +302,8 @@ int SSL_shutdown(SSL *ssl) return ret; } -/* - * SSL_clear - reset the SSL - * - * @param ssl - SSL point - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief reset the SSL */ int SSL_clear(SSL *ssl) { @@ -429,17 +327,8 @@ go_failed1: return ret; } -/* - * SSL_read - read data from to remote - * - * @param ssl - the SSL point which has been connected - * @param buffer - the received data buffer point - * @param len - the received data length - * - * @return - * > 0 : OK, and return received data bytes - * = 0 : connection is closed - * < 0 : an error catch +/** + * @brief read data from to remote */ int SSL_read(SSL *ssl, void *buffer, int len) { @@ -458,17 +347,8 @@ int SSL_read(SSL *ssl, void *buffer, int len) return ret; } -/* - * SSL_write - send the data to remote - * - * @param ssl - the SSL point which has been connected - * @param buffer - the send data buffer point - * @param len - the send data length - * - * @return - * > 0 : OK, and return sent data bytes - * = 0 : connection is closed - * < 0 : an error catch +/** + * @brief send the data to remote */ int SSL_write(SSL *ssl, const void *buffer, int len) { @@ -511,12 +391,8 @@ int SSL_write(SSL *ssl, const void *buffer, int len) return ret; } -/* - * SSL_get_SSL_CTX - get SSL context of the SSL - * - * @param ssl - SSL point - * - * @return SSL context +/** + * @brief get SSL context of the SSL */ SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl) { @@ -525,12 +401,8 @@ SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl) return ssl->ctx; } -/* - * SSL_CTX_get_ssl_method - get the SSL current method - * - * @param ssl - SSL point - * - * @return the SSL current method +/** + * @brief get the SSL current method */ const SSL_METHOD *SSL_get_ssl_method(SSL *ssl) { @@ -539,15 +411,8 @@ const SSL_METHOD *SSL_get_ssl_method(SSL *ssl) return ssl->method; } -/* - * SSL_set_ssl_method - set the SSL method - * - * @param ssl - SSL point - * @param meth - SSL method point - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief set the SSL method */ int SSL_set_ssl_method(SSL *ssl, const SSL_METHOD *method) { @@ -580,12 +445,8 @@ go_failed1: return ret; } -/* - * SSL_get_shutdown - get SSL shutdown mode - * - * @param ssl - SSL point - * - * @return shutdown mode +/** + * @brief get SSL shutdown mode */ int SSL_get_shutdown(const SSL *ssl) { @@ -594,13 +455,8 @@ int SSL_get_shutdown(const SSL *ssl) return ssl->shutdown; } -/* - * SSL_set_quiet_shutdown - set SSL shutdown mode - * - * @param ssl - SSL point - * @param mode - shutdown mode - * - * @return none +/** + * @brief set SSL shutdown mode */ void SSL_set_shutdown(SSL *ssl, int mode) { @@ -610,12 +466,8 @@ void SSL_set_shutdown(SSL *ssl, int mode) } -/* - * SSL_pending - get the number of the bytes to be read - * - * @param ssl - SSL point - * - * @return number of the bytes +/** + * @brief get the number of the bytes to be read */ int SSL_pending(const SSL *ssl) { @@ -628,14 +480,8 @@ int SSL_pending(const SSL *ssl) return ret; } -/* - * SSL_has_pending - check if some data can be read - * - * @param ssl - SSL point - * - * @return - * 1 : there are bytes to be read - * 0 : no data +/** + * @brief check if some data can be read */ int SSL_has_pending(const SSL *ssl) { @@ -651,52 +497,32 @@ int SSL_has_pending(const SSL *ssl) return ret; } -/* - * SSL_CTX_clear_options - clear the SSL context option bit of "op" - * - * @param ctx - SSL context point - * @param op - option - * - * @return SSL context option +/** + * @brief clear the SSL context option bit of "op" */ unsigned long SSL_CTX_clear_options(SSL_CTX *ctx, unsigned long op) { return ctx->options &= ~op; } -/* - * SSL_CTX_clear_options - get the SSL context option - * - * @param ctx - SSL context point - * @param op - option - * - * @return SSL context option +/** + * @brief get the SSL context option */ unsigned long SSL_CTX_get_options(SSL_CTX *ctx) { return ctx->options; } -/* - * SSL_CTX_set_option - set the option of the SSL context - * - * @param ctx - the SSL context - * - * @return the SSL context option - * +/** + * @brief set the option of the SSL context */ unsigned long SSL_CTX_set_options(SSL_CTX *ctx, unsigned long opt) { return ctx->options |= opt; } -/* - * SSL_clear_options - clear SSL option - * - * @param ssl - SSL point - * @param op - clear option - * - * @return SSL option +/** + * @brief clear SSL option */ unsigned long SSL_clear_options(SSL *ssl, unsigned long op) { @@ -705,12 +531,8 @@ unsigned long SSL_clear_options(SSL *ssl, unsigned long op) return ssl->options & ~op; } -/* - * SSL_clear_options - get SSL option - * - * @param ssl - SSL point - * - * @return SSL option +/** + * @brief get SSL option */ unsigned long SSL_get_options(SSL *ssl) { @@ -719,13 +541,8 @@ unsigned long SSL_get_options(SSL *ssl) return ssl->options; } -/* - * SSL_clear_options - clear SSL option - * - * @param ssl - SSL point - * @param op - setting option - * - * @return SSL option +/** + * @brief clear SSL option */ unsigned long SSL_set_options(SSL *ssl, unsigned long op) { @@ -734,14 +551,8 @@ unsigned long SSL_set_options(SSL *ssl, unsigned long op) return ssl->options |= op; } -/* - * SSL_get_fd - get the socket handle of the SSL - * - * @param ssl - SSL point - * - * @return - * >= 0 : yes, and return socket handle - * < 0 : a error catch +/** + * @brief get the socket handle of the SSL */ int SSL_get_fd(const SSL *ssl) { @@ -754,14 +565,8 @@ int SSL_get_fd(const SSL *ssl) return ret; } -/* - * SSL_get_rfd - get the read only socket handle of the SSL - * - * @param ssl - SSL point - * - * @return - * >= 0 : yes, and return socket handle - * < 0 : a error catch +/** + * @brief get the read only socket handle of the SSL */ int SSL_get_rfd(const SSL *ssl) { @@ -774,14 +579,8 @@ int SSL_get_rfd(const SSL *ssl) return ret; } -/* - * SSL_get_wfd - get the write only socket handle of the SSL - * - * @param ssl - SSL point - * - * @return - * >= 0 : yes, and return socket handle - * < 0 : a error catch +/** + * @brief get the write only socket handle of the SSL */ int SSL_get_wfd(const SSL *ssl) { @@ -794,15 +593,8 @@ int SSL_get_wfd(const SSL *ssl) return ret; } -/* - * SSL_set_fd - bind the socket file description into the SSL - * - * @param ssl - the SSL point - * @param fd - socket handle - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief bind the socket file description into the SSL */ int SSL_set_fd(SSL *ssl, int fd) { @@ -814,15 +606,8 @@ int SSL_set_fd(SSL *ssl, int fd) return 1; } -/* - * SSL_set_fd - bind the read only socket file description into the SSL - * - * @param ssl - the SSL point - * @param fd - socket handle - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief bind the read only socket file description into the SSL */ int SSL_set_rfd(SSL *ssl, int fd) { @@ -834,15 +619,8 @@ int SSL_set_rfd(SSL *ssl, int fd) return 1; } -/* - * SSL_set_fd - bind the write only socket file description into the SSL - * - * @param ssl - the SSL point - * @param fd - socket handle - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief bind the write only socket file description into the SSL */ int SSL_set_wfd(SSL *ssl, int fd) { @@ -854,12 +632,8 @@ int SSL_set_wfd(SSL *ssl, int fd) return 1; } -/* - * SSL_version - get SSL version - * - * @param ssl - SSL point - * - * @return SSL version +/** + * @brief get SSL version */ int SSL_version(const SSL *ssl) { @@ -868,12 +642,8 @@ int SSL_version(const SSL *ssl) return ssl->version; } -/* - * ssl_protocol_to_string - get the SSL version string - * - * @param version - the SSL version - * - * @return the SSL version string +/** + * @brief get the SSL version string */ static const char* ssl_protocol_to_string(int version) { @@ -893,12 +663,8 @@ static const char* ssl_protocol_to_string(int version) return str; } -/* - * SSL_get_version - get the SSL current version - * - * @param ssl - SSL point - * - * @return the version string +/** + * @brief get the SSL current version */ const char *SSL_get_version(const SSL *ssl) { @@ -907,12 +673,8 @@ const char *SSL_get_version(const SSL *ssl) return ssl_protocol_to_string(SSL_version(ssl)); } -/* - * SSL_alert_desc_string - get alert description string - * - * @param value - alert value - * - * @return alert description string +/** + * @brief get alert description string */ const char* SSL_alert_desc_string(int value) { @@ -1018,12 +780,8 @@ const char* SSL_alert_desc_string(int value) return str; } -/* - * SSL_alert_desc_string - get alert description long string - * - * @param value - alert value - * - * @return alert description long string +/** + * @brief get alert description long string */ const char* SSL_alert_desc_string_long(int value) { @@ -1129,12 +887,8 @@ const char* SSL_alert_desc_string_long(int value) return str; } -/* - * SSL_alert_type_string - get alert type string - * - * @param value - alert value - * - * @return alert type string +/** + * @brief get alert type string */ const char *SSL_alert_type_string(int value) { @@ -1156,12 +910,8 @@ const char *SSL_alert_type_string(int value) return str; } -/* - * SSL_alert_type_string_long - get alert type long string - * - * @param value - alert value - * - * @return alert type long string +/** + * @brief get alert type long string */ const char *SSL_alert_type_string_long(int value) { @@ -1183,12 +933,8 @@ const char *SSL_alert_type_string_long(int value) return str; } -/* - * SSL_rstate_string - get the state string where SSL is reading - * - * @param ssl - SSL point - * - * @return state string +/** + * @brief get the state string where SSL is reading */ const char *SSL_rstate_string(SSL *ssl) { @@ -1215,12 +961,8 @@ const char *SSL_rstate_string(SSL *ssl) return str; } -/* - * SSL_rstate_string_long - get the statement long string where SSL is reading - * - * @param ssl - SSL point - * - * @return statement long string +/** + * @brief get the statement long string where SSL is reading */ const char *SSL_rstate_string_long(SSL *ssl) { @@ -1246,12 +988,8 @@ const char *SSL_rstate_string_long(SSL *ssl) return str; } -/* - * SSL_state_string - get SSL statement string - * - * @param ssl - SSL point - * - * @return SSL statement string +/** + * @brief get SSL statement string */ char *SSL_state_string(const SSL *ssl) { @@ -1358,12 +1096,8 @@ char *SSL_state_string(const SSL *ssl) return str; } -/* - * SSL_state_string_long - get SSL statement long string - * - * @param ssl - SSL point - * - * @return SSL statement long string +/** + * @brief get SSL statement long string */ char *SSL_state_string_long(const SSL *ssl) { @@ -1476,13 +1210,8 @@ char *SSL_state_string_long(const SSL *ssl) return str; } -/* - * SSL_CTX_set_default_read_buffer_len - set the SSL context read buffer length - * - * @param ctx - SSL context point - * @param len - read buffer length - * - * @return none +/** + * @brief set the SSL context read buffer length */ void SSL_CTX_set_default_read_buffer_len(SSL_CTX *ctx, size_t len) { @@ -1492,13 +1221,8 @@ void SSL_CTX_set_default_read_buffer_len(SSL_CTX *ctx, size_t len) ctx->read_buffer_len = len; } -/* - * SSL_set_default_read_buffer_len - set the SSL read buffer length - * - * @param ssl - SSL point - * @param len - read buffer length - * - * @return none +/** + * @brief set the SSL read buffer length */ void SSL_set_default_read_buffer_len(SSL *ssl, size_t len) { @@ -1508,13 +1232,8 @@ void SSL_set_default_read_buffer_len(SSL *ssl, size_t len) SSL_METHOD_CALL(set_bufflen, ssl, len); } -/* - * SSL_set_info_callback - set the SSL information callback function - * - * @param ssl - SSL point - * @param cb - information callback function - * - * @return none +/** + * @brief set the SSL information callback function */ void SSL_set_info_callback(SSL *ssl, void (*cb) (const SSL *ssl, int type, int val)) { @@ -1523,32 +1242,23 @@ void SSL_set_info_callback(SSL *ssl, void (*cb) (const SSL *ssl, int type, int v ssl->info_callback = cb; } -/* - * SSL_CTX_up_ref - add SSL context reference count by '1' - * - * @param ctx - SSL context point - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief add SSL context reference count by '1' */ int SSL_CTX_up_ref(SSL_CTX *ctx) { SSL_ASSERT(ctx); - /* no support multi-thread SSL here */ + /** + * no support multi-thread SSL here + */ ctx->references++; return 1; } -/* - * SSL_set_security_level - set the SSL security level - * - * @param ssl - SSL point - * @param level - security level - * - * @return none +/** + * @brief set the SSL security level */ void SSL_set_security_level(SSL *ssl, int level) { @@ -1557,12 +1267,8 @@ void SSL_set_security_level(SSL *ssl, int level) ssl->cert->sec_level = level; } -/* - * SSL_get_security_level - get the SSL security level - * - * @param ssl - SSL point - * - * @return security level +/** + * @brief get the SSL security level */ int SSL_get_security_level(const SSL *ssl) { @@ -1571,12 +1277,8 @@ int SSL_get_security_level(const SSL *ssl) return ssl->cert->sec_level; } -/* - * SSL_CTX_get_verify_mode - get the SSL verifying mode of the SSL context - * - * @param ctx - SSL context point - * - * @return verifying mode +/** + * @brief get the SSL verifying mode of the SSL context */ int SSL_CTX_get_verify_mode(const SSL_CTX *ctx) { @@ -1585,13 +1287,8 @@ int SSL_CTX_get_verify_mode(const SSL_CTX *ctx) return ctx->verify_mode; } -/* - * SSL_CTX_set_timeout - set the session timeout time - * - * @param ctx - SSL context point - * @param t - new session timeout time - * - * @return old session timeout time +/** + * @brief set the session timeout time */ long SSL_CTX_set_timeout(SSL_CTX *ctx, long t) { @@ -1605,12 +1302,8 @@ long SSL_CTX_set_timeout(SSL_CTX *ctx, long t) return l; } -/* - * SSL_CTX_get_timeout - get the session timeout time - * - * @param ctx - SSL context point - * - * @return current session timeout time +/** + * @brief get the session timeout time */ long SSL_CTX_get_timeout(const SSL_CTX *ctx) { @@ -1619,13 +1312,8 @@ long SSL_CTX_get_timeout(const SSL_CTX *ctx) return ctx->session_timeout; } -/* - * SSL_set_read_ahead - set the SSL if we can read as many as data - * - * @param ssl - SSL point - * @param yes - enable the function - * - * @return none +/** + * @brief set the SSL if we can read as many as data */ void SSL_set_read_ahead(SSL *ssl, int yes) { @@ -1634,13 +1322,8 @@ void SSL_set_read_ahead(SSL *ssl, int yes) ssl->rlayer.read_ahead = yes; } -/* - * SSL_set_read_ahead - set the SSL context if we can read as many as data - * - * @param ctx - SSL context point - * @param yes - enable the function - * - * @return none +/** + * @brief set the SSL context if we can read as many as data */ void SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes) { @@ -1649,12 +1332,8 @@ void SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes) ctx->read_ahead = yes; } -/* - * SSL_set_read_ahead - get the SSL ahead signal if we can read as many as data - * - * @param ssl - SSL point - * - * @return SSL context ahead signal +/** + * @brief get the SSL ahead signal if we can read as many as data */ int SSL_get_read_ahead(const SSL *ssl) { @@ -1663,12 +1342,8 @@ int SSL_get_read_ahead(const SSL *ssl) return ssl->rlayer.read_ahead; } -/* - * SSL_set_read_ahead - get the SSL context ahead signal if we can read as many as data - * - * @param ctx - SSL context point - * - * @return SSL context ahead signal +/** + * @brief get the SSL context ahead signal if we can read as many as data */ long SSL_CTX_get_read_ahead(SSL_CTX *ctx) { @@ -1677,14 +1352,8 @@ long SSL_CTX_get_read_ahead(SSL_CTX *ctx) return ctx->read_ahead; } -/* - * SSL_CTX_get_ciphers - check if the SSL context can read as many as data - * - * @param ctx - SSL context point - * - * @return - * 1 : Yes - * 0 : No +/** + * @brief check if the SSL context can read as many as data */ long SSL_CTX_get_default_read_ahead(SSL_CTX *ctx) { @@ -1693,13 +1362,8 @@ long SSL_CTX_get_default_read_ahead(SSL_CTX *ctx) return ctx->read_ahead; } -/* - * SSL_set_time - set SSL session time - * - * @param ssl - SSL point - * @param t - session time - * - * @return session time +/** + * @brief set SSL session time */ long SSL_set_time(SSL *ssl, long t) { @@ -1710,13 +1374,8 @@ long SSL_set_time(SSL *ssl, long t) return t; } -/* - * SSL_set_time - set SSL session timeout time - * - * @param ssl - SSL point - * @param t - session timeout time - * - * @return session timeout time +/** + * @brief set SSL session timeout time */ long SSL_set_timeout(SSL *ssl, long t) { @@ -1727,12 +1386,8 @@ long SSL_set_timeout(SSL *ssl, long t) return t; } -/* - * SSL_get_verify_result - get the verifying result of the SSL certification - * - * @param ssl - the SSL point - * - * @return the result of verifying +/** + * @brief get the verifying result of the SSL certification */ long SSL_get_verify_result(const SSL *ssl) { @@ -1741,12 +1396,8 @@ long SSL_get_verify_result(const SSL *ssl) return SSL_METHOD_CALL(get_verify_result, ssl); } -/* - * SSL_CTX_get_verify_depth - get the SSL verifying depth of the SSL context - * - * @param ctx - SSL context point - * - * @return verifying depth +/** + * @brief get the SSL verifying depth of the SSL context */ int SSL_CTX_get_verify_depth(const SSL_CTX *ctx) { @@ -1755,13 +1406,8 @@ int SSL_CTX_get_verify_depth(const SSL_CTX *ctx) return ctx->param.depth; } -/* - * SSL_CTX_set_verify_depth - set the SSL verify depth of the SSL context - * - * @param ctx - SSL context point - * @param depth - verifying depth - * - * @return one +/** + * @brief set the SSL verify depth of the SSL context */ void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth) { @@ -1770,12 +1416,8 @@ void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth) ctx->param.depth = depth; } -/* - * SSL_get_verify_depth - get the SSL verifying depth of the SSL - * - * @param ctx - SSL point - * - * @return verifying depth +/** + * @brief get the SSL verifying depth of the SSL */ int SSL_get_verify_depth(const SSL *ssl) { @@ -1784,13 +1426,8 @@ int SSL_get_verify_depth(const SSL *ssl) return ssl->param.depth; } -/* - * SSL_set_verify_depth - set the SSL verify depth of the SSL - * - * @param ctx - SSL point - * @param depth - verifying depth - * - * @return one +/** + * @brief set the SSL verify depth of the SSL */ void SSL_set_verify_depth(SSL *ssl, int depth) { @@ -1799,14 +1436,8 @@ void SSL_set_verify_depth(SSL *ssl, int depth) ssl->param.depth = depth; } -/* - * SSL_CTX_set_verify - set the SSL context verifying of the SSL context - * - * @param ctx - SSL context point - * @param mode - verifying mode - * @param verify_callback - verifying callback function - * - * @return none +/** + * @brief set the SSL context verifying of the SSL context */ void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, int (*verify_callback)(int, X509_STORE_CTX *)) { @@ -1816,14 +1447,8 @@ void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, int (*verify_callback)(int, X509 ctx->default_verify_callback = verify_callback; } -/* - * SSL_set_verify - set the SSL verifying of the SSL context - * - * @param ctx - SSL point - * @param mode - verifying mode - * @param verify_callback - verifying callback function - * - * @return none +/** + * @brief set the SSL verifying of the SSL context */ void SSL_set_verify(SSL *ssl, int mode, int (*verify_callback)(int, X509_STORE_CTX *)) { diff --git a/components/openssl/library/ssl_methods.c b/components/openssl/library/ssl_methods.c index c6fb40e59..042d670ab 100644 --- a/components/openssl/library/ssl_methods.c +++ b/components/openssl/library/ssl_methods.c @@ -16,7 +16,7 @@ #include "ssl_methods.h" #include "ssl_pm.h" -/* +/** * TLS method function collection */ IMPLEMENT_TLS_METHOD_FUNC(TLS_method_func, @@ -28,7 +28,7 @@ IMPLEMENT_TLS_METHOD_FUNC(TLS_method_func, ssl_pm_get_verify_result, ssl_pm_get_state); -/* +/** * TLS or SSL client method collection */ IMPLEMENT_TLS_METHOD(TLS_ANY_VERSION, 0, TLS_method_func, TLS_client_method); @@ -41,7 +41,7 @@ IMPLEMENT_TLS_METHOD(TLS1_VERSION, 0, TLS_method_func, TLSv1_client_method); IMPLEMENT_SSL_METHOD(SSL3_VERSION, 0, TLS_method_func, SSLv3_client_method); -/* +/** * TLS or SSL server method collection */ IMPLEMENT_TLS_METHOD(TLS_ANY_VERSION, 1, TLS_method_func, TLS_server_method); @@ -54,7 +54,7 @@ IMPLEMENT_TLS_METHOD(TLS1_VERSION, 0, TLS_method_func, TLSv1_server_method); IMPLEMENT_SSL_METHOD(SSL3_VERSION, 1, TLS_method_func, SSLv3_server_method); -/* +/** * TLS or SSL method collection */ IMPLEMENT_TLS_METHOD(TLS_ANY_VERSION, -1, TLS_method_func, TLS_method); @@ -67,15 +67,15 @@ IMPLEMENT_SSL_METHOD(TLS1_VERSION, -1, TLS_method_func, TLSv1_method); IMPLEMENT_SSL_METHOD(SSL3_VERSION, -1, TLS_method_func, SSLv3_method); -/* - * X509 certification method collection +/** + * @brief get X509 object method */ IMPLEMENT_X509_METHOD(X509_method, x509_pm_new, x509_pm_free, x509_pm_load, x509_pm_unload); -/* - * private key method collection +/** + * @brief get private key object method */ IMPLEMENT_PKEY_METHOD(EVP_PKEY_method, pkey_pm_new, pkey_pm_free, diff --git a/components/openssl/library/ssl_pkey.c b/components/openssl/library/ssl_pkey.c index e13870344..6f51963eb 100644 --- a/components/openssl/library/ssl_pkey.c +++ b/components/openssl/library/ssl_pkey.c @@ -19,12 +19,8 @@ #include "ssl_dbg.h" #include "ssl_port.h" -/* - * EVP_PKEY_new - create a private key object - * - * @param none - * - * @return private key object point or NULL if failed +/** + * @brief create a private key object */ EVP_PKEY* EVP_PKEY_new(void) { @@ -49,12 +45,8 @@ failed1: return NULL; } -/* - * EVP_PKEY_free - free a private key object - * - * @param pkey - private key object point - * - * @return none +/** + * @brief free a private key object */ void EVP_PKEY_free(EVP_PKEY *pkey) { @@ -63,16 +55,9 @@ void EVP_PKEY_free(EVP_PKEY *pkey) ssl_free(pkey); } -/* - * d2i_PrivateKey - load a character key context into system context. If '*a' is pointed to the - * private key, then load key into it. Or create a new private key object - * - * @param type - private key type - * @param a - a point pointed to a private key point - * @param pp - a point pointed to the key context memory point - * @param length - key bytes - * - * @return private key object point or NULL if failed +/** + * @brief load a character key context into system context. If '*a' is pointed to the + * private key, then load key into it. Or create a new private key object */ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, @@ -112,15 +97,8 @@ failed1: return NULL; } -/* - * SSL_CTX_use_certificate - set the SSL context private key - * - * @param ctx - SSL context point - * @param x - private key point - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief set the SSL context private key */ int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey) { @@ -135,15 +113,8 @@ int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey) return 1; } -/* - * SSL_CTX_use_certificate - set the SSL private key - * - * @param ctx - SSL point - * @param x - private key point - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief set the SSL private key */ int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey) { @@ -163,17 +134,8 @@ int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey) return 1; } -/* - * SSL_CTX_use_PrivateKey_ASN1 - load private key into the SSL context - * - * @param type - private key type - * @param ctx - SSL context point - * @param d - private key context point - * @param len - private key context bytes - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief load private key into the SSL context */ int SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, const unsigned char *d, long len) @@ -197,17 +159,8 @@ failed1: return 0; } -/* - * SSL_use_PrivateKey_ASN1 - load private key into the SSL - * - * @param type - private key type - * @param ctx - SSL context point - * @param d - private key context point - * @param len - private key context bytes - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief load private key into the SSL */ int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, const unsigned char *d, long len) @@ -255,48 +208,24 @@ failed1: return 0; } -/* - * SSL_CTX_use_certificate_file - load the private key file into SSL context - * - * @param ctx - SSL context point - * @param file - private key file name - * @param type - private key encoding type - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief load the private key file into SSL context */ int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type) { return 0; } -/* - * SSL_use_PrivateKey_file - load the private key file into SSL - * - * @param ctx - SSL point - * @param file - private key file name - * @param type - private key encoding type - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief load the private key file into SSL */ int SSL_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type) { return 0; } -/* - * SSL_CTX_use_certificate_ASN1 - load the RSA ASN1 private key into SSL context - * - * @param ctx - SSL context point - * @param d - data point - * @param len - RSA private key length - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief load the RSA ASN1 private key into SSL context */ int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, long len) { diff --git a/components/openssl/library/ssl_x509.c b/components/openssl/library/ssl_x509.c index 6eb3c1d46..e96511dc4 100644 --- a/components/openssl/library/ssl_x509.c +++ b/components/openssl/library/ssl_x509.c @@ -18,12 +18,8 @@ #include "ssl_dbg.h" #include "ssl_port.h" -/* - * sk_X509_NAME_new_null - create a X509 certification object - * - * @param none - * - * @return X509 certification object point or NULL if failed +/** + * @brief create a X509 certification object */ X509* X509_new(void) { @@ -48,12 +44,8 @@ failed1: return NULL; } -/* - * X509_free - free a X509 certification object - * - * @param x - X509 certification object point - * - * @return none +/** + * @brief free a X509 certification object */ void X509_free(X509 *x) { @@ -62,15 +54,9 @@ void X509_free(X509 *x) ssl_free(x); }; -/* - * d2i_X509 - load a character certification context into system context. If '*cert' is pointed to the - * certification, then load certification into it. Or create a new X509 certification object - * - * @param cert - a point pointed to X509 certification - * @param buffer - a point pointed to the certification context memory point - * @param length - certification bytes - * - * @return X509 certification object point or NULL if failed +/** + * @brief load a character certification context into system context. If '*cert' is pointed to the + * certification, then load certification into it. Or create a new X509 certification object */ X509* d2i_X509(X509 **cert, const unsigned char *buffer, long len) { @@ -103,15 +89,8 @@ failed1: return NULL; } -/* - * SSL_CTX_add_client_CA - set SSL context client CA certification - * - * @param ctx - SSL context point - * @param x - client CA certification point - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief set SSL context client CA certification */ int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x) { @@ -126,15 +105,8 @@ int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x) return 1; } -/* - * SSL_add_client_CA - add CA client certification into the SSL - * - * @param ssl - SSL point - * @param x - CA certification point - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief add CA client certification into the SSL */ int SSL_add_client_CA(SSL *ssl, X509 *x) { @@ -151,15 +123,8 @@ int SSL_add_client_CA(SSL *ssl, X509 *x) return 1; } -/* - * SSL_CTX_use_certificate - set the SSL context certification - * - * @param ctx - SSL context point - * @param x - X509 certification point - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief set the SSL context certification */ int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x) { @@ -171,15 +136,8 @@ int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x) return 1; } -/* - * SSL_CTX_use_certificate - set the SSL certification - * - * @param ctx - SSL point - * @param x - X509 certification point - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief set the SSL certification */ int SSL_use_certificate(SSL *ssl, X509 *x) { @@ -191,12 +149,8 @@ int SSL_use_certificate(SSL *ssl, X509 *x) return 1; } -/* - * SSL_get_certificate - get the SSL certification point - * - * @param ssl - SSL point - * - * @return SSL certification point +/** + * @brief get the SSL certification point */ X509 *SSL_get_certificate(const SSL *ssl) { @@ -205,16 +159,8 @@ X509 *SSL_get_certificate(const SSL *ssl) return ssl->cert->x509; } -/* - * SSL_CTX_use_certificate_ASN1 - load certification into the SSL context - * - * @param ctx - SSL context point - * @param len - certification context bytes - * @param d - certification context point - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief load certification into the SSL context */ int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, const unsigned char *d) @@ -238,16 +184,8 @@ failed1: return 0; } -/* - * SSL_use_certificate_ASN1 - load certification into the SSL - * - * @param ctx - SSL point - * @param len - certification context bytes - * @param d - certification context point - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief load certification into the SSL */ int SSL_use_certificate_ASN1(SSL *ssl, int len, const unsigned char *d) @@ -295,44 +233,24 @@ failed1: return 0; } -/* - * SSL_CTX_use_certificate_file - load the certification file into SSL context - * - * @param ctx - SSL context point - * @param file - certification file name - * @param type - certification encoding type - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief load the certification file into SSL context */ int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type) { return 0; } -/* - * SSL_use_certificate_file - load the certification file into SSL - * - * @param ctx - SSL point - * @param file - certification file name - * @param type - certification encoding type - * - * @return - * 1 : OK - * 0 : failed +/** + * @brief load the certification file into SSL */ int SSL_use_certificate_file(SSL *ssl, const char *file, int type) { return 0; } -/* - * SSL_get_peer_certificate - get peer certification - * - * @param ssl - SSL point - * - * @return certification +/** + * @brief get peer certification */ X509 *SSL_get_peer_certificate(const SSL *ssl) { diff --git a/components/openssl/platform/ssl_pm.c b/components/openssl/platform/ssl_pm.c index b03aee3e3..9abfc212e 100644 --- a/components/openssl/platform/ssl_pm.c +++ b/components/openssl/platform/ssl_pm.c @@ -62,6 +62,9 @@ unsigned int max_content_len; /*********************************************************************************************/ /************************************ SSL arch interface *************************************/ +/** + * @brief create SSL low-level object + */ int ssl_pm_new(SSL *ssl) { struct ssl_pm *ssl_pm; @@ -140,6 +143,9 @@ failed1: return -1; } +/** + * @brief free SSL low-level object + */ void ssl_pm_free(SSL *ssl) { struct ssl_pm *ssl_pm = (struct ssl_pm *)ssl->ssl_pm; @@ -156,6 +162,9 @@ void ssl_pm_free(SSL *ssl) ssl->ssl_pm = NULL; } +/** + * @brief reload SSL low-level certification object + */ static int ssl_pm_reload_crt(SSL *ssl) { int ret;