aboutsummaryrefslogtreecommitdiff
path: root/openssl/src
diff options
context:
space:
mode:
authorBenjamin Cheng <[email protected]>2018-06-02 15:49:59 -0400
committerBenjamin Cheng <[email protected]>2018-06-02 15:49:59 -0400
commit285884c9254e2cdf0cc03b17600c5ebb92a39287 (patch)
tree1051b02cd1fbe5306743eeb20f0f25e484ad9edd /openssl/src
parentChange psk test cipher to PSK-AES128-CBC-SHA (diff)
downloadrust-openssl-285884c9254e2cdf0cc03b17600c5ebb92a39287.tar.xz
rust-openssl-285884c9254e2cdf0cc03b17600c5ebb92a39287.zip
push PSK callback errors onto ErrorStack
Diffstat (limited to 'openssl/src')
-rw-r--r--openssl/src/ssl/callbacks.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/openssl/src/ssl/callbacks.rs b/openssl/src/ssl/callbacks.rs
index e34bc745..f45146c6 100644
--- a/openssl/src/ssl/callbacks.rs
+++ b/openssl/src/ssl/callbacks.rs
@@ -84,7 +84,10 @@ where
let psk_sl = slice::from_raw_parts_mut(psk as *mut u8, max_psk_len as usize);
match (*callback)(ssl, hint, identity_sl, psk_sl) {
Ok(psk_len) => psk_len as u32,
- _ => 0,
+ Err(e) => {
+ e.put();
+ 0
+ }
}
}
}
@@ -118,7 +121,10 @@ where
let psk_sl = slice::from_raw_parts_mut(psk as *mut u8, max_psk_len as usize);
match (*callback)(ssl, identity, psk_sl) {
Ok(psk_len) => psk_len as u32,
- _ => 0,
+ Err(e) => {
+ e.put();
+ 0
+ }
}
}
}