From 44c5f813469ad26a81cd1b6e7aee92e426e63676 Mon Sep 17 00:00:00 2001 From: Kerby Geffrard Date: Thu, 5 Mar 2026 10:19:23 -0500 Subject: [PATCH] Export ParseDeviceInfo for use outside the verifier --- appattest/device_info.go | 4 ++-- appattest/verify_attestation.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/appattest/device_info.go b/appattest/device_info.go index a527d22..91892d6 100644 --- a/appattest/device_info.go +++ b/appattest/device_info.go @@ -56,10 +56,10 @@ type DeviceInfo struct { BuildVariant string } -// parseDeviceInfo attempts to extract DeviceInfo from the leaf certificate. +// ParseDeviceInfo attempts to extract DeviceInfo from the leaf certificate. // Returns nil if the extension is not present. Parsing is best-effort: // unrecognized or malformed fields are silently skipped. -func parseDeviceInfo(cert *x509.Certificate) *DeviceInfo { +func ParseDeviceInfo(cert *x509.Certificate) *DeviceInfo { var extValue []byte for _, ext := range cert.Extensions { if ext.Id.Equal(oidDeviceInfo) { diff --git a/appattest/verify_attestation.go b/appattest/verify_attestation.go index 1a33dac..67962a7 100644 --- a/appattest/verify_attestation.go +++ b/appattest/verify_attestation.go @@ -135,7 +135,7 @@ func VerifyAttestationPure(in *VerifyAttestationInputPure) (VerifyAttestationOut BundleDigest: authenticatorData.RelayingPartyHash, KeyID: computedPubkeyHash[:], - DeviceInfo: parseDeviceInfo(leafCert), + DeviceInfo: ParseDeviceInfo(leafCert), }, nil }