mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Update swift/ql/src/queries/Security/CWE-321/HardcodedEncryptionKey.swift
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
03ef18b286
commit
9def3dd440
@@ -14,7 +14,7 @@ func encrypt(padding : Padding) {
|
||||
|
||||
// GOOD: Using randomly generated keys for encryption
|
||||
var key = [Int8](repeating: 0, count: 10)
|
||||
let status = SecRandomCopyBytes(kSecRandomDefault, key.count, &key)
|
||||
let status = SecRandomCopyBytes(kSecRandomDefault, key.count - 1, &key)
|
||||
if status == errSecSuccess {
|
||||
let keyString = String(cString: key)
|
||||
let ivString = getRandomIV()
|
||||
|
||||
Reference in New Issue
Block a user