File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -2780,6 +2780,22 @@ impl SslRef {
27802780 Some ( curve_id)
27812781 }
27822782
2783+ /// Returns the curve name used for this `SslRef`.
2784+ #[ corresponds( SSL_get_curve_name ) ]
2785+ #[ must_use]
2786+ pub fn curve_name ( & self ) -> Option < & ' static str > {
2787+ let curve_id = self . curve ( ) ?;
2788+
2789+ unsafe {
2790+ let ptr = ffi:: SSL_get_curve_name ( curve_id) ;
2791+ if ptr. is_null ( ) {
2792+ return None ;
2793+ }
2794+
2795+ CStr :: from_ptr ( ptr) . to_str ( ) . ok ( )
2796+ }
2797+ }
2798+
27832799 /// Returns an `ErrorCode` value for the most recent operation on this `SslRef`.
27842800 #[ corresponds( SSL_get_error ) ]
27852801 #[ must_use]
Original file line number Diff line number Diff line change @@ -958,6 +958,8 @@ fn get_curve() {
958958 let client_stream = client. connect ( ) ;
959959 let curve = client_stream. ssl ( ) . curve ( ) ;
960960 assert ! ( curve. is_some( ) ) ;
961+ let curve_name = client_stream. ssl ( ) . curve_name ( ) ;
962+ assert ! ( curve_name. is_some( ) ) ;
961963}
962964
963965#[ test]
You can’t perform that action at this time.
0 commit comments