]> source.dussan.org Git - vaadin-framework.git/commitdiff
Add comments clarifying the use of UUID for security tokens
authorLeif Åstrand <leif@vaadin.com>
Thu, 1 Dec 2016 08:44:34 +0000 (10:44 +0200)
committerVaadin Code Review <review@vaadin.com>
Fri, 2 Dec 2016 06:30:19 +0000 (06:30 +0000)
Change-Id: I3f48f9bb42b36d0a46926ec753f30df95491720b

server/src/main/java/com/vaadin/server/VaadinSession.java
server/src/main/java/com/vaadin/ui/ConnectorTracker.java

index 3e3202ee1bec26bbee5f68a86abcc6d6f508a336..84808e89da18e49b8bc4ff897087f9b760b4c534 100644 (file)
@@ -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();
 
     /**
index 2ba6f5e89591866421537dc82ef2431300827f98..ca901f6a6f353c879c1a8a559c5363135141e091 100644 (file)
@@ -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);
         }