Skip to content

Commit e56e341

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

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

boring/src/ssl/mod.rs

Lines changed: 11 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,17 @@ 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(note = "Use set_curves_list(). set_curves() and SslCurve will be removed in the next release")]
2082+
#[allow(deprecated)]
20762083
pub fn set_curves(&mut self, curves: &[SslCurve]) -> Result<(), ErrorStack> {
20772084
let curves: Vec<i32> = curves
20782085
.iter()
@@ -2959,6 +2966,8 @@ impl SslRef {
29592966
/// Sets the ongoing session's supported groups by their named identifiers
29602967
/// (formerly referred to as curves).
29612968
#[corresponds(SSL_set1_groups)]
2969+
#[deprecated(note = "SslCurveNid will be removed in the next release. Use set_curves_list")]
2970+
#[allow(deprecated)]
29622971
pub fn set_group_nids(&mut self, group_nids: &[SslCurveNid]) -> Result<(), ErrorStack> {
29632972
unsafe {
29642973
cvt_0i(ffi::SSL_set1_curves(
@@ -3007,6 +3016,8 @@ impl SslRef {
30073016
/// Returns the [`SslCurve`] used for this `SslRef`.
30083017
#[corresponds(SSL_get_curve_id)]
30093018
#[must_use]
3019+
#[deprecated(note = "SslCurve will be removed in the next release")]
3020+
#[allow(deprecated)]
30103021
pub fn curve(&self) -> Option<SslCurve> {
30113022
let curve_id = unsafe { ffi::SSL_get_curve_id(self.as_ptr()) };
30123023
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)