-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend SSL client API #289
base: v6.x.x
Are you sure you want to change the base?
Extend SSL client API #289
Conversation
Add client API functions to get the cipher name and protocol version of the established connection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments and a change requested.
@@ -58,6 +58,36 @@ DRIZZLE_API | |||
drizzle_return_t drizzle_set_ssl(drizzle_st *con, const char *key, | |||
const char *cert, const char *ca, const char *capath, const char *cipher); | |||
|
|||
/** | |||
* @brief Get a pointer to the name of the cipher used current established | |||
* connection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used in the currently established connection
?
* If the cipher is NULL, cipher is set to "(NONE)". | ||
* | ||
* param[in] con A connection object | ||
* param[out] cipher reference to a const char pointer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should Reference
be capitalised?
/** | ||
* @brief Get the string which indicates the SSL/TLS protocol version that first | ||
* defined the cipher, or in the case the SSL/TLS protocol negotiated between | ||
* client and server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to reword the or in the case ...
section.
* client and server. | ||
* | ||
* This is currently SSLv2 or TLSv1/SSLv3. In some cases it | ||
* should possibly return "TLSv1.2" but does not; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why doesn't it?
* | ||
* This is currently SSLv2 or TLSv1/SSLv3. In some cases it | ||
* should possibly return "TLSv1.2" but does not; | ||
* If cipher is NULL, "(NONE)" `cipher` is set to "(NONE)". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"(NONE)" cipher
is set to "(NONE)"?
} | ||
|
||
const SSL_CIPHER *cipher; | ||
cipher = SSL_get_current_cipher((SSL *)con->ssl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not combine the above two lines?
*cipher_version = SSL_CIPHER_get_version(cipher); | ||
return DRIZZLE_RETURN_OK; | ||
} | ||
|
||
#else | ||
|
||
drizzle_return_t drizzle_set_ssl(drizzle_st*, const char*, const char*, const char*, const char*, const char*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this now missing:
{
return DRIZZLE_RETURN_INVALID_ARGUMENT;
}
Thanks for the review. After reading a book on OpenSSL, it seems like the semantics of |
Add client API functions to get the cipher name and
protocol version of the established connection