Skip to content

Commit

Permalink
Merge pull request #123 from timmyteo/chore/cleanup
Browse files Browse the repository at this point in the history
Remove unused code and fix some errors
  • Loading branch information
paul-ion authored Aug 31, 2023
2 parents e26ec6f + 4cfa6ea commit 5099a5c
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 12 deletions.
4 changes: 0 additions & 4 deletions insecureinc/src/main/java/insecure/inc/Crypto.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;

/**
* Handles Crypto functions
*/
public class Crypto {
private static final String HASH_ALG="SHA-256";
private static SecretKeySpec key = null;
private static IvParameterSpec iv = null;
private static String masterSalt = "";

private static Crypto instance = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
}

private String getFileName(final Part part) {
final String partHeader = part.getHeader("content-disposition");
for (String content : part.getHeader("content-disposition").split(";")) {
if (content.trim().startsWith("filename")) {
return content.substring(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
}

private String getFileName(final Part part) {
final String partHeader = part.getHeader("content-disposition");
for (String content : part.getHeader("content-disposition").split(";")) {
if (content.trim().startsWith("filename")) {
return content.substring(
Expand Down
2 changes: 0 additions & 2 deletions insecureinc/src/main/java/insecure/inc/EmbeddedDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Random;
Expand All @@ -26,7 +25,6 @@ public void createDB() {

PreparedStatement pstmt;
Statement stmt;
ResultSet rs = null;
String createSQL = "create table users (usr varchar(30), pwd varchar(30))";


Expand Down
1 change: 0 additions & 1 deletion insecureinc/src/main/java/insecure/inc/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ public static String executePwdProg(String userPwd,String sourceFile) throws IOE
stdIn.flush();
stdIn.close();
p.waitFor();
StringBuilder sb = new StringBuilder();

if(p.exitValue() == 0){
reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
Expand Down
2 changes: 1 addition & 1 deletion insecureinc/src/main/webapp/cwe352loggedin.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function getProfile(){
<ul class="nav navbar-nav">
<li class="active"><a href="#">cwe352 - Cross-Site Request Forgery Guest</a></li>
<!-- Hidden in the guest UI
<li class="active"><a href="cwe352admin.jsp">CWE863 - Cross-Site Request Forgery Admin</a></li>
<li class="active"><a href="cwe352admin.jsp">CWE352 - Cross-Site Request Forgery Admin</a></li>
-->
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion insecureinc/src/main/webapp/cwe79loggedin.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function getProfile(){
<ul class="nav navbar-nav">
<li class="active"><a href="#">cwe79 - Cross-Site Scripting Guest</a></li>
<!-- Hidden in the guest UI
<li class="active"><a href="cwe79admin.jsp">CWE863 - Cross-Site Scripting Admin</a></li>
<li class="active"><a href="cwe79admin.jsp">CWE79 - Cross-Site Scripting Admin</a></li>
-->
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion insecureinc/src/main/webapp/cwe862loggedin.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ else{
<ul class="nav navbar-nav">
<li class="active"><a href="#">CWE862 - Missing Authorization Guest</a></li>
<!-- Hidden in the guest UI
<li class="active"><a href="cwe862admin.jsp">CWE863 - Missing Authorization Admin</a></li>
<li class="active"><a href="cwe862admin.jsp">CWE862 - Missing Authorization Admin</a></li>
-->
</ul>
<ul class="nav navbar-nav navbar-right">
Expand Down

0 comments on commit 5099a5c

Please sign in to comment.