Skip to content

test: generate and test ECDSA certificates in ssl_integration_test.#5096

Merged
htuch merged 6 commits intoenvoyproxy:masterfrom
htuch:ecdsa-cert-gen
Nov 27, 2018
Merged

test: generate and test ECDSA certificates in ssl_integration_test.#5096
htuch merged 6 commits intoenvoyproxy:masterfrom
htuch:ecdsa-cert-gen

Conversation

@htuch
Copy link
Copy Markdown
Member

@htuch htuch commented Nov 21, 2018

Also, some bonus cleanups to improve DRY and maintainability of SSL related test code encountered
while doing this.

Part of #1319.

Risk Level: Low
Testing: bazel test //test/integration/..., new tests for client cipher suites and ECDSA server
certs added to ssl_integration_test.

Signed-off-by: Harvey Tuch htuch@google.com

Also, some bonus cleanups to improve DRY and maintainability of SSL related test code encountered
while doing this.

Risk Level: Low
Testing: bazel test //test/integration/..., new tests for client cipher suites and ECDSA server
  certs added to ssl_integration_test.

Signed-off-by: Harvey Tuch <htuch@google.com>
@@ -0,0 +1,40 @@
[req]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you somehow re-use servercert.cfg here (e.g. by passing config-name as another parameter)? Otherwise, we're introducing unnecessary duplication.

EXPECT_EQ(1U, counter->value());
counter->reset();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You're missing the case with RSA server and ECDSA client.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is currently implied, but sure, I can make an explicit variant.

TestEnvironment::runfilesPath("/test/config/integration/certs/servercert.pem"));
tls_certificate->mutable_private_key()->set_filename(
TestEnvironment::runfilesPath("/test/config/integration/certs/serverkey.pem"));
if (ecdsa_cert) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this have to be either or? Once rest of your changes land, we're going to have ability to set both.

Perhaps pass rsa_cert and ecdsa_cert, and guard that it's either or in this commit?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, eventually it will be both, but we will also want additional flexibilty with multi-cert, e.g. to have multiple ECDSA certs in testing to verify we only pick the first. So, I think we can leave it like this for this PR and then add this in later.

Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Copy link
Copy Markdown
Member

@lizan lizan left a comment

Choose a reason for hiding this comment

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

LGTM, one nit

@@ -0,0 +1,4 @@
// NOLINT(namespace-envoy)
#define TEST_SERVER_ECDSA_CERT_HASH \
"F7:97:78:71:62:1F:48:EA:F1:76:A3:AA:11:71:6E:30:99:E7:0A:0F:A2:51:DB:B5:80:42:89:13:78:3A:80:" \
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.

constexpr char[] or constexpr absl::string_view?

PiotrSikora
PiotrSikora previously approved these changes Nov 27, 2018
Copy link
Copy Markdown
Contributor

@PiotrSikora PiotrSikora left a comment

Choose a reason for hiding this comment

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

LGTM, other than @lizan's nit (constexpr). Thanks!

@htuch htuch merged commit 65eb83b into envoyproxy:master Nov 27, 2018
@htuch htuch deleted the ecdsa-cert-gen branch November 27, 2018 17:18
fredlas pushed a commit to fredlas/envoy that referenced this pull request Mar 5, 2019
…nvoyproxy#5096)

Also, some bonus cleanups to improve DRY and maintainability of SSL related test code encountered
while doing this.

Part of envoyproxy#1319.

Risk Level: Low
Testing: bazel test //test/integration/..., new tests for client cipher suites and ECDSA server
  certs added to ssl_integration_test.

Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Fred Douglas <fredlas@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.

3 participants