Get curves for OpenSSL tests itself

This commit is contained in:
Rohit Aggarwal 2018-03-08 17:10:09 +00:00
parent 0a38b5a9ef
commit 9e2755abae
1 changed files with 6 additions and 1 deletions

View File

@ -127,9 +127,14 @@ mod test {
use ec::EcGroup; use ec::EcGroup;
use super::*; use super::*;
static CURVE_IDENTIFER: Nid = Nid::X9_62_C2TNB191V1;
static DGST_LEN: i32 = 20; static DGST_LEN: i32 = 20;
#[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
static CURVE_IDENTIFER: Nid = Nid::X9_62_PRIME192V1;
#[cfg(osslconf = "OPENSSL_NO_EC2M")]
static CURVE_IDENTIFER: Nid = Nid::X9_62_C2TNB191V1;
fn get_public_key(group: &EcGroup, x: &EcKey<Private>) -> Result<EcKey<Public>, ErrorStack> { fn get_public_key(group: &EcGroup, x: &EcKey<Private>) -> Result<EcKey<Public>, ErrorStack> {
let public_key_point = x.public_key(); let public_key_point = x.public_key();
Ok(EcKey::from_public_key(group, public_key_point)?) Ok(EcKey::from_public_key(group, public_key_point)?)