Skip to content

Commit 5a5d3e8

Browse files
committed
ssl: reject empty cipher conjunction operands
Keep empty operands visible to the parser so malformed OpenSSL cipher strings such as AES+ and ALL++AES are rejected instead of normalized. Assisted-by: CodeRabbit Assisted-by: OpenAI Codex: GPT-5
1 parent 8154556 commit 5a5d3e8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎crates/stdlib/src/ssl/cipher.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ impl<'a> CipherFilterSubOpList<'a> {
285285
fn parse(s: &'a str) -> Result<Self, &'static str> {
286286
let sub_ops: Vec<_> = s
287287
.split('+')
288-
.filter(|s| !s.is_empty())
289288
.map(CipherFilterSubOp::parse)
290289
.collect::<Result<_, _>>()?;
291290
if sub_ops.is_empty() {
@@ -1037,5 +1036,7 @@ mod tests {
10371036
assert!(CipherList::parse_to_rustls("PROFILE=SYSTEM").is_err());
10381037
assert!(CipherList::parse_to_rustls(";").is_err());
10391038
assert!(CipherList::parse_to_rustls("").is_err());
1039+
assert!(CipherList::parse_to_rustls("AES+").is_err());
1040+
assert!(CipherList::parse_to_rustls("ALL++AES").is_err());
10401041
}
10411042
}

0 commit comments

Comments
 (0)