Skip to content

Conversation

Ryu-ga
Copy link
Contributor

@Ryu-ga Ryu-ga commented Feb 15, 2024

PlayCover/PlayCover#1359

First, there is a need for a response from SecItemDelete with errSecItemNotFound in some iOS framework, as it works well on iOS.
Second, the linked iOS app had a memory issue with ARC and SecCreateKeyWithData, I think it is weird that it require Unmanaged.passRetained but it crashed every time with unknownObjectReleasing every time end of SecItem methods in the app, and SecItem-methods do not have responsibility for releasing the referenced object *result. [https://developer.apple.com/documentation/security/1401659-secitemadd]

@XuYicong XuYicong requested a review from ohaiibuzzle February 15, 2024 09:44
@XuYicong XuYicong changed the base branch from 3.0.0-staging to master February 15, 2024 09:45
@ohaiibuzzle
Copy link
Member

Looks good to me, other than the still painful file-based management of keys

I think we need to try a binary-based solution instead. Not ideal, but should be less painful

@ohaiibuzzle
Copy link
Member

@Ryu-ga Since the r_Ref fix is in-tree now, please rebase your PR

Methods follow the Create Rules.
Add item not found response in SecItemDelete.
@Ryu-ga
Copy link
Contributor Author

Ryu-ga commented Feb 17, 2024

Looks good to me, other than the still painful file-based management of keys

I think we need to try a binary-based solution instead. Not ideal, but should be less painful

That's good idea. And there is need to find out more similar keychain file name generator to apple's one.

@Ryu-ga Since the r_Ref fix is in-tree now, please rebase your PR

I rebased it.

@ohaiibuzzle
Copy link
Member

That's good idea. And there is need to find out more similar keychain file name generator to apple's one.

They don't use individual files. They use a SQLite 3 database.

@Ryu-ga
Copy link
Contributor Author

Ryu-ga commented Feb 18, 2024

That's good idea. And there is need to find out more similar keychain file name generator to apple's one.

They don't use individual files. They use a SQLite 3 database.

You're correct; I meant that before transitioning to db-based structure for PlayChain we require more distinguishable file names because certain keychain items cannot be fully separated for now.

Copy link
Member

@ohaiibuzzle ohaiibuzzle left a comment

Choose a reason for hiding this comment

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

Patch looks good to me

@ohaiibuzzle
Copy link
Member

we require more distinguishable file names because certain keychain items cannot be fully separated for now

Well to be clear, there are already collisions now, just that it doesn’t affect us too much.
Also, fyi, we cannot use straight up SQLite 3. It is not available by default in AppKit/UIKit

@TheMoonThatRises TheMoonThatRises changed the title Fix some SecItem methods hook in PlahChain. Fix some SecItem methods hook in PlayChain. Feb 18, 2024
@XuYicong XuYicong merged commit 670b2fe into PlayCover:master Feb 18, 2024
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.

4 participants