Serialize sign calls that require auth prompt (#776) - #778
Conversation
|
Just noticed this fix is quiet similar to mine: #780 |
| // MARK: SecretStore | ||
|
|
||
| public func sign(data: Data, with secret: Secret, for provenance: SigningRequestProvenance) async throws -> Data { | ||
| if secret.attributes.authentication.required { |
There was a problem hiding this comment.
But my pull request is not doing that, so your version might be better.
|
Friendly ping @maxgoedjen |
|
@maxgoedjen another ping for review. |
|
Sorry about the delay on this one - I'm kinda skeptical this is the way we ought to be going... I thin the right solution here is probably some mix of config (keeping connections on) on the SSH side and possibly some sort of improved batching U (like, get prompted to approve all of them)? Let me think this one through a little more. |
Keeping connections open on the SSH side makes sense, but the issue here is establishing them for the first time. The only way I see batching to work is detecting that we already have pending request(s) and calling a sign with pending + current. PS. Persistent authentication helps here because we can SSH once and persist it. But the only way I found out about it was by reading the code. |
Newer Secure Enclave authentication requests cancel any in-flight request. When multiple signing requests arrive concurrently for the same protected key, this results in overlapping authentication prompts and causes all but the most recent request to fail.
This change serializes authentication requests so that:
Fixes: #532