Documentation
¶
Index ¶
Constants ¶
const ( SignatureSigned = "signed" SignatureAdHoc = "ad-hoc" SignatureUnsigned = "unsigned" SignatureUnreadable = "unreadable" )
Signature statuses reported for a main executable or a flat package.
const ( VerificationValid = "valid" VerificationInvalid = "invalid" VerificationUntrustedChain = "untrusted-chain" VerificationExpired = "expired" VerificationUnsupported = "unsupported" )
Signature verification results. They are reported only when verification is requested; otherwise receipts say not-verified.
Variables ¶
var ErrInvalidArchive = errors.New("invalid artifact archive")
ErrInvalidArchive matches an inspection failure caused by the artifact's own contents, such as a malformed archive or unparsable metadata, as opposed to a failure of the inspector itself.
Functions ¶
This section is empty.
Types ¶
type ArchitectureSignature ¶
type ArchitectureSignature struct {
CPUType uint32
CPUSubtype uint32
Arch string
CodeSignature string
CodeSignatureError string
Signer *SignerIdentity
}
ArchitectureSignature is the code signature of one Mach-O architecture slice. CPUType and CPUSubtype are the raw values from the universal header, or from the Mach-O header of a thin executable.
type IPAManifest ¶
type IPAManifest struct {
BundleID string
Name string
Version string
BuildNumber string
MinimumOSVersion string
Platforms []string
// DeviceFamilies lists the top-level app's UIDeviceFamily values (1 is
// iPhone, 2 is iPad). It is nil when the key is absent or unreadable.
DeviceFamilies []int
TeamID string
SignerCommonName string
Status string
NestedBundles []NestedBundle
Entitlements map[string]any
Profile *ProfileSummary
// CodeSignature classifies the main executable's embedded signature. It is
// empty when inspection stopped before the executable was read.
CodeSignature string
CodeSignatureError string
Signer *SignerIdentity
// Architectures lists every slice of the main executable in universal
// header order; a thin executable has one. CodeSignature, CodeSignatureError,
// and Signer describe the slice stored first. It is nil when no slice could
// be identified.
Architectures []ArchitectureSignature
// SignerConsistent reports whether every slice has the same signature
// classification and signer. It is nil when Architectures is nil.
SignerConsistent *bool
// SignatureVerification is set only when verification was requested. It
// covers the primary slice, the one stored first.
SignatureVerification *SignatureVerification
}
IPAManifest is the offline manifest for an IPA.
func InspectIPA ¶
func InspectIPA(source io.ReaderAt, size int64, includeEntitlements, includeProfile bool) (IPAManifest, error)
InspectIPA reads a bounded IPA zip and returns a metadata manifest. A missing embedded profile is reported as unsigned. The main executable's signer identity is read from its code signature, which is not verified.
func InspectIPAInfoPlist ¶
func InspectIPAInfoPlist(source io.ReaderAt, size int64) (IPAManifest, error)
InspectIPAInfoPlist reads only the IPA's top-level app Info.plist, under the same archive bounds as InspectIPA, without reading the executable or the embedded profile. Unlike InspectIPA, it fails when UIDeviceFamily is present but malformed, so a caller that acts on the device families never mistakes an unreadable declaration for an iPhone-only app.
func InspectIPAWithOptions ¶
func InspectIPAWithOptions(source io.ReaderAt, size int64, options IPAOptions) (IPAManifest, error)
InspectIPAWithOptions is InspectIPA with optional signature verification against the embedded Apple roots. Inspection failures caused by the IPA's own contents match ErrInvalidArchive.
type IPAOptions ¶
type IPAOptions struct {
IncludeEntitlements bool
IncludeProfile bool
// VerifySignature verifies the main executable's code signature offline.
VerifySignature bool
}
IPAOptions selects optional IPA inspection work.
type NestedBundle ¶
NestedBundle is an extension or App Clip inside the IPA.
type PKGComponent ¶
type PKGComponent struct {
// Path is the component's directory name inside the product archive.
Path string
Identifier string
Version string
InstallLocation string
// InstallKBytes is the size the Distribution declares, when it declares one.
InstallKBytes *int64
BundleIDs []string
// Primary marks the component that supplies the product's app metadata.
Primary bool
// App is read from the app bundle's Info.plist in the component payload.
App *PKGComponentApp
}
PKGComponent is a component package embedded in a product archive.
type PKGComponentApp ¶
type PKGComponentApp struct {
Path string
BundleID string
Name string
Version string
BuildNumber string
MinimumOSVersion string
Platforms []string
}
PKGComponentApp is the app bundle metadata read from a component payload.
type PKGManifest ¶
type PKGManifest struct {
ProductID string
Version string
InstallLocation string
BundleIDs []string
SignerCommonName string
TeamID string
Status string
// The fields below are set only for product archives. App fields come from
// the primary component's app Info.plist when its payload can be read.
BundleID string
BuildNumber string
MinimumOSVersion string
Platforms []string
HostArchitectures []string
Components []PKGComponent
// Warnings describe component metadata that could not be read without
// making the package unreadable.
Warnings []string
// PackageSignature classifies the xar signature in the table of contents.
PackageSignature string
PackageSignatureError string
Signer *SignerIdentity
// SignatureVerification is set only when verification was requested.
SignatureVerification *SignatureVerification
}
PKGManifest is the offline manifest for a flat component package or a Distribution-style product archive.
func InspectPKG ¶
func InspectPKG(source io.ReaderAt, size int64) (PKGManifest, error)
InspectPKG reads PackageInfo from a flat xar component package, or the Distribution and embedded component packages of a product archive. The signer identity is read from the package signature certificates, which are not verified.
func InspectPKGWithOptions ¶
func InspectPKGWithOptions(source io.ReaderAt, size int64, options PKGOptions) (PKGManifest, error)
InspectPKGWithOptions is InspectPKG with optional signature verification against the embedded Apple roots.
type PKGOptions ¶
type PKGOptions struct {
// VerifySignature verifies the package signature offline.
VerifySignature bool
}
PKGOptions selects optional package inspection work.
type ProfileSummary ¶
ProfileSummary is the embedded provisioning profile summary.
type SignatureVerification ¶
SignatureVerification is the outcome of an offline signature check. Detail says what was checked, or why the check failed.
type SignerIdentity ¶
type SignerIdentity struct {
CommonName string
TeamID string
Organization string
IssuerCommonName string
SerialNumber string
NotBefore string
NotAfter string
SHA1Fingerprint string
SHA256Fingerprint string
}
SignerIdentity describes the leaf certificate embedded in a signature. It is read from the artifact and is not validated against a trust store.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package artifactstest builds synthetic signed IPA and flat package fixtures.
|
Package artifactstest builds synthetic signed IPA and flat package fixtures. |