Skip to content

Commit a65ca1e

Browse files
committed
experimental: enable a different some of it instead.
1 parent 569ddf5 commit a65ca1e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

swift/ql/test/query-tests/Security/CWE-327/test_commoncrypto.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func test_commoncrypto1(key: Data, iv: Data, dataIn: Data, dataOut: inout Data)
126126
// semi-realistic test case
127127
var myCryptor: CCCryptorRef?
128128
var dataOutWritten = 0
129-
129+
/*
130130
key.withUnsafeBytes({
131131
keyPtr in
132132
iv.withUnsafeBytes({
@@ -175,7 +175,7 @@ func test_commoncrypto1(key: Data, iv: Data, dataIn: Data, dataOut: inout Data)
175175
})
176176
})
177177
})
178-
})
178+
})*/
179179
}
180180

181181
func test_commoncrypto2(
@@ -185,7 +185,7 @@ func test_commoncrypto2(
185185
dataOut: UnsafeMutableRawPointer, dataOutAvail: Int) {
186186
var myCryptor: CCCryptorRef?
187187
var dataOutWritten = 0
188-
/*
188+
189189
// algorithms
190190
_ = CCCrypt(CCOperation(kCCEncrypt), CCAlgorithm(kCCAlgorithmAES128), 0, key, keyLen, iv, dataIn, dataInLen, dataOut, dataOutAvail, nil)
191191
_ = CCCrypt(CCOperation(kCCEncrypt), CCAlgorithm(kCCAlgorithmAES), 0, key, keyLen, iv, dataIn, dataInLen, dataOut, dataOutAvail, nil)
@@ -214,4 +214,4 @@ func test_commoncrypto2(
214214
_ = CCCryptorCreateWithMode(CCOperation(kCCAlgorithmAES), CCMode(kCCModeOFB), CCAlgorithm(kCCAlgorithm3DES), CCPadding(0), iv, key, keyLen, nil, 0, 0, CCModeOptions(0), &myCryptor)
215215
_ = CCCryptorCreateWithMode(CCOperation(kCCAlgorithmAES), CCMode(kCCModeRC4), CCAlgorithm(kCCAlgorithm3DES), CCPadding(0), iv, key, keyLen, nil, 0, 0, CCModeOptions(0), &myCryptor)
216216
_ = CCCryptorCreateWithMode(CCOperation(kCCAlgorithmAES), CCMode(kCCModeCFB8), CCAlgorithm(kCCAlgorithm3DES), CCPadding(0), iv, key, keyLen, nil, 0, 0, CCModeOptions(0), &myCryptor)
217-
*/}
217+
}

0 commit comments

Comments
 (0)