wininet: Set SECURITY_FLAG_STRENGTH_* flags in NETCONN_secure_connect.
This commit is contained in:
parent
90ec92dfd1
commit
f3dd75d8a4
|
@ -1999,16 +1999,9 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe
|
|||
|
||||
*size = sizeof(DWORD);
|
||||
flags = req->netconn ? req->netconn->security_flags : req->security_flags | req->server->security_flags;
|
||||
if(req->netconn) {
|
||||
int bits = NETCON_GetCipherStrength(req->netconn);
|
||||
if (bits >= 128)
|
||||
flags |= SECURITY_FLAG_STRENGTH_STRONG;
|
||||
else if (bits >= 56)
|
||||
flags |= SECURITY_FLAG_STRENGTH_MEDIUM;
|
||||
else
|
||||
flags |= SECURITY_FLAG_STRENGTH_WEAK;
|
||||
}
|
||||
*(DWORD *)buffer = flags;
|
||||
|
||||
TRACE("INTERNET_OPTION_SECURITY_FLAGS %x\n", flags);
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -688,6 +688,7 @@ DWORD NETCON_secure_connect(netconn_t *connection)
|
|||
DWORD res = ERROR_NOT_SUPPORTED;
|
||||
#ifdef SONAME_LIBSSL
|
||||
void *ssl_s;
|
||||
int bits;
|
||||
|
||||
/* can't connect if we are already connected */
|
||||
if (connection->ssl_s)
|
||||
|
@ -730,7 +731,15 @@ DWORD NETCON_secure_connect(netconn_t *connection)
|
|||
|
||||
connection->ssl_s = ssl_s;
|
||||
|
||||
bits = NETCON_GetCipherStrength(connection);
|
||||
if (bits >= 128)
|
||||
connection->security_flags |= SECURITY_FLAG_STRENGTH_STRONG;
|
||||
else if (bits >= 56)
|
||||
connection->security_flags |= SECURITY_FLAG_STRENGTH_MEDIUM;
|
||||
else
|
||||
connection->security_flags |= SECURITY_FLAG_STRENGTH_WEAK;
|
||||
connection->security_flags |= SECURITY_FLAG_SECURE;
|
||||
|
||||
connection->server->security_flags = connection->security_flags;
|
||||
return ERROR_SUCCESS;
|
||||
|
||||
|
|
Loading…
Reference in New Issue