Skip to content

Commit b8941c3

Browse files
leopoldjoyOpenCode
andcommitted
refactor: trim duplicate ASN.1 tag checks
Co-authored-by: OpenCode <opencode-noreply@coinbase.com>
1 parent cb5a4b6 commit b8941c3

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

src/CertManager.sol

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,8 @@ contract CertManager is ICertManager {
319319
bytes memory signatureHints
320320
) internal view returns (VerifiedCert memory cert, bytes32 identity) {
321321
Asn1Ptr root = certificate.root();
322-
_requireAsn1Tag(certificate, root, 0x30);
323322
require(root.totalLength() == certificate.length, "invalid cert length");
324323
Asn1Ptr tbsCertPtr = certificate.firstChildOf(root);
325-
_requireAsn1Tag(certificate, tbsCertPtr, 0x30);
326324
(uint64 notAfter, int64 maxPathLen, bytes32 issuerHash, bytes32 subjectHash, bytes memory pubKey) =
327325
_parseTbs(certificate, tbsCertPtr, ca);
328326

@@ -414,7 +412,6 @@ contract CertManager is ICertManager {
414412
pure
415413
returns (bytes memory subjectPubKey)
416414
{
417-
_requireAsn1Tag(certificate, subjectPublicKeyInfoPtr, 0x30);
418415
Asn1Ptr pubKeyAlgoPtr = certificate.firstChildOf(subjectPublicKeyInfoPtr);
419416
_requireAsn1Tag(certificate, pubKeyAlgoPtr, 0x30);
420417
Asn1Ptr pubKeyAlgoIdPtr = certificate.firstChildOf(pubKeyAlgoPtr);

0 commit comments

Comments
 (0)