public TlsHandshakeHash stopTracking() { Digest prfHash = TlsUtils.cloneHash(prfHashAlgorithm.shortValue(), (Digest)hashes.get(prfHashAlgorithm)); if (buf != null) { buf.updateDigest(prfHash); } DeferredHash result = new DeferredHash(prfHashAlgorithm, prfHash); result.init(context); return result; }
public void sealHashAlgorithms() { checkStopBuffering(); }
public void trackHashAlgorithm(short hashAlgorithm) { if (buf == null) { throw new IllegalStateException("Too late to track more hash algorithms"); } checkTrackingHash(Shorts.valueOf(hashAlgorithm)); }
DTLSReliableHandshake(TlsContext context, DTLSRecordLayer transport) { this.recordLayer = transport; this.handshakeHash = new DeferredHash(); this.handshakeHash.init(context); }
DTLSReliableHandshake(TlsContext context, DTLSRecordLayer transport) { this.recordLayer = transport; this.handshakeHash = new DeferredHash(); this.handshakeHash.init(context); }
public TlsHandshakeHash stopTracking() { Digest prfHash = TlsUtils.cloneHash(prfHashAlgorithm.shortValue(), (Digest)hashes.get(prfHashAlgorithm)); if (buf != null) { buf.updateDigest(prfHash); } DeferredHash result = new DeferredHash(prfHashAlgorithm, prfHash); result.init(context); return result; }
void init(TlsContext context) { this.readCipher = new TlsNullCipher(context); this.writeCipher = this.readCipher; this.handshakeHash = new DeferredHash(); this.handshakeHash.init(context); setPlaintextLimit(DEFAULT_PLAINTEXT_LIMIT); }
public void trackHashAlgorithm(short hashAlgorithm) { if (buf == null) { throw new IllegalStateException("Too late to track more hash algorithms"); } checkTrackingHash(Shorts.valueOf(hashAlgorithm)); }
public void sealHashAlgorithms() { checkStopBuffering(); }
void init(TlsContext context) { this.readCipher = new TlsNullCipher(context); this.writeCipher = this.readCipher; this.handshakeHash = new DeferredHash(); this.handshakeHash.init(context); setPlaintextLimit(DEFAULT_PLAINTEXT_LIMIT); }
public TlsHandshakeHash notifyPRFDetermined() { int prfAlgorithm = context.getSecurityParameters().getPrfAlgorithm(); if (prfAlgorithm == PRFAlgorithm.tls_prf_legacy) { CombinedHash legacyHash = new CombinedHash(); legacyHash.init(context); buf.updateDigest(legacyHash); return legacyHash.notifyPRFDetermined(); } this.prfHashAlgorithm = Shorts.valueOf(TlsUtils.getHashAlgorithmForPRFAlgorithm(prfAlgorithm)); checkTrackingHash(prfHashAlgorithm); return this; }
public Digest forkPRFHash() { checkStopBuffering(); if (buf != null) { Digest prfHash = TlsUtils.createHash(prfHashAlgorithm.shortValue()); buf.updateDigest(prfHash); return prfHash; } return TlsUtils.cloneHash(prfHashAlgorithm.shortValue(), (Digest)hashes.get(prfHashAlgorithm)); }
public TlsHandshakeHash notifyPRFDetermined() { int prfAlgorithm = context.getSecurityParameters().getPrfAlgorithm(); if (prfAlgorithm == PRFAlgorithm.tls_prf_legacy) { CombinedHash legacyHash = new CombinedHash(); legacyHash.init(context); buf.updateDigest(legacyHash); return legacyHash.notifyPRFDetermined(); } this.prfHashAlgorithm = Shorts.valueOf(TlsUtils.getHashAlgorithmForPRFAlgorithm(prfAlgorithm)); checkTrackingHash(prfHashAlgorithm); return this; }
public Digest forkPRFHash() { checkStopBuffering(); if (buf != null) { Digest prfHash = TlsUtils.createHash(prfHashAlgorithm.shortValue()); buf.updateDigest(prfHash); return prfHash; } return TlsUtils.cloneHash(prfHashAlgorithm.shortValue(), (Digest)hashes.get(prfHashAlgorithm)); }