Skip to content

Commit 4ff6c1e

Browse files
Test case
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
1 parent 93cf5b8 commit 4ff6c1e

12 files changed

Lines changed: 368 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
4+
# Ignore Gradle build output directory
5+
build
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* This build file was auto generated by running the Gradle 'init' task
3+
* by 'arthur' at '28/11/20 22:29' with Gradle 3.0
4+
*
5+
* This generated file contains a sample Java project to get you started.
6+
* For more details take a look at the Java Quickstart chapter in the Gradle
7+
* user guide available at https://docs.gradle.org/3.0/userguide/tutorial_java_projects.html
8+
*/
9+
10+
// Apply the java plugin to add support for Java
11+
apply plugin: 'java'
12+
13+
// In this section you declare where to find the dependencies of your project
14+
repositories {
15+
// Use 'jcenter' for resolving your dependencies.
16+
// You can declare any Maven/Ivy/file repository here.
17+
jcenter()
18+
}
19+
20+
// In this section you declare the dependencies for your production and test code
21+
dependencies {
22+
testImplementation 'junit:junit:4.12'
23+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<verification-metadata>
3+
<configuration>
4+
<verify-metadata>true</verify-metadata>
5+
<verify-signatures>false</verify-signatures>
6+
</configuration>
7+
</verification-metadata>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

java/ql/integration-tests/all-platforms/java/properties-files/weak-hashing/gradlew

Lines changed: 185 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

java/ql/integration-tests/all-platforms/java/properties-files/weak-hashing/gradlew.bat

Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* This settings file was auto generated by the Gradle buildInit task
3+
* by 'arthur' at '28/11/20 22:29' with Gradle 3.0
4+
*
5+
* The settings file is used to specify which projects to include in your build.
6+
* In a single project build this file can be empty or even removed.
7+
*
8+
* Detailed information about configuring a multi-project build in Gradle can be found
9+
* in the user guide at https://docs.gradle.org/3.0/userguide/multi_project_builds.html
10+
*/
11+
12+
/*
13+
// To declare projects as part of a multi-project build use the 'include' method
14+
include 'shared'
15+
include 'api'
16+
include 'services:webservice'
17+
*/
18+
19+
rootProject.name = 'weak-hashing'
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.example;
2+
3+
import java.util.Properties;
4+
import java.io.FileInputStream;
5+
import java.io.IOException;
6+
import java.security.MessageDigest;
7+
import java.security.NoSuchAlgorithmException;
8+
9+
public class WeakHashing {
10+
void hashing() throws NoSuchAlgorithmException, IOException {
11+
java.util.Properties props = new java.util.Properties();
12+
props.load(new FileInputStream("example.properties"));
13+
14+
MessageDigest bad = MessageDigest.getInstance(props.getProperty("hashAlg1"));
15+
16+
MessageDigest ok = MessageDigest.getInstance(props.getProperty("hashAlg2"));
17+
}
18+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
hashAlg1=MD5
2+
hashAlg2=SHA-256
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| src/main/java/com/example/WeakHashing.java:14:55:14:83 | getProperty(...) |

0 commit comments

Comments
 (0)