src/jdk.crypto.ec/share/classes/sun/security/ec/XDHKeyAgreement.java
branchJDK-8171279-XDH-TLS-branch-2
changeset 56880 6ba2f471478b
parent 56858 829e9b5ace08
parent 51569 46ec360a7014
equal deleted inserted replaced
56879:2aefd58f8ec5 56880:6ba2f471478b
   187 
   187 
   188         if (secret == null) {
   188         if (secret == null) {
   189             throw new IllegalStateException("Not initialized correctly");
   189             throw new IllegalStateException("Not initialized correctly");
   190         }
   190         }
   191         int secretLen = this.secret.length;
   191         int secretLen = this.secret.length;
   192         if (offset + secretLen > sharedSecret.length) {
   192         if (secretLen > sharedSecret.length - offset) {
   193             throw new ShortBufferException("Need " + secretLen
   193             throw new ShortBufferException("Need " + secretLen
   194                 + " bytes, only " + (sharedSecret.length - offset)
   194                 + " bytes, only " + (sharedSecret.length - offset)
   195                 + " available");
   195                 + " available");
   196         }
   196         }
   197 
   197