Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LAContext passed when decrypting will not be respected #23

Closed
ma-pe opened this issue Mar 8, 2018 · 4 comments
Closed

LAContext passed when decrypting will not be respected #23

ma-pe opened this issue Mar 8, 2018 · 4 comments

Comments

@ma-pe
Copy link

ma-pe commented Mar 8, 2018

I'd like to decrypt multiple things in a short amount of time. I don't want to prompt the user for authentication every time.

I am aware of the bug concerning touchIDAuthenticationAllowableReuseDuration (#9). Though I'd like to use the default time-limit (10 minutest) when passing an already authentified LAContext.

When passing the LAContext I am still prompted for authentication. I guess that's because the context is not regarded by the library:

@available(iOS 10.3, *) // API available at 10.0, but bugs made it unusable on versions lower than 10.3
public func decrypt(_ encrypted: Data, hash: Hash = .sha256, context: LAContext? = nil) throws -> Data {
  return try helper.decrypt(encrypted, privateKey: privateKey(), hash: hash)
}
@hfossli
Copy link
Contributor

hfossli commented Mar 8, 2018

That’s a typo. The context should be forwarded. If you have time for a PR that would be 😍

@hfossli
Copy link
Contributor

hfossli commented Mar 8, 2018

The private key should be resolved in same way as sign method is resolving the private key

@ma-pe
Copy link
Author

ma-pe commented Mar 8, 2018

Sure. I'll do it now :-)

ma-pe pushed a commit to ma-pe/EllipticCurveKeyPair that referenced this issue Mar 8, 2018
ma-pe pushed a commit to ma-pe/EllipticCurveKeyPair that referenced this issue Mar 8, 2018
ma-pe pushed a commit to ma-pe/EllipticCurveKeyPair that referenced this issue Mar 8, 2018
ma-pe pushed a commit to ma-pe/EllipticCurveKeyPair that referenced this issue Mar 8, 2018
@ma-pe
Copy link
Author

ma-pe commented Mar 8, 2018

I was fighting with my auto-code-cleanup-thingy. PR should be clean. :-)

I tested it. It works as expected for me now. Therefore I close the issue.

@ma-pe ma-pe closed this as completed Mar 8, 2018
hfossli pushed a commit that referenced this issue Mar 8, 2018
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

No branches or pull requests

2 participants