Commit Graph

1124 Commits

Author SHA1 Message Date
Alex Crichton 71ee9439ca Support builds of OpenSSL from vendored source (take 2)
This is a revival of #684 to see if I can help push it across the finish line!

Closes #580
2018-07-30 15:15:24 -07:00
Steven Fackler 415f399b2c Fix tests when built with no-ec2m
The other curve identifier isn't valid, at least in some contexts so
just ignore the test in those cases.

Closes #964
2018-07-29 09:48:03 -07:00
Steven Fackler ee5215bd31 SslSessionRef methods return static strings
Closes #961
2018-07-19 20:22:57 -07:00
Josh Abraham a964d05d4a Fix spelling in symm docs 2018-07-14 11:54:26 -10:00
Steven Fackler 1392b006e2
Merge pull request #937 from marcoh00/iterable-x509names
X509NameRef: Provide an iterator over all entries
2018-07-07 20:20:45 -07:00
Steven Fackler 6422ffb1b2 Clean up IGE example
Closes #955
2018-07-04 23:15:33 -07:00
Steven Fackler 07c49e517e
Only grab the name entry count when needed 2018-06-26 22:31:10 -07:00
Steven Fackler 4c1891cc10
Merge pull request #950 from WanzenBug/master
Add access to private/public components of DSA key pairs.
2018-06-23 23:53:09 -04:00
Moritz Wanzenböck 339d09fbf3 Simplify DSA from private components 2018-06-23 18:16:32 +02:00
Stefan Tatschner 321c076ab3
Fix build with openssl 1.1.1 and no-psk
I used this as build flags for openssl 1.1.1:

```
/usr/bin/perl ./Configure linux-x86_64 no-shared no-zlib no-psk no-srp no-weak-ssl-ciphers no-idea
```

rust-openssl crashed with this error:

```
   Compiling openssl v0.10.10                                                                                                                                                                                      
error[E0433]: failed to resolve. Use of undeclared type or module `CStr`                                                                                                                                           
   --> /home/stefan/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-0.10.10/src/ssl/callbacks.rs:386:16                                                                                                    
    |                                                                                                                                                                                                              
386 |     let line = CStr::from_ptr(line).to_bytes();                                                                                                                                                              
    |                ^^^^ Use of undeclared type or module `CStr`                                                                                                                                                  
                                                                                                                                                                                                                   
error[E0412]: cannot find type `c_char` in this scope                                                                                                                                                              
   --> /home/stefan/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-0.10.10/src/ssl/callbacks.rs:377:75                                                                                                    
    |                                                                                                                                                                                                              
377 | pub unsafe extern "C" fn raw_keylog<F>(ssl: *const ffi::SSL, line: *const c_char)                                                                                                                            
    |                                                                           ^^^^^^ did you mean `c_uchar`?                                                                                                     
help: possible candidates are found in other modules, you can import them into scope                                                                                                                               
    |                                                                                                                                                                                                              
1   | use libc::c_char;                                                                                                                                                                                            
    |                                                                                                                                                                                                              
1   | use std::os::raw::c_char;                                                                                                                                                                                    
    |                                                                                                                                                                                                              
                                                                                                                                                                                                                   
error: aborting due to 2 previous errors                                                                                                                                                                           
                                                                                                                                                                                                                   
Some errors occurred: E0412, E0433.                                                                                                                                                                                
For more information about an error, try `rustc --explain E0412`.                                                                                                                                                  
error: Could not compile `openssl`.                                                                                                                                                                                
warning: build failed, waiting for other jobs to finish... 
```

this patch fixes the problem
2018-06-21 22:19:29 +02:00
Moritz Wanzenböck c624427e31 Fix fallback implementation of DSA utility methods 2018-06-18 20:32:34 +02:00
Moritz Wanzenböck 0390aba73b Add tests for DSA key pairs 2018-06-18 18:12:34 +02:00
Moritz Wanzenböck 4994e75d2c Add Dsa::from_(private|public)_components
Add 2 methods to create a DSA key pair from its raw components.
2018-06-18 18:10:02 +02:00
Moritz Wanzenböck 52c942f4b3 Add methods to access private and public part of DSA keys 2018-06-18 11:39:15 +02:00
Steven Fackler 6440ee04ef
Merge pull request #943 from lolzballs/master
Add wrapper for SSL_CTX_set_psk_server_callback
2018-06-17 15:47:00 -07:00
Benjamin Cheng bf86580bec
Disable TLSv1.3 for psk_ciphers test 2018-06-17 17:00:22 -04:00
Steven Fackler 115cb730b0 Switch to accessors in libressl where possible
Some accessors are mysteriously still macros so we can't make everything
opaque yet, unfortunately.

cc #909
2018-06-09 21:49:36 -07:00
Steven Fackler cdc90c7e9d Add SslRef::set_alpn_protos 2018-06-04 20:19:27 -07:00
Marco Huenseler 14b5439347 Rename X509NameRef::all_entries and refactor end-of-iterator checks 2018-06-03 15:38:46 +02:00
Marco Huenseler f5e6d57c47 Provide an Asn1Object getter method for X509NameEntryRef 2018-06-03 15:38:46 +02:00
Marco Huenseler 2afdc16fc9 Make X509NameRef provide an iterator over all X509NameEntries 2018-06-03 15:38:46 +02:00
Steven Fackler 0745d66927 Update to 1.1.1-pre7
The initial session ticket is now sent as part of SSL_accept, so some
tests need to write a single byte through the stream to make sure that
both ends have fully completed to avoid test flakes.

TLSv1.3 cipher suite control has been extracted from the normal cipher
list into a separate method: SslContextBuilder::set_ciphersuites.
2018-06-02 13:58:56 -07:00
Benjamin Cheng 88c61d252f
Ensure psk test callbacks are called 2018-06-02 15:50:24 -04:00
Benjamin Cheng 285884c925
push PSK callback errors onto ErrorStack 2018-06-02 15:49:59 -04:00
Benjamin Cheng bcc4ca0285
Change psk test cipher to PSK-AES128-CBC-SHA
Hopefully it works on CI servers now
2018-06-02 13:59:04 -04:00
Benjamin Cheng b1c77a7ea5
Use is_null() 2018-06-02 13:49:42 -04:00
Benjamin Cheng 5d8a44612d
add test for psk; deprecated set_psk_callback 2018-06-02 13:47:52 -04:00
Benjamin Cheng b1eb1224f5
Merge remote-tracking branch 'origin/master' 2018-06-02 10:56:31 -04:00
Steven Fackler a3a2605115 fix build on older rustc 2018-06-01 20:47:46 -07:00
Steven Fackler 10b2a34529 Adjust Nid signature algorithm APIs 2018-06-01 20:36:19 -07:00
Steven Fackler c2145384a9 Fix types 2018-06-01 20:07:13 -07:00
Steven Fackler 15cb335e66 Fix use-after-free in cms
Closes #941
2018-06-01 19:38:52 -07:00
Steven Fackler 3456add537 Add SslRef::verified_chain 2018-05-29 21:53:22 -07:00
Marco Huenseler 2977f6ed30 rewrite Nid::{long_name,short_name} to return Results instead of Options 2018-05-28 12:15:05 +02:00
Marco Huenseler b8de619fbe Get Nid string representations 2018-05-28 12:13:40 +02:00
Steven Fackler a774c0c5f2 Rename X509Ref::fingerprint to X509Ref::digest and avoid allocating 2018-05-24 21:07:36 -07:00
Steven Fackler 772e1c003f Add some digest support 2018-05-24 21:06:11 -07:00
Steven Fackler 3cd33cdd8b Don't panic on bogus servernames
Also add a second version of the method to avoid filtering out non-utf8
names.

Closes #930
2018-05-24 20:22:15 -07:00
Steven Fackler c0876cc8c6 Add bindings to SSL_get_finished and SSL_get_peer_finished
These are used for the tls-unique SCRAM channel binding mode.
2018-05-24 20:00:28 -07:00
Steven Fackler c7db3d18ad
Merge pull request #920 from Ralith/max-early-data-accessors
TLS1.3 early data support
2018-05-22 20:42:46 -07:00
Benjamin Saunders 2e478fdcf4 Expose early I/O 2018-05-22 20:25:28 -07:00
Steven Fackler 7a7f98a32c
Revert "Move proto version accessors to SslContextRef" 2018-05-20 20:55:20 -07:00
Steven Fackler b976b5fd52 Move proto version accessors to SslContextRef
Add a Derf impl for SslContextBuilder so existing use still works.
2018-05-20 20:47:00 -07:00
Steven Fackler f0347fbce8 Improve error Display impls 2018-05-20 19:37:19 -07:00
Steven Fackler 3ab1cc7a8f Make Stack Sync + Send 2018-05-20 15:24:38 -07:00
Steven Fackler 4c1fdf1d81 Support ALPN on libressl
Closes #690
2018-05-20 12:52:49 -07:00
Steven Fackler a6fcef01c0 Overhaul openssl cfgs
Also expose hostname verification on libressl
2018-05-20 12:33:02 -07:00
Steven Fackler d991566f2b Support min/max version in LibreSSL
Their implementations of the accessors don't behave expected with no
bounds, so we ignore those bits of the tests.
2018-05-19 19:57:12 -07:00
Benjamin Saunders 69c75a178b Expose early keying material export 2018-05-17 13:16:41 -07:00
Benjamin Saunders d5d414b16f Expose max TLS1.3 early data accessors 2018-05-17 12:02:32 -07:00