mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
clear the error you get if you get a NULL engine back
This commit is contained in:
parent
f8c53ea2d8
commit
6f45b8762c
1 changed files with 5 additions and 4 deletions
|
|
@ -175,11 +175,12 @@ static RAND_METHOD osrandom_rand = {
|
|||
};
|
||||
|
||||
int Cryptography_add_osrandom_engine(void) {
|
||||
ENGINE *engine = ENGINE_by_id(Cryptography_osrandom_engine_id);
|
||||
if (engine != NULL) {
|
||||
// The engine has already been added,
|
||||
ENGINE_free(engine);
|
||||
ENGINE *osrandom_engine = ENGINE_by_id(Cryptography_osrandom_engine_id);
|
||||
if (osrandom_engine != NULL) {
|
||||
ENGINE_free(osrandom_engine);
|
||||
return 2;
|
||||
} else {
|
||||
ERR_clear_error();
|
||||
}
|
||||
|
||||
ENGINE *e = ENGINE_new();
|
||||
|
|
|
|||
Loading…
Reference in a new issue