Преглед на файлове

Add comments clarifying the use of UUID for security tokens

Change-Id: I3f48f9bb42b36d0a46926ec753f30df95491720b
tags/8.0.0.alpha9
Leif Åstrand преди 7 години
родител
ревизия
187bf6130d
променени са 2 файла, в които са добавени 12 реда и са изтрити 0 реда
  1. 6
    0
      server/src/main/java/com/vaadin/server/VaadinSession.java
  2. 6
    0
      server/src/main/java/com/vaadin/ui/ConnectorTracker.java

+ 6
- 0
server/src/main/java/com/vaadin/server/VaadinSession.java Целия файл

@@ -754,6 +754,12 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable {

private int connectorIdSequence = 0;

/*
* Despite section 6 of RFC 4122, this particular use of UUID *is* adequate
* for security capabilities. Type 4 UUIDs contain 122 bits of random data,
* and UUID.randomUUID() is defined to use a cryptographically secure random
* generator.
*/
private final String csrfToken = UUID.randomUUID().toString();

/**

+ 6
- 0
server/src/main/java/com/vaadin/ui/ConnectorTracker.java Целия файл

@@ -785,6 +785,12 @@ public class ConnectorTracker implements Serializable {
}
String seckey = streamVariableToSeckey.get(variable);
if (seckey == null) {
/*
* Despite section 6 of RFC 4122, this particular use of UUID *is*
* adequate for security capabilities. Type 4 UUIDs contain 122 bits
* of random data, and UUID.randomUUID() is defined to use a
* cryptographically secure random generator.
*/
seckey = UUID.randomUUID().toString();
streamVariableToSeckey.put(variable, seckey);
}

Loading…
Отказ
Запис