tls: Support a maximum TLS version to negotiate using TLS socket abstraction
This commit is contained in:
@@ -407,7 +407,7 @@ METHOD(tls_socket_t, destroy, void,
|
||||
*/
|
||||
tls_socket_t *tls_socket_create(bool is_server, identification_t *server,
|
||||
identification_t *peer, int fd, tls_cache_t *cache,
|
||||
bool nullok)
|
||||
tls_version_t max_version, bool nullok)
|
||||
{
|
||||
private_tls_socket_t *this;
|
||||
tls_purpose_t purpose;
|
||||
@@ -448,6 +448,7 @@ tls_socket_t *tls_socket_create(bool is_server, identification_t *server,
|
||||
free(this);
|
||||
return NULL;
|
||||
}
|
||||
this->tls->set_version(this->tls, max_version);
|
||||
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
@@ -104,11 +104,12 @@ struct tls_socket_t {
|
||||
* @param peer client identity, NULL for no client authentication
|
||||
* @param fd socket to read/write from
|
||||
* @param cache session cache to use, or NULL
|
||||
* @param max_version maximun TLS version to negotiate
|
||||
* @param nullok accept NULL encryption ciphers
|
||||
* @return TLS socket wrapper
|
||||
*/
|
||||
tls_socket_t *tls_socket_create(bool is_server, identification_t *server,
|
||||
identification_t *peer, int fd, tls_cache_t *cache,
|
||||
bool nullok);
|
||||
tls_version_t max_version, bool nullok);
|
||||
|
||||
#endif /** TLS_SOCKET_H_ @}*/
|
||||
|
||||
Reference in New Issue
Block a user