mirror of
https://github.com/nginx/nginx.git
synced 2025-07-22 04:18:34 +08:00
SSL: fixed possible configuration overwrite loading "engine:" keys.
When loading certificate keys via ENGINE_load_private_key() in runtime, it was possible to overwrite configuration on ENGINE_by_id() failure. OpenSSL documention doesn't describe errors in details, the only reason I found in the comment to example is when the engine is not available.
This commit is contained in:
parent
a7e3cd52e0
commit
6f7494081a
@ -764,13 +764,13 @@ ngx_ssl_load_certificate_key(ngx_pool_t *pool, char **err,
|
|||||||
|
|
||||||
engine = ENGINE_by_id((char *) p);
|
engine = ENGINE_by_id((char *) p);
|
||||||
|
|
||||||
|
*last++ = ':';
|
||||||
|
|
||||||
if (engine == NULL) {
|
if (engine == NULL) {
|
||||||
*err = "ENGINE_by_id() failed";
|
*err = "ENGINE_by_id() failed";
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
*last++ = ':';
|
|
||||||
|
|
||||||
pkey = ENGINE_load_private_key(engine, (char *) last, 0, 0);
|
pkey = ENGINE_load_private_key(engine, (char *) last, 0, 0);
|
||||||
|
|
||||||
if (pkey == NULL) {
|
if (pkey == NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user