mirror of
https://github.com/nginx/nginx.git
synced 2026-10-22 12:01:09 +00: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
1 changed files with 6 additions and 4 deletions
|
|
@ -652,10 +652,12 @@ ngx_ssl_rsa512_key_callback(ngx_ssl_conn_t *ssl_conn, int is_export,
|
|||
{
|
||||
static RSA *key;
|
||||
|
||||
if (key_length == 512) {
|
||||
if (key == NULL) {
|
||||
key = RSA_generate_key(512, RSA_F4, NULL, NULL);
|
||||
}
|
||||
if (key_length != 512) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (key == NULL) {
|
||||
key = RSA_generate_key(512, RSA_F4, NULL, NULL);
|
||||
}
|
||||
|
||||
return key;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue