Skip to content

Fix the bug that validate flag is not set when the SAN(SubjectAltName) matching is performed#16816

Merged
yanavlasov merged 11 commits intoenvoyproxy:mainfrom
tyxia:fix
Jun 22, 2021
Merged

Fix the bug that validate flag is not set when the SAN(SubjectAltName) matching is performed#16816
yanavlasov merged 11 commits intoenvoyproxy:mainfrom
tyxia:fix

Conversation

@tyxia
Copy link
Copy Markdown
Member

@tyxia tyxia commented Jun 4, 2021

When SAN(SubjectAltName) matching with the provided matchers is the only verification performed and matching succeeds, the validated flag is not updated properly(i.e. left as NotValidated) and the function return wrong status code.

Add the unit test:

  1. Create DefaultValidator object with NULL certificateValidationContext (i.e no validation context). This ensures that the certificate verification later will be only performed on the SAN matcher arg provided in step#3
  2. Create the cert from test data file.
  3. Provide the SAN matcher as only input and perform the certificate verification with correct SAN regex matcher and incorrect SAN exact matcher(negative test).

Risk Level: Low
Testing:
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Tianyu Xia tyxia@google.com

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants