Skip to content
Snippets Groups Projects
Commit 02a8a6f8 authored by Jenny Farstad Blindheimsvik's avatar Jenny Farstad Blindheimsvik
Browse files

Oppdateringer userDAO

parent 8538418d
No related branches found
No related tags found
No related merge requests found
Pipeline #72172 passed
......@@ -183,14 +183,16 @@ public class UserDAO {
* @return a random salt
*/
public byte[] generateSalt() {
byte[] bytes = new byte[16];
try{
SecureRandom random = SecureRandom.getInstance("SHA-256");
byte[] bytes = new byte[20];
SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
random.nextBytes(bytes);
return bytes;}
}
catch (NoSuchAlgorithmException e){
return null;
e.printStackTrace();
}
return bytes;
}
/**
......
......@@ -132,6 +132,7 @@ public class UserDAOTest extends JerseyTest {
}
}
@After
public void tearDown () {
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment