Skip to content

Commit 70017d1

Browse files
committed
fixup! Add a NegotiatedGroup wrapper struct
Expand example code
1 parent 893ce6a commit 70017d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

openssl/src/nid.rs

+6
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,12 @@ impl Nid {
11121112
///
11131113
/// assert!(Nid::AES_256_GCM.as_raw() == 901);
11141114
/// assert!(NegotiatedGroup::from_raw(901).nid() == Some(Nid::AES_256_GCM));
1115+
/// assert!(NegotiatedGroup::from_raw(901).unknown_group_id() == None);
1116+
///
1117+
/// let bogus_id: i32 = 0x6399;
1118+
/// let raw = bogus_id | NegotiatedGroup::TLSEXT_nid_unknown;
1119+
/// assert!(NegotiatedGroup::from_raw(raw).unknown_group_id() == Some(bogus_id));
1120+
/// assert!(NegotiatedGroup::from_raw(raw).nid() == None);
11151121
/// ```
11161122
///
11171123
/// # External Documentation

0 commit comments

Comments
 (0)