auth0 / Guardian.swift

Swift toolkit for Auth0 Guardian API
https://auth0.com/guardian
MIT License
9 stars 19 forks source link

Remove unsafe Swift code from OTP code generation #105

Open emiliopavia opened 1 year ago

emiliopavia commented 1 year ago

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

On iOS 16 we're receiving several exceptions from the code(counter:) function in OneTimePasswordGenerator. The exception is related to the block called in the withUnsafeBytes function.

This PR aims to replace the code without using unsafe pointers (as suggested by Apple in Swift support forums).

References

Testing

The code is already covered by tests.

Checklist

ObidosDev commented 1 year ago

Any update on this? Looks like this code produce error Fatal error: self must be a properly aligned pointer for types Pointee and T on line let value = start.withMemoryRebound(to: UInt32.self, capacity: 1) { $0 } This PR may fix it :)

ObidosDev commented 1 year ago

@Widcket may you take a look?

Widcket commented 1 year ago

Hi @emiliopavia and @ObidosDev, thanks for raising this. However, I'm not the maintainer of this library –I'll defer to @ionutmanolache-okta.

ObidosDev commented 1 year ago

Any update on this? This is kinda huge problem for now

ObidosDev commented 1 year ago

Updates?)