[GH-ISSUE #134] Remove key generation from tests #361

Open
opened 2026-03-15 22:09:19 +03:00 by kerem · 8 comments
Owner

Originally created by @bluejekyll on GitHub (May 17, 2017).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/134

Instead checkin static keys to be used for all testing. This will allow OpenSSL to be dropped as a dependency for tests.

Originally created by @bluejekyll on GitHub (May 17, 2017). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/134 Instead checkin static keys to be used for all testing. This will allow OpenSSL to be dropped as a dependency for tests.
Author
Owner

@bluejekyll commented on GitHub (Aug 24, 2017):

This should remove the requirement for OpenSSL as required dev-dependency.

<!-- gh-comment-id:324538685 --> @bluejekyll commented on GitHub (Aug 24, 2017): This should remove the requirement for OpenSSL as required dev-dependency.
Author
Owner

@shammancer commented on GitHub (Aug 25, 2017):

Which tests would you want to remove OpenSSL from?

<!-- gh-comment-id:324803624 --> @shammancer commented on GitHub (Aug 25, 2017): Which tests would you want to remove OpenSSL from?
Author
Owner

@shammancer commented on GitHub (Aug 25, 2017):

Why do you have so many different tls implementations?

<!-- gh-comment-id:324805072 --> @shammancer commented on GitHub (Aug 25, 2017): Why do you have so many different tls implementations?
Author
Owner

@shammancer commented on GitHub (Aug 25, 2017):

Are the test just testing the same functionality in native-tls, rustls, client/src/tls?

<!-- gh-comment-id:324808428 --> @shammancer commented on GitHub (Aug 25, 2017): Are the test just testing the same functionality in native-tls, rustls, client/src/tls?
Author
Owner

@bluejekyll commented on GitHub (Aug 25, 2017):

There are different TLS implementations for different situations. OpenSSL is the default, most general implementation. Rustls is a pure Rust implementation with a dependency on the ring library instead. NativeTLS allows the system default to be used. Each of these is valuable for different scenarios based on peoples needs.

In terms of proof of the DNSSec chain, it's currently split between requiring OpenSSL for some functions and ring for others.

In terms of private keys that are generated, and example is on

github.com/bluejekyll/trust-dns@26ce62f137/server/tests/common/authority.rs (L169)

If you run rg '::generate\(' **/*.rs at the root of the project, it will give a pretty decent list of what needs to be changed. (this uses ripgrep which can be installed with cargo install ripgrep if you're not familiar with it).

What I was thinking of doing for this, was to generate some RSA keys int /tests and use those by loading thing into each test as needed. Does that make sense?

<!-- gh-comment-id:324821433 --> @bluejekyll commented on GitHub (Aug 25, 2017): There are different TLS implementations for different situations. OpenSSL is the default, most general implementation. Rustls is a pure Rust implementation with a dependency on the *ring* library instead. NativeTLS allows the system default to be used. Each of these is valuable for different scenarios based on peoples needs. In terms of proof of the DNSSec chain, it's currently split between requiring OpenSSL for some functions and *ring* for others. In terms of private keys that are generated, and example is on https://github.com/bluejekyll/trust-dns/blob/26ce62f1372d70cd93ff3fdaecc3708da307315f/server/tests/common/authority.rs#L169 If you run `rg '::generate\(' **/*.rs ` at the root of the project, it will give a pretty decent list of what needs to be changed. (this uses ripgrep which can be installed with `cargo install ripgrep` if you're not familiar with it). What I was thinking of doing for this, was to generate some RSA keys int /tests and use those by loading thing into each test as needed. Does that make sense?
Author
Owner

@briansmith commented on GitHub (Sep 22, 2017):

What I was thinking of doing for this, was to generate some RSA keys int /tests and use those by loading thing into each test as needed. Does that make sense?

Yes, that makes sense. In particular, I recommend generating them in PKCS#8 format because that's the format that every crypto library seems to natively support now.

Uncoincidentally, I wrote a guide to generating PKCS#8-formatted keys in all the necessary formats and key sizes (except legacy RSA key sizes) here: https://gist.github.com/briansmith/2ee42439923d8e65a266994d0f70180b

<!-- gh-comment-id:331574226 --> @briansmith commented on GitHub (Sep 22, 2017): > What I was thinking of doing for this, was to generate some RSA keys int /tests and use those by loading thing into each test as needed. Does that make sense? Yes, that makes sense. In particular, I recommend generating them in PKCS#8 format because that's the format that every crypto library seems to natively support now. Uncoincidentally, I wrote a guide to generating PKCS#8-formatted keys in all the necessary formats and key sizes (except legacy RSA key sizes) here: https://gist.github.com/briansmith/2ee42439923d8e65a266994d0f70180b
Author
Owner

@briansmith commented on GitHub (Sep 22, 2017):

Also, in case you don't know, you can use include_bytes! to include a file as a &[u8] value. See the ring doc tests for examples.

<!-- gh-comment-id:331576980 --> @briansmith commented on GitHub (Sep 22, 2017): Also, in case you don't know, you can use `include_bytes!` to include a file as a `&[u8]` value. See the *ring* doc tests for examples.
Author
Owner

@briansmith commented on GitHub (Oct 24, 2017):

Once this is done, all the ring tests can be run even when openssl is disabled. That should be done after this.

<!-- gh-comment-id:338873687 --> @briansmith commented on GitHub (Oct 24, 2017): Once this is done, all the *ring* tests can be run even when openssl is disabled. That should be done after this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#361
No description provided.