[domistream] WIP: rustfmt, doc link, clippy fixes (one collapsible-if left in rtsp/mod.rs), PROTOCOL.md status
Paused at Mark's request.
This commit is contained in:
@@ -271,10 +271,8 @@ impl ServerCert {
|
||||
const END: &[u8] = b"-----END CERTIFICATE-----";
|
||||
cap("host certificate PEM", MAX_CERT_PEM_BYTES, pem.len())?;
|
||||
let trimmed = pem.trim_ascii();
|
||||
let body = trimmed
|
||||
.strip_prefix(BEGIN)
|
||||
.and_then(|b| b.strip_suffix(END))
|
||||
.ok_or(malformed("host certificate PEM"))?;
|
||||
let body =
|
||||
trimmed.strip_prefix(BEGIN).and_then(|b| b.strip_suffix(END)).ok_or(malformed("host certificate PEM"))?;
|
||||
if body.windows(5).any(|w| w == b"-----") {
|
||||
return Err(malformed("host certificate PEM holds more than one block"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user