Skip to content

Commit cbc2279

Browse files
committed
Warn about set_curves() removal
b46d770
1 parent 36a2a1c commit cbc2279

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

boring/src/ssl/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,13 +700,16 @@ impl From<u16> for SslSignatureAlgorithm {
700700
/// Numeric identifier of a TLS curve.
701701
#[repr(transparent)]
702702
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
703+
#[deprecated(note = "this is not ABI-stable and will be removed in the next release")]
703704
pub struct SslCurveNid(c_int);
704705

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

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

@@ -2066,13 +2069,19 @@ impl SslContextBuilder {
20662069
}
20672070
}
20682071

2072+
/// Use `Self::set_curves_list()` instead.
2073+
///
20692074
/// Sets the context's supported curves.
20702075
//
20712076
// If the "kx-*" flags are used to set key exchange preference, then don't allow the user to
20722077
// set them here. This ensures we don't override the user's preference without telling them:
20732078
// when the flags are used, the preferences are set just before connecting or accepting.
20742079
#[corresponds(SSL_CTX_set1_curves)]
20752080
#[cfg(not(feature = "kx-safe-default"))]
2081+
#[deprecated(
2082+
note = "Use set_curves_list(). set_curves() and SslCurve will be removed in the next release"
2083+
)]
2084+
#[allow(deprecated)]
20762085
pub fn set_curves(&mut self, curves: &[SslCurve]) -> Result<(), ErrorStack> {
20772086
let curves: Vec<i32> = curves
20782087
.iter()
@@ -2959,6 +2968,8 @@ impl SslRef {
29592968
/// Sets the ongoing session's supported groups by their named identifiers
29602969
/// (formerly referred to as curves).
29612970
#[corresponds(SSL_set1_groups)]
2971+
#[deprecated(note = "SslCurveNid will be removed in the next release. Use set_curves_list")]
2972+
#[allow(deprecated)]
29622973
pub fn set_group_nids(&mut self, group_nids: &[SslCurveNid]) -> Result<(), ErrorStack> {
29632974
unsafe {
29642975
cvt_0i(ffi::SSL_set1_curves(
@@ -3007,6 +3018,8 @@ impl SslRef {
30073018
/// Returns the [`SslCurve`] used for this `SslRef`.
30083019
#[corresponds(SSL_get_curve_id)]
30093020
#[must_use]
3021+
#[deprecated(note = "SslCurve will be removed in the next release")]
3022+
#[allow(deprecated)]
30103023
pub fn curve(&self) -> Option<SslCurve> {
30113024
let curve_id = unsafe { ffi::SSL_get_curve_id(self.as_ptr()) };
30123025
if curve_id == 0 {

boring/src/ssl/test/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(deprecated)] // SslCurve
12
use foreign_types::{ForeignType, ForeignTypeRef};
23
use std::io;
34
use std::io::prelude::*;

0 commit comments

Comments
 (0)