3334353637383940414243
refreshDescriptor(); } void updateStatus(RouterStatus status) { if(!identityHash.equals(status.getIdentity())) throw new TorException("Identity hash does not match status update"); this.status = status; this.cachedCountryCode = null; this.descriptor = null; refreshDescriptor(); }
79808182838485868788
else { inputStream.addInputCell(cell); synchronized(windowLock) { deliverWindow--; if(deliverWindow < 0) throw new TorException("Stream has negative delivery window"); } considerSendingSendme(); } }
190191192193194195196197198199200
synchronized(windowLock) { while(packageWindow == 0) { try { windowLock.wait(); } catch (InterruptedException e) { throw new TorException("Thread interrupted while waiting for stream package window"); } } if(decrement) packageWindow--; }
1516171819202122
private static SecureRandom createRandom() { try { return SecureRandom.getInstance("SHA1PRNG"); } catch (NoSuchAlgorithmException e) { throw new TorException(e); } }
3536373839404142
private MessageDigest createDigestInstance(boolean isDigest256) { try { final String algorithm = (isDigest256) ? TOR_DIGEST256_ALGORITHM : TOR_DIGEST_ALGORITHM; return MessageDigest.getInstance(algorithm); } catch (NoSuchAlgorithmException e) { throw new TorException(e); } }
5960616263646566
// Make a clone because #digest() will reset the MessageDigest instance // and we want to be able to use this class for running digests on circuits final MessageDigest clone = (MessageDigest) digestInstance.clone(); return clone.digest(); } catch (CloneNotSupportedException e) { throw new TorException(e); } }
7475767778798081
try { final MessageDigest clone = (MessageDigest) digestInstance.clone(); clone.update(data, offset, length); return clone.digest(); } catch (CloneNotSupportedException e) { throw new TorException(e); } }
119120121122123124125126
*/ public void update(String input) { try { digestInstance.update(input.getBytes("ISO-8859-1")); } catch (UnsupportedEncodingException e) { throw new TorException(e); } }
2021222324252627
static KeyPairGenerator createGenerator() { try { return KeyPairGenerator.getInstance("RSA"); } catch (NoSuchAlgorithmException e) { throw new TorException(e); } }
39404142434445464748
*/ public HybridEncryption() { try { cipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA1AndMGF1Padding"); } catch (NoSuchAlgorithmException e) { throw new TorException(e); } catch (NoSuchPaddingException e) { throw new TorException(e); } }