@@ -82,42 +82,42 @@ enum Insecure {
8282
8383func testHashMethods( passwd : UnsafeRawBufferPointer , cert: String , encrypted_passwd : String , account_no : String , credit_card_no : String ) {
8484 var hash = Crypto . Insecure. MD5. hash ( data: passwd) // BAD
85- hash = Crypto . Insecure. MD5. hash ( bufferPointer: passwd) // BAD [NOT DETECTED]
85+ hash = Crypto . Insecure. MD5. hash ( bufferPointer: passwd) // BAD
8686 hash = Crypto . Insecure. MD5. hash ( data: cert) // BAD
8787 hash = Crypto . Insecure. MD5. hash ( data: encrypted_passwd) // GOOD (not sensitive)
8888 hash = Crypto . Insecure. MD5. hash ( data: account_no) // BAD
8989 hash = Crypto . Insecure. MD5. hash ( data: credit_card_no) // BAD
9090
9191 hash = Insecure . MD5. hash ( data: passwd) // BAD
92- hash = Insecure . MD5. hash ( bufferPointer: passwd) // BAD [NOT DETECTED]
92+ hash = Insecure . MD5. hash ( bufferPointer: passwd) // BAD
9393 hash = Insecure . MD5. hash ( data: cert) // BAD
9494 hash = Insecure . MD5. hash ( data: encrypted_passwd) // GOOD (not sensitive)
9595 hash = Insecure . MD5. hash ( data: account_no) // BAD
9696 hash = Insecure . MD5. hash ( data: credit_card_no) // BAD
9797
9898 hash = Crypto . Insecure. SHA1. hash ( data: passwd) // BAD
99- hash = Crypto . Insecure. SHA1. hash ( bufferPointer: passwd) // BAD [NOT DETECTED]
99+ hash = Crypto . Insecure. SHA1. hash ( bufferPointer: passwd) // BAD
100100 hash = Crypto . Insecure. SHA1. hash ( data: cert) // BAD
101101 hash = Crypto . Insecure. SHA1. hash ( data: encrypted_passwd) // GOOD (not sensitive)
102102 hash = Crypto . Insecure. SHA1. hash ( data: account_no) // BAD
103103 hash = Crypto . Insecure. SHA1. hash ( data: credit_card_no) // BAD
104104
105105 hash = Crypto . SHA256. hash ( data: passwd) // BAD, not a computationally expensive hash
106- hash = Crypto . SHA256. hash ( bufferPointer: passwd) // BAD, not a computationally expensive hash [NOT DETECTED]
106+ hash = Crypto . SHA256. hash ( bufferPointer: passwd) // BAD, not a computationally expensive hash
107107 hash = Crypto . SHA256. hash ( data: cert) // GOOD, computationally expensive hash not required
108108 hash = Crypto . SHA256. hash ( data: encrypted_passwd) // GOOD, not sensitive
109109 hash = Crypto . SHA256. hash ( data: account_no) // GOOD, computationally expensive hash not required
110110 hash = Crypto . SHA256. hash ( data: credit_card_no) // GOOD, computationally expensive hash not required
111111
112112 hash = Crypto . SHA384. hash ( data: passwd) // BAD, not a computationally expensive hash
113- hash = Crypto . SHA384. hash ( bufferPointer: passwd) // BAD, not a computationally expensive hash [NOT DETECTED]
113+ hash = Crypto . SHA384. hash ( bufferPointer: passwd) // BAD, not a computationally expensive hash
114114 hash = Crypto . SHA384. hash ( data: cert) // GOOD, computationally expensive hash not required
115115 hash = Crypto . SHA384. hash ( data: encrypted_passwd) // GOOD, not sensitive
116116 hash = Crypto . SHA384. hash ( data: account_no) // GOOD, computationally expensive hash not required
117117 hash = Crypto . SHA384. hash ( data: credit_card_no) // GOOD, computationally expensive hash not required
118118
119119 hash = Crypto . SHA512. hash ( data: passwd) // BAD, not a computationally expensive hash
120- hash = Crypto . SHA512. hash ( bufferPointer: passwd) // BAD, not a computationally expensive hash [NOT DETECTED]
120+ hash = Crypto . SHA512. hash ( bufferPointer: passwd) // BAD, not a computationally expensive hash
121121 hash = Crypto . SHA512. hash ( data: cert) // GOOD, computationally expensive hash not required
122122 hash = Crypto . SHA512. hash ( data: encrypted_passwd) // GOOD, not sensitive
123123 hash = Crypto . SHA512. hash ( data: account_no) // GOOD, computationally expensive hash not required
0 commit comments