mirror of
https://github.com/nginx/nginx.git
synced 2024-12-02 20:09:01 +08:00
SSL: return temporary RSA key only when the key length matches.
This change is mostly cosmetic, because in practice this callback is used only for 512-bit RSA keys. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
This commit is contained in:
parent
f0e05f3d89
commit
bd058b9d24
@ -652,10 +652,12 @@ ngx_ssl_rsa512_key_callback(ngx_ssl_conn_t *ssl_conn, int is_export,
|
|||||||
{
|
{
|
||||||
static RSA *key;
|
static RSA *key;
|
||||||
|
|
||||||
if (key_length == 512) {
|
if (key_length != 512) {
|
||||||
if (key == NULL) {
|
return NULL;
|
||||||
key = RSA_generate_key(512, RSA_F4, NULL, NULL);
|
}
|
||||||
}
|
|
||||||
|
if (key == NULL) {
|
||||||
|
key = RSA_generate_key(512, RSA_F4, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return key;
|
return key;
|
||||||
|
Loading…
Reference in New Issue
Block a user