Package ch.ethz.inf.vs.scandium.util

Examples of ch.ethz.inf.vs.scandium.util.DatagramReader.readBytes()


      long sequenceNumber = reader.readLong(SEQUENCE_NUMBER_BITS);
 
      int length = reader.read(LENGTH_BITS);
 
      // delay decryption/interpretation of fragment
      byte[] fragmentBytes = reader.readBytes(length);
 
      records.add(new Record(contentType, version, epoch, sequenceNumber, length, fragmentBytes));
    }
   
    return records;
View Full Code Here


    DatagramReader reader = new DatagramReader(byteArray);
   
    // create explicit nonce from values provided in DTLS record
    byte[] explicitNonce = generateExplicitNonce();
    // retrieve actual explicit nonce as contained in GenericAEADCipher struct (8 bytes long)
    byte[] explicitNonceUsed = reader.readBytes(8);
    if (!Arrays.equals(explicitNonce, explicitNonceUsed) && LOGGER.isLoggable(Level.FINE)) {
      StringBuffer b = new StringBuffer("The explicit nonce used by the sender does not match the values provided in the DTLS record");
      b.append("\nUsed    : ").append(ByteArrayUtils.toHexString(explicitNonceUsed));
      b.append("\nExpected: ").append(ByteArrayUtils.toHexString(explicitNonce));
      LOGGER.log(Level.FINE, b.toString());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.