123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
- using System;
- using Org.BouncyCastle.Utilities;
- namespace Org.BouncyCastle.Crypto.Tls
- {
- public class SecurityParameters
- {
- internal int entity = -1;
- internal int cipherSuite = -1;
- internal byte compressionAlgorithm = CompressionMethod.cls_null;
- internal int prfAlgorithm = -1;
- internal int verifyDataLength = -1;
- internal byte[] masterSecret = null;
- internal byte[] clientRandom = null;
- internal byte[] serverRandom = null;
- internal byte[] sessionHash = null;
- internal byte[] pskIdentity = null;
- internal byte[] srpIdentity = null;
- // TODO Keep these internal, since it's maybe not the ideal place for them
- internal short maxFragmentLength = -1;
- internal bool truncatedHMac = false;
- internal bool encryptThenMac = false;
- internal bool extendedMasterSecret = false;
- internal virtual void Clear()
- {
- if (this.masterSecret != null)
- {
- Arrays.Fill(this.masterSecret, (byte)0);
- this.masterSecret = null;
- }
- }
- /**
- * @return {@link ConnectionEnd}
- */
- public virtual int Entity
- {
- get { return entity; }
- }
- /**
- * @return {@link CipherSuite}
- */
- public virtual int CipherSuite
- {
- get { return cipherSuite; }
- }
- /**
- * @return {@link CompressionMethod}
- */
- public byte CompressionAlgorithm
- {
- get { return compressionAlgorithm; }
- }
- /**
- * @return {@link PRFAlgorithm}
- */
- public virtual int PrfAlgorithm
- {
- get { return prfAlgorithm; }
- }
- public virtual int VerifyDataLength
- {
- get { return verifyDataLength; }
- }
- public virtual byte[] MasterSecret
- {
- get { return masterSecret; }
- }
- public virtual byte[] ClientRandom
- {
- get { return clientRandom; }
- }
- public virtual byte[] ServerRandom
- {
- get { return serverRandom; }
- }
- public virtual byte[] SessionHash
- {
- get { return sessionHash; }
- }
- public virtual byte[] PskIdentity
- {
- get { return pskIdentity; }
- }
- public virtual byte[] SrpIdentity
- {
- get { return srpIdentity; }
- }
- }
- }
- #endif
|