CryptoPassphrase  Check-in [b57405c1d0]

Overview
Comment:[iOS] Fix missing 0 byte after passphrase
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b57405c1d07a52c27807f6fe19eff1b1277663f051690a3a3336dc626c6f4825
User & Date: js on 2022-06-18 15:28:21
Other Links: manifest | tags
Context
2022-08-21
11:58
Adjust to ObjFW changes check-in: 82f79a19ab user: js tags: trunk
2022-06-18
15:28
[iOS] Fix missing 0 byte after passphrase check-in: b57405c1d0 user: js tags: trunk
13:15
[iOS] Fix using key files check-in: 882469f9d5 user: js tags: trunk
Changes

Modified iOS/ShowDetailsController.swift from [53bee1dba4] to [cfd55e8cf6].

149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164

            let keyFilePath = documentDirectory.ofObject.appendingPathComponent(
                keyFile.ofObject)
            generator.keyFile = OFMutableData(contentsOfFile: keyFilePath)
        }

        let passphraseText = (passphraseField?.text ?? "") as NSString
        let passphraseLen =
            passphraseText.lengthOfBytes(using: String.Encoding.utf8.rawValue)
        let passphrase = OFSecureData(count: passphraseLen,
                                      allowsSwappableMemory: false)
        memcpy(passphrase.mutableItems, passphraseText.utf8String!,
               passphraseLen)
        generator.passphrase = passphrase

        let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)







|
|







149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164

            let keyFilePath = documentDirectory.ofObject.appendingPathComponent(
                keyFile.ofObject)
            generator.keyFile = OFMutableData(contentsOfFile: keyFilePath)
        }

        let passphraseText = (passphraseField?.text ?? "") as NSString
        let passphraseLen = passphraseText.lengthOfBytes(
            using: String.Encoding.utf8.rawValue) + 1
        let passphrase = OFSecureData(count: passphraseLen,
                                      allowsSwappableMemory: false)
        memcpy(passphrase.mutableItems, passphraseText.utf8String!,
               passphraseLen)
        generator.passphrase = passphrase

        let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)