Skip to content

Commit

Permalink
Cover ECDSA in server_suites tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ctz committed Jun 3, 2018
1 parent 794794e commit 612370e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
7 changes: 5 additions & 2 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,15 @@ pub struct TlsServer {

impl TlsServer {
pub fn new(port: u16) -> Self {
let keytype = "rsa";
Self::new_keytype(port, "rsa")
}

pub fn new_keytype(port: u16, keytype: &str) -> Self {
TlsServer {
port: unused_port(port),
http: false,
echo: false,
key: format!("test-ca/{}/end.rsa", keytype),
key: format!("test-ca/{}/end.key", keytype),
certs: format!("test-ca/{}/end.fullchain", keytype),
cafile: format!("test-ca/{}/ca.cert", keytype),
verbose: false,
Expand Down
32 changes: 30 additions & 2 deletions tests/server_suites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,34 @@ fn ecdhe_rsa_aes_256_gcm_sha384() {
server.kill();
}

// cannot do ecdsa tls_ecdhe_ecdsa_* because we don't support ECDSA
// signing yet.
#[test]
fn ecdhe_ecdsa_aes_128_gcm_sha256() {
let mut server = TlsServer::new_keytype(7020, "ecdsa");

server.echo_mode()
.suite("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256")
.run();

server.client()
.expect("Cipher : ECDHE-ECDSA-AES128-GCM-SHA256")
.go();

server.kill();
}

#[test]
fn ecdhe_ecdsa_aes_256_gcm_sha384() {
let mut server = TlsServer::new_keytype(7030, "ecdsa");

server.echo_mode()
.suite("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384")
.run();

server.client()
.expect("Cipher : ECDHE-ECDSA-AES256-GCM-SHA384")
.go();

server.kill();
}

// cannot do chacha20poly1305 because openssl doesn't support it.

0 comments on commit 612370e

Please sign in to comment.