Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions boring/src/ssl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,13 +700,16 @@ impl From<u16> for SslSignatureAlgorithm {
/// Numeric identifier of a TLS curve.
#[repr(transparent)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[deprecated(note = "this is not ABI-stable and will be removed in the next release")]
pub struct SslCurveNid(c_int);

/// A TLS Curve.
#[repr(transparent)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[deprecated(note = "this is not ABI-stable and will be removed in the next release")]
pub struct SslCurve(c_int);

#[allow(deprecated)]
impl SslCurve {
pub const SECP224R1: SslCurve = SslCurve(ffi::SSL_CURVE_SECP224R1 as _);

Expand Down Expand Up @@ -2066,13 +2069,19 @@ impl SslContextBuilder {
}
}

/// Use `Self::set_curves_list()` instead.
///
/// Sets the context's supported curves.
//
// If the "kx-*" flags are used to set key exchange preference, then don't allow the user to
// set them here. This ensures we don't override the user's preference without telling them:
// when the flags are used, the preferences are set just before connecting or accepting.
#[corresponds(SSL_CTX_set1_curves)]
#[cfg(not(feature = "kx-safe-default"))]
#[deprecated(
note = "Use set_curves_list(). set_curves() and SslCurve will be removed in the next release"
)]
#[allow(deprecated)]
pub fn set_curves(&mut self, curves: &[SslCurve]) -> Result<(), ErrorStack> {
let curves: Vec<i32> = curves
.iter()
Expand Down Expand Up @@ -2959,6 +2968,8 @@ impl SslRef {
/// Sets the ongoing session's supported groups by their named identifiers
/// (formerly referred to as curves).
#[corresponds(SSL_set1_groups)]
#[deprecated(note = "SslCurveNid will be removed in the next release. Use set_curves_list")]
#[allow(deprecated)]
pub fn set_group_nids(&mut self, group_nids: &[SslCurveNid]) -> Result<(), ErrorStack> {
unsafe {
cvt_0i(ffi::SSL_set1_curves(
Expand Down Expand Up @@ -3007,6 +3018,8 @@ impl SslRef {
/// Returns the [`SslCurve`] used for this `SslRef`.
#[corresponds(SSL_get_curve_id)]
#[must_use]
#[deprecated(note = "SslCurve will be removed in the next release")]
#[allow(deprecated)]
pub fn curve(&self) -> Option<SslCurve> {
let curve_id = unsafe { ffi::SSL_get_curve_id(self.as_ptr()) };
if curve_id == 0 {
Expand Down
1 change: 1 addition & 0 deletions boring/src/ssl/test/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(deprecated)] // SslCurve
use foreign_types::{ForeignType, ForeignTypeRef};
use std::io;
use std::io::prelude::*;
Expand Down