修改:修改判断方式

wuhaoyang
RenFengJiang 10 months ago
parent 13c9b916b4
commit 77cedae6b1
  1. 2
      sonar-keyware-plugins-cxx/src/main/java/com/keyware/sonar/cxx/rules/checkers/FVNRShaChecker.java

@ -44,7 +44,7 @@ public class FVNRShaChecker extends SquidCheck<Grammar> {
for (String str:inputFileLines) { for (String str:inputFileLines) {
if(str.startsWith("#include")){ if(str.startsWith("#include")){
if(str.contains("<openssl/") || str.contains("<cryptopp/") ){ if(str.contains("<openssl/") || str.contains("<cryptopp/") ){
if(!str.contains("<openssl/sha.h>") && !str.contains("<cryptopp/blake2.h>") && !str.contains("<cryptopp/md5.h>")){ if(!str.contains("sha.h>") && !str.contains("blake2.h>") && !str.contains("md5.h>")){
getContext().createFileViolation(this, "应使用不可逆标准散列算法"); getContext().createFileViolation(this, "应使用不可逆标准散列算法");
} }
} }

Loading…
Cancel
Save