Skip to content

Commit 31bee5a

Browse files
committed
refactor(oma-repo-verify): move replace '.' logic to inner
1 parent af56d75 commit 31bee5a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

oma-repo-verify/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ impl InReleaseVerifier {
6161
}
6262

6363
pub fn from_key_block(block: &str, trusted: bool) -> VerifyResult<Self> {
64+
// 这个点存在只是表示换行,因此把它替换掉
65+
let block = block.replace('.', "");
6466
let mut certs: Vec<Cert> = Vec::new();
6567
let ppr = PacketParserBuilder::from_bytes(block.as_bytes())?.build()?;
6668
let cert = CertParser::from(ppr);
@@ -141,9 +143,7 @@ pub fn verify_inrelease(
141143
&p,
142144
None,
143145
if let Some(deb822_inner_signed_by_str) = deb822_inner_signed_by_str {
144-
// 这个点存在只是表示换行,因此把它替换掉
145-
let signed_by_str = deb822_inner_signed_by_str.replace('.', "");
146-
InReleaseVerifier::from_key_block(&signed_by_str, trusted)?
146+
InReleaseVerifier::from_key_block(deb822_inner_signed_by_str, trusted)?
147147
} else {
148148
InReleaseVerifier::from_paths(&certs, trusted)?
149149
},

0 commit comments

Comments
 (0)