Commit 8ae4cdee authored by James Mayclin's avatar James Mayclin
Browse files

conform to tmp naming convention

The rust bindings use the same "tmp" spelling as the C apis.
parent 386c36a8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3452,7 +3452,7 @@ impl SslRef {
    // dropped
    #[corresponds(SSL_get_peer_tmp_key)]
    #[cfg(ossl300)]
    pub fn peer_temp_key(&self) -> Result<PKey<Public>, ErrorStack> {
    pub fn peer_tmp_key(&self) -> Result<PKey<Public>, ErrorStack> {
        unsafe {
            let mut key = ptr::null_mut();
            match cvt(ffi::SSL_get_peer_tmp_key(self.as_ptr(), &mut key)) {
@@ -3468,7 +3468,7 @@ impl SslRef {
    // dropped
    #[corresponds(SSL_get_tmp_key)]
    #[cfg(ossl300)]
    pub fn temp_key(&self) -> Result<PKey<Public>, ErrorStack> {
    pub fn tmp_key(&self) -> Result<PKey<Public>, ErrorStack> {
        unsafe {
            let mut key = ptr::null_mut();
            match cvt(ffi::SSL_get_tmp_key(self.as_ptr(), &mut key)) {
+4 −4
Original line number Diff line number Diff line
@@ -331,11 +331,11 @@ fn peer_temp_key_p384() {
    server.ctx().set_groups_list("P-384").unwrap();
    let server = server.build();
    let s = server.client().connect();
    let peer_temp = s.ssl().peer_temp_key().unwrap();
    let peer_temp = s.ssl().peer_tmp_key().unwrap();
    assert_eq!(peer_temp.id(), Id::EC);
    assert_eq!(peer_temp.bits(), 384);

    let local_temp = s.ssl().temp_key().unwrap();
    let local_temp = s.ssl().tmp_key().unwrap();
    assert_eq!(local_temp.id(), Id::EC);
    assert_eq!(local_temp.bits(), 384);

@@ -360,11 +360,11 @@ fn peer_temp_key_rsa() {
    let mut client = server.client();
    client.ctx().set_groups_list("P-521").unwrap();
    let s = client.connect();
    let peer_temp = s.ssl().peer_temp_key();
    let peer_temp = s.ssl().peer_tmp_key();
    assert!(peer_temp.is_err());

    // this is the temp key that the client sent in the initial key share
    let local_temp = s.ssl().temp_key().unwrap();
    let local_temp = s.ssl().tmp_key().unwrap();
    assert_eq!(local_temp.id(), Id::EC);
    assert_eq!(local_temp.bits(), 521);
}