@@ -123,17 +123,21 @@ pub fn sig_scheme_to_type_nid(scheme: SignatureScheme) -> Option<c_int> {
123123pub fn named_group_to_nid ( group : NamedGroup ) -> Option < c_int > {
124124 use NamedGroup :: * ;
125125
126+ // See TLSEXT_nid_unknown from tls1.h - openssl-sys does not
127+ // have a constant for this to import.
128+ const TLSEXT_NID_UNKNOWN : c_int = 0x1000000 ;
126129 // See NID_ffhdhe* from obj_mac.h - openssl-sys does not have
127130 // constants for these to import.
128131 const NID_FFDHE2048 : c_int = 1126 ;
129132 const NID_FFDHE3072 : c_int = 1127 ;
130133 const NID_FFDHE4096 : c_int = 1128 ;
131134 const NID_FFDHE6144 : c_int = 1129 ;
132135 const NID_FFDHE8192 : c_int = 1130 ;
133-
134- // See TLSEXT_nid_unknown from tls1.h - openssl-sys does not
135- // have a constant for this to import.
136- const TLSEXT_NID_UNKNOWN : c_int = 0x1000000 ;
136+ // See NID_ML_KEM_* from obj_mac.h - openssl-sys does not have
137+ // constants for these to import.
138+ const NID_ML_KEM_512 : c_int = 1454 ;
139+ const NID_ML_KEM_768 : c_int = 1455 ;
140+ const NID_ML_KEM_1024 : c_int = 1456 ;
137141
138142 match group {
139143 secp256r1 => Some ( NID_X9_62_prime256v1 ) ,
@@ -146,6 +150,9 @@ pub fn named_group_to_nid(group: NamedGroup) -> Option<c_int> {
146150 FFDHE4096 => Some ( NID_FFDHE4096 ) ,
147151 FFDHE6144 => Some ( NID_FFDHE6144 ) ,
148152 FFDHE8192 => Some ( NID_FFDHE8192 ) ,
153+ MLKEM512 => Some ( NID_ML_KEM_512 ) ,
154+ MLKEM768 => Some ( NID_ML_KEM_768 ) ,
155+ MLKEM1024 => Some ( NID_ML_KEM_1024 ) ,
149156 other => Some ( TLSEXT_NID_UNKNOWN | u16:: from ( other) as c_int ) ,
150157 }
151158}
0 commit comments