mirror of
https://github.com/openssl/openssl.git
synced 2025-04-06 20:20:50 +08:00
If the first serializer we find is the desired one that's ok
Stop looking for a desired serializer if the first one is desired. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11271)
This commit is contained in:
parent
55ecb812b1
commit
0e6f62e3e1
@ -121,13 +121,13 @@ static void select_serializer(const char *name, void *data)
|
||||
return;
|
||||
|
||||
if ((s = OSSL_SERIALIZER_fetch(d->libctx, name, d->propquery)) != NULL) {
|
||||
if (d->first == NULL && s->serialize_data != NULL) {
|
||||
d->first = s;
|
||||
} else if (OSSL_SERIALIZER_provider(s) == d->desired_provider
|
||||
&& s->serialize_object != NULL) {
|
||||
if (OSSL_SERIALIZER_provider(s) == d->desired_provider
|
||||
&& s->serialize_object != NULL) {
|
||||
OSSL_SERIALIZER_free(d->first);
|
||||
d->first = NULL;
|
||||
d->desired = s;
|
||||
} else if (d->first == NULL && s->serialize_data != NULL) {
|
||||
d->first = s;
|
||||
} else {
|
||||
OSSL_SERIALIZER_free(s);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user