Skip to content

Commit

Permalink
allow value 0 for purpose to be set using X509_PURPOSE_set()
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeev-0 committed Nov 5, 2024
1 parent df3bd7c commit 7e54929
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/x509/v3_purp.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int X509_check_purpose(X509 *x, int id, int non_leaf)

int X509_PURPOSE_set(int *p, int purpose)
{
if (X509_PURPOSE_get_by_id(purpose) == -1) {
if (purpose != 0 && X509_PURPOSE_get_by_id(purpose) == -1) {
ERR_raise(ERR_LIB_X509V3, X509V3_R_INVALID_PURPOSE);
return 0;
}
Expand Down

0 comments on commit 7e54929

Please sign in to comment.