Skip to content

Commit

Permalink
Merge pull request #153 from larrydewey/152-byte-bug
Browse files Browse the repository at this point in the history
152: Fixing cert identifier bug
  • Loading branch information
larrydewey authored Feb 16, 2024
2 parents 5d8d03c + 5a4fb25 commit fd67a31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/certs/snp/cert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ impl Certificate {
Ok(self.0.public_key()?)
}

/// Identifies the format of a certificate based upon the first twenty-eight
/// Identifies the format of a certificate based upon the first twenty-seven
/// bytes of a byte stream. A non-PEM format assumes DER format.
fn identify_format(bytes: &[u8]) -> CertFormat {
const PEM_START: &[u8] = b"-----BEGIN CERTIFICATE-----";
match bytes {
match &bytes[0..27] {
PEM_START => CertFormat::Pem,
_ => CertFormat::Der,
}
Expand Down

0 comments on commit fd67a31

Please sign in to comment.