src/java.base/share/classes/sun/security/ssl/Authenticator.java
branchJDK-8145252-TLS13-branch
changeset 56674 d2ba9e6f1cac
parent 56542 56aaa6cb3693
equal deleted inserted replaced
56673:fb6aa68ef1ab 56674:d2ba9e6f1cac
   266     }
   266     }
   267 
   267 
   268     // For TLS 1.3
   268     // For TLS 1.3
   269     private static final class TLS13Authenticator extends SSLAuthenticator {
   269     private static final class TLS13Authenticator extends SSLAuthenticator {
   270         // Block size of TLS v1.3:
   270         // Block size of TLS v1.3:
   271         //     sequence number + record type + protocol version + record length
   271         //     record type + protocol version + record length + sequence number
   272         private static final int BLOCK_SIZE = 13;   // 8 + 1 + 2 + 2
   272         private static final int BLOCK_SIZE = 13;   // 1 + 2 + 2 + 8
   273 
   273 
   274         private TLS13Authenticator(ProtocolVersion protocolVersion) {
   274         private TLS13Authenticator(ProtocolVersion protocolVersion) {
   275             super(new byte[BLOCK_SIZE]);
   275             super(new byte[BLOCK_SIZE]);
   276             block[9] = ProtocolVersion.TLS12.major;
   276             block[9] = ProtocolVersion.TLS12.major;
   277             block[10] = ProtocolVersion.TLS12.minor;
   277             block[10] = ProtocolVersion.TLS12.minor;
   401 
   401 
   402             return ad;
   402             return ad;
   403         }
   403         }
   404     }
   404     }
   405 
   405 
   406     static interface MAC {
   406     interface MAC {
   407         MacAlg macAlg();
   407         MacAlg macAlg();
   408 
   408 
   409         /**
   409         /**
   410          * Compute and returns the MAC for the remaining data
   410          * Compute and returns the MAC for the remaining data
   411          * in this ByteBuffer.
   411          * in this ByteBuffer.