Skip to content

add group to ios singer config#442

Open
JesusMcCloud wants to merge 1 commit into
developmentfrom
fix/iosGroup
Open

add group to ios singer config#442
JesusMcCloud wants to merge 1 commit into
developmentfrom
fix/iosGroup

Conversation

@JesusMcCloud
Copy link
Copy Markdown
Collaborator

@gp-iaik enjoy!

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4a1b2a808

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

kSecPublicKeyAttrs mapsTo createCFDictionary {
kSecAttrApplicationLabel mapsTo alias
kSecAttrIsPermanent mapsTo true
kSecAttrApplicationTag mapsTo KeychainTags.PUBLIC_KEYS
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Apply tagOverride to generated public keys

When callers set IosSigningKeyConfiguration.tagOverride, the private key is created under the override tag but the public key is still written under the default tag here. storeKeyMetadata() and getSignerForKey() query PREFIX_PUBLIC_KEY + tagOverride, so key creation fails with errSecItemNotFound after generating an orphan default-tagged public key, and overridden keys are unusable.

Useful? React with 👍 / 👎.

Comment on lines 432 to +435
kSecPrivateKeyAttrs mapsTo createCFDictionary {
kSecAttrApplicationLabel mapsTo alias
kSecAttrIsPermanent mapsTo true
kSecAttrApplicationTag mapsTo KeychainTags.PRIVATE_KEYS
kSecAttrApplicationTag mapsTo (config.tagOverride?.let { KeychainTags.PREFIX_PRIVATE_KEY+it } ?:KeychainTags.PRIVATE_KEYS)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Store private keys in the configured access group

When createSigningKey is called with accessGroup, only the public-key attributes receive kSecAttrAccessGroup; the private key remains in the default group. A later getSignerForKey(... accessGroup = ...) returns a signer whose private-key lookup includes that access group, so signing fails with retrieve private key even though the public key and metadata were found.

Useful? React with 👍 / 👎.

?: throw UnsupportedCryptoException("Keychain access is unsupported outside of a Bundle")
Pair("supreme.privatekey-$bundleId", "supreme.publickey-$bundleId")
?: throw UnsupportedCryptoException("Keychain access is unsupported outside of a Bundle. If you must, specify tagOverride, but here be dragons")
Pair("$PREFIX_PRIVATE_KEY$bundleId", "$PREFIX_PUBLIC_KEY-$bundleId")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the existing default public-key tag

This constructs the default public-key tag as supreme.publickey--<bundleId> because PREFIX_PUBLIC_KEY already ends with -, whereas previous releases used supreme.publickey-<bundleId>. After upgrading, keys created under the old default tag can no longer be found or deleted by the new getPublicKey/metadata/delete queries, which breaks existing iOS keychain entries.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant