Skip to content

Commit

Permalink
utils: Do not propagate OpenSSL errors when non-mandatory attribute i…
Browse files Browse the repository at this point in the history
…s missing

The fallback is handled for multiple attributes, but not for single
attribute, which is not recognized by the module. This is demonstrated
by softokn and the CKA_ALLOWED_MECHANISMS attribute.

Signed-off-by: Jakub Jelen <[email protected]>
  • Loading branch information
Jakuje committed Oct 23, 2024
1 parent 0ef56dc commit 3a873fd
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,8 @@ CK_RV p11prov_fetch_attributes(P11PROV_CTX *ctx, P11PROV_SESSION *session,
ret = CKR_OK;
}
done:
if (ret == CKR_OK) {
/* if there was any error, remove it, as we got success */
p11prov_pop_error_to_mark(ctx);
} else {
/* otherwise clear the mark and leave errors on the stack */
p11prov_clear_last_error_mark(ctx);
}
/* if there was any error, remove it, as it will be handled by the caller */
p11prov_pop_error_to_mark(ctx);
return ret;
}

Expand Down

0 comments on commit 3a873fd

Please sign in to comment.