Skip to content

Remove support for verify_subject_alt_name in CertificateValidationContext#16978

Merged
alyssawilk merged 3 commits intoenvoyproxy:mainfrom
tyxia:v2_removal
Jun 21, 2021
Merged

Remove support for verify_subject_alt_name in CertificateValidationContext#16978
alyssawilk merged 3 commits intoenvoyproxy:mainfrom
tyxia:v2_removal

Conversation

@tyxia
Copy link
Copy Markdown
Member

@tyxia tyxia commented Jun 14, 2021

This field has been deprecated in favor of of the match_subject_alt_names field which provides more flexible matching.
SAN list can still be specified via transport_socket_options's SAN list override and verified via verifySubjectAltName

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

Risk Level: Low
Testing: local test on linux (bazel test //test/...)

tyxia added 2 commits May 27, 2021 13:27
Remove support for v2 verify_subject_alt_name field
Signed-off-by: Tianyu Xia <tyxia@google.com>
@repokitteh-read-only
Copy link
Copy Markdown

Hi @tyxia, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #16978 was opened by tyxia.

see: more, trace.

@tyxia tyxia marked this pull request as ready for review June 14, 2021 21:01
@tyxia
Copy link
Copy Markdown
Member Author

tyxia commented Jun 15, 2021

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:

🐱

Caused by: a #16978 (comment) was created by @tyxia.

see: more, trace.

@jmarantz
Copy link
Copy Markdown
Contributor

Adi, can you take a first pass?

adisuissa
adisuissa previously approved these changes Jun 15, 2021
Copy link
Copy Markdown
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks for cleaning this up!

@adisuissa
Copy link
Copy Markdown
Contributor

@htuch @mattklein123 Are there any docs that need an update when removing the implementation of an already deprecated (v2) feature?
I'm guessing there's no need, as the entire v2 is not allowed, but wanted to make sure.

Comment on lines +206 to +208
transport_socket_options != nullptr
? transport_socket_options->verifySubjectAltNameListOverride()
: std::vector<std::string>{},
Copy link
Copy Markdown
Member Author

@tyxia tyxia Jun 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one thing to discuss with reviewers here:
This function arg becomes optional after my change.
Other than current code (creating an empty vector), there are also some other options 1) absl::optional 2) pointer and using nullptr to indicate "not exist".
I currently choose an empty vector approach because 1)it is a lightweight approach from implementation perspective 2) there is a !verify_san_list.empty() check inside verifyCertificate(), which basically provides the same functionality as absl::optional's has_value. And this is better because absl::optional doesn't support pass by const ref and will cause a copy.

But if this path is performance critical, using pointer/nullptr might be a slightly preferred approach. Please let me know what do you think. Thanks!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, thanks!

@tyxia
Copy link
Copy Markdown
Member Author

tyxia commented Jun 15, 2021

LGTM
Thanks for cleaning this up!

Thanks for review, Adi! I just posted a comment/questions at the same time you reviewed the CL. Please take another quick look. Thanks!

@mattklein123
Copy link
Copy Markdown
Member

I'm guessing there's no need, as the entire v2 is not allowed, but wanted to make sure.

Yeah, if the feature is v2 only no docs are needed.

Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@alyssawilk alyssawilk merged commit 3efe871 into envoyproxy:main Jun 21, 2021
@tyxia tyxia deleted the v2_removal branch June 26, 2021 01:32
leyao-daily pushed a commit to leyao-daily/envoy that referenced this pull request Sep 30, 2021
…ontext` (envoyproxy#16978)

This field has been deprecated in favor of of the match_subject_alt_names field which provides more flexible matching.
SAN list can still be specified via transport_socket_options's SAN list override and verified via verifySubjectAltName

Risk Level: Low
Testing: local test on linux (bazel test //test/...)

Signed-off-by: Tianyu Xia <tyxia@google.com>
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.

6 participants