-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hello,
I found an issue in the code of SDOSEnvironment when using the -b flag in the SDOSEnvironment Build Phases script. The problem seems to be that the function generateDefaultPassword() returns an empty string, what causes a crash in the RNCryptor dependency.
This is the code where the error occurs:
private func generateDefaultPassword(bundle: Bundle = Bundle.main) -> String {
let bundle = bundle.bundleIdentifier
var password = ""
var bytes = [UInt8]()
if let bundle = bundle {
let characters = Array(bundle)
characters.forEach { (character) in
var char = character.asciiValue ?? 0
char += 7
bytes.append(char)
}
}
if let string = String(bytes: bytes, encoding: .utf8) {
password = string
}
return password
}I believe the problem is that this code encodes using ascii but decodes using utf8. Changing the utf8 decoding to ascii should resolve the problem but I am not sure whether this is the intended behaviour.
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels