Skip to content

Commit

Permalink
Merge pull request #132 from wtlucy/secureRandom_master
Browse files Browse the repository at this point in the history
MYFACES-4373: prefer SecureRandom for token generation
  • Loading branch information
tandraschko committed Jan 13, 2021
2 parents 2683d7e + 413d25b commit cc6e1cc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions impl/src/main/java/org/apache/myfaces/config/MyfacesConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,12 @@ public class MyfacesConfig
* Adds a random key to the generated view state session token.
*/
@JSFWebConfigParam(since="2.1.9, 2.0.15", expectedValues="secureRandom, random",
defaultValue="random", group="state")
defaultValue="secureRandom", group="state")
public static final String RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN
= "org.apache.myfaces.RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN";
private static final String RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_DEFAULT = "random";
public static final String RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_SECURE_RANDOM = "secureRandom";
public static final String RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_RANDOM = "random";
private static final String RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_DEFAULT = RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_SECURE_RANDOM;

/**
* Set the default length of the random key added to the view state session token.
Expand Down Expand Up @@ -499,16 +499,16 @@ public class MyfacesConfig
= "org.apache.myfaces.RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_SECURE_RANDOM_ALGORITHM";
private static final String RANDOM_KEY_IN_VIEW_STATE_SESSION_TOKEN_SECURE_RANDOM_ALGORITHM_DEFAULT = "SHA1PRNG";

public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM = "secureRandom";
public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_RANDOM = "random";

/**
* Defines how to generate the csrf session token.
*/
@JSFWebConfigParam(since="2.2.0", expectedValues="secureRandom, random", defaultValue="none", group="state")
@JSFWebConfigParam(since="2.2.0", expectedValues="secureRandom, random", defaultValue="secureRandom", group="state")
public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN
= "org.apache.myfaces.RANDOM_KEY_IN_CSRF_SESSION_TOKEN";
private static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_DEFAULT = "random";

public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM = "secureRandom";
public static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_RANDOM = "random";
private static final String RANDOM_KEY_IN_CSRF_SESSION_TOKEN_DEFAULT = RANDOM_KEY_IN_CSRF_SESSION_TOKEN_SECURE_RANDOM;

/**
* Indicates that the serialized state will be compressed before it is written to the session. By default true.
Expand Down

0 comments on commit cc6e1cc

Please sign in to comment.