AbstractTlsPeer.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. using System.IO;
  4. namespace Org.BouncyCastle.Crypto.Tls
  5. {
  6. public abstract class AbstractTlsPeer
  7. : TlsPeer
  8. {
  9. public virtual bool ShouldUseGmtUnixTime()
  10. {
  11. /*
  12. * draft-mathewson-no-gmtunixtime-00 2. For the reasons we discuss above, we recommend that
  13. * TLS implementors MUST by default set the entire value the ClientHello.Random and
  14. * ServerHello.Random fields, including gmt_unix_time, to a cryptographically random
  15. * sequence.
  16. */
  17. return false;
  18. }
  19. public virtual void NotifySecureRenegotiation(bool secureRenegotiation)
  20. {
  21. if (!secureRenegotiation)
  22. {
  23. /*
  24. * RFC 5746 3.4/3.6. In this case, some clients/servers may want to terminate the handshake instead
  25. * of continuing; see Section 4.1/4.3 for discussion.
  26. */
  27. throw new TlsFatalAlert(AlertDescription.handshake_failure);
  28. }
  29. }
  30. public abstract TlsCompression GetCompression();
  31. public abstract TlsCipher GetCipher();
  32. public virtual void NotifyAlertRaised(byte alertLevel, byte alertDescription, string message, Exception cause)
  33. {
  34. }
  35. public virtual void NotifyAlertReceived(byte alertLevel, byte alertDescription)
  36. {
  37. }
  38. public virtual void NotifyHandshakeComplete()
  39. {
  40. }
  41. }
  42. }
  43. #endif