diff options
| author | Steven Fackler <[email protected]> | 2016-10-14 21:54:53 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-10-14 22:01:21 -0700 |
| commit | 7ac05996388af40e78696c5ed2d9e0426eea1881 (patch) | |
| tree | 3fe52191316bf3a45c01f18f06ff2fe806e7e8b7 /openssl-sys/src | |
| parent | Merge pull request #470 from sfackler/confs (diff) | |
| download | rust-openssl-7ac05996388af40e78696c5ed2d9e0426eea1881.tar.xz rust-openssl-7ac05996388af40e78696c5ed2d9e0426eea1881.zip | |
Fix test_alpn_server_select_none
In OpenSSL 1.1, a failure to negotiate a protocol is a fatal error, so
fork that test. This also popped up an issue where we assumed all errors
had library, function, and reason strings which is not necessarily the
case.
While we're in here, adjust the Display impl to match what OpenSSL
prints out.
Closes #465
Diffstat (limited to 'openssl-sys/src')
| -rw-r--r-- | openssl-sys/src/lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 300ed056..026d6e6b 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -318,6 +318,18 @@ pub unsafe fn SSL_set_tlsext_host_name(s: *mut SSL, name: *mut c_char) -> c_long name as *mut c_void) } +pub fn ERR_GET_LIB(l: c_ulong) -> c_int { + ((l >> 24) & 0x0FF) as c_int +} + +pub fn ERR_GET_FUNC(l: c_ulong) -> c_int { + ((l >> 12) & 0xFFF) as c_int +} + +pub fn ERR_GET_REASON(l: c_ulong) -> c_int { + (l & 0xFFF) as c_int +} + extern { pub fn ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int; pub fn ASN1_STRING_type_new(ty: c_int) -> *mut ASN1_STRING; |