rspec/rules/S5547/swift/how-to-fix-it/cryptoswift.adoc

29 lines
542 B
Plaintext
Raw Normal View History

2023-06-12 15:58:19 +02:00
== How to fix it in CryptoSwift
=== Code examples
include::../../common/fix/code-rationale.adoc[]
==== Noncompliant code example
[source,swift,diff-id=21,diff-type=noncompliant]
2023-06-12 15:58:19 +02:00
----
import CryptoSwift
let blowfish = try Blowfish(key: key, blockMode: GCM(iv: iv, mode: .combined), padding: .pkcs7) // Noncompliant
----
==== Compliant solution
[source,swift,diff-id=21,diff-type=compliant]
2023-06-12 15:58:19 +02:00
----
import CryptoSwift
let aes = try AES(key: key, iv: iv)
----
=== How does this work?
include::../../common/fix/strong-cryptography.adoc[]