public TestConnectionContext(byte[] clientPublicKey, byte[] sharedKey, byte[] smartLockNonce, byte[] smartLockPublicKey, Func <byte[]> creatNonce) { ClientPublicKey = new ClientPublicKey(clientPublicKey); SharedKey = new SharedKey(sharedKey); SmartLockNonce = new SmartLockNonce(smartLockNonce); SmartLockPublicKey = new SmartLockPublicKey(smartLockPublicKey); m_delCreateNonce = creatNonce; }
public void SharedKeyLiteSignatureTest() { // Taken directly from the payload emitted by the .NET Storage FX var headers = new List <Tuple <string, string> >() { Tuple.Create("User-Agent", "WA-Storage/4.3.0 (.NET CLR 4.0.30319.34014; Win32NT 6.2.9200.0)"), Tuple.Create("x-ms-version", "2014-02-14"), Tuple.Create("x-ms-client-request-id", "5bdcb4d9-bd21-44a6-a086-24d9fa9ec2b7"), Tuple.Create("x-ms-date", "Thu, 30 Oct 2014 21:32:29 GMT"), Tuple.Create("Connection", "Keep-Alive"), Tuple.Create("Expect", "100-continue"), Tuple.Create("Host", "dashstorage1.blob.core.windows.net"), }; var queryParams = new List <Tuple <string, string> >() { Tuple.Create("restype", "container"), Tuple.Create("comp", "list"), Tuple.Create("prefix", "te"), Tuple.Create("include", "snapshots"), Tuple.Create("INCLUDE", "uncommittedblobs,metadata,copy") }; Assert.AreEqual("+C5fkZr8g80qF5vzPeLCnuaaA2pG8jTZRdmhKkjZt2g=", SharedKey.GenerateSignature(true, true, "GET", "/test", RequestHeaders.Create(headers.ToLookup(header => header.Item1, header => header.Item2)), RequestQueryParameters.Create(queryParams.ToLookup(queryParam => queryParam.Item1, queryParam => queryParam.Item2)), "", ""), "Generated SharedKeyLite signature should match expected one 1"); // Taken directly from the payload emitted by the .NET Storage FX headers = new List <Tuple <string, string> >() { Tuple.Create("User-Agent", "WA-Storage/4.3.0 (.NET CLR 4.0.30319.34014; Win32NT 6.2.9200.0)"), Tuple.Create("x-ms-version", "2014-02-14"), Tuple.Create("Content-Type", "application/octet-stream"), Tuple.Create("Content-MD5", "LHmMkMS8mTXh0bRP4e4Ptw=="), Tuple.Create("Content-Language", "EN-US"), Tuple.Create("Content-Encoding", "gzip"), Tuple.Create("x-ms-blob-type", "BlockBlob"), Tuple.Create("If-Match", "DummyETag"), Tuple.Create("x-ms-client-request-id", "f71ce734-540f-44a6-a68e-7acaa6730daa"), Tuple.Create("x-ms-date", "Thu, 30 Oct 2014 21:53:09 GMT"), Tuple.Create("Content-Length", "423"), Tuple.Create("Connection", "Keep-Alive"), Tuple.Create("Expect", "100-continue"), Tuple.Create("Host", "dashstorage1.blob.core.windows.net"), }; Assert.AreEqual("2D9i7xldeRtls7/qW+lSgwYQEWx6aNbtTKPFhzfR7Dw=", SharedKey.GenerateSignature(false, true, "PUT", "/test/test.txt", RequestHeaders.Create(headers.ToLookup(header => header.Item1, header => header.Item2)), RequestQueryParameters.Empty, "", "423"), "Generated SharedKeyLite signature should match expected one 1"); }
public SharedKeyContext GetVirtualNetworkGatewaySharedKeyProcess() { SharedKeyContext sharedKeyContext; Func <string, SharedKey> func = null; using (OperationContextScope operationContextScope = new OperationContextScope((IContextChannel)base.Channel)) { try { GetAzureVNetGatewayKeyCommand getAzureVNetGatewayKeyCommand = this; if (func == null) { func = (string s) => base.Channel.GetVirtualNetworkSharedKey(s, this.VNetName, this.LocalNetworkSiteName); } SharedKey sharedKey = ((CmdletBase <IGatewayServiceManagement>)getAzureVNetGatewayKeyCommand).RetryCall <SharedKey>(func); Operation operation = base.WaitForGatewayOperation(base.CommandRuntime.ToString()); SharedKeyContext value = new SharedKeyContext(); value.set_OperationId(operation.OperationTrackingId); value.set_OperationDescription(base.CommandRuntime.ToString()); value.set_OperationStatus(operation.Status); value.Value = sharedKey.Value; sharedKeyContext = value; return(sharedKeyContext); } catch (CommunicationException communicationException1) { CommunicationException communicationException = communicationException1; if (communicationException as EndpointNotFoundException == null || base.IsVerbose()) { this.WriteErrorDetails(communicationException); } else { sharedKeyContext = null; return(sharedKeyContext); } } sharedKeyContext = null; } return(sharedKeyContext); }
public override void ExecuteCmdlet() { try { var route = ExpressRouteClient.GetAzureBGPPeering(ServiceKey, AccessType); var updatedRoute = ExpressRouteClient.UpdateAzureBGPPeering(ServiceKey, AccessType, CustomerAsn, PeerAsn.HasValue ? PeerAsn.Value : route.PeerAsn, PrimaryPeerSubnet ?? route.PrimaryPeerSubnet, RoutingRegistryName, SecondaryPeerSubnet ?? route.SecondaryPeerSubnet, VlanId.HasValue ? VlanId.Value : route.VlanId, SharedKey.Trim()); WriteObject(updatedRoute, false); } catch { if (!PeerAsn.HasValue) { throw new ArgumentException(Resources.PeerAsnRequired); } if (!VlanId.HasValue) { throw new ArgumentException(Resources.VlanIdRequired); } if (PrimaryPeerSubnet == null) { throw new ArgumentException(Resources.PrimaryPeerSubnetRequired); } if (SecondaryPeerSubnet == null) { throw new ArgumentException(Resources.SecondaryPeerSubnetRequired); } var newRoute = ExpressRouteClient.NewAzureBGPPeering(ServiceKey, AdvertisedPublicPrefixes, CustomerAsn, PeerAsn.Value, PrimaryPeerSubnet, RoutingRegistryName, SecondaryPeerSubnet, VlanId.Value, AccessType, SharedKey); WriteObject(newRoute); } }
public static async Task <bool> IsRequestAuthorizedAsync(IHttpRequestWrapper request, bool ignoreRequestAge = false) { var headers = request.Headers; var queryParams = request.QueryParameters; // See what type of auth scheme is applied to this request bool sharedKeyRequest = SharedKey.IsRequestType(headers); bool sasRequest = SharedAccessSignature.IsRequestType(queryParams); if (sharedKeyRequest && sasRequest) { // Can't be a SAS & SharedKey Authorization together return(false); } else if (sasRequest) { return(await SharedAccessSignature.IsAuthorizedAsync(request, headers, queryParams, ignoreRequestAge)); } else if (sharedKeyRequest) { return(SharedKey.IsAuthorized(request, headers, queryParams, ignoreRequestAge)); } // Anonymous return(await Anonymous.IsAuthorizedAsync(request)); }
public override void ActivateOptions() { try { configSettings = new ConfigSettings(this.Name); LogMessageToFile = configSettings.ALALogMessageToFile == null ? LogMessageToFile : (bool)configSettings.ALALogMessageToFile; DisableInfoLogFile = configSettings.ALADisableInfoAppenderFile == null ? DisableInfoLogFile : (bool)configSettings.ALADisableInfoAppenderFile; string internalLog4NetConfig = "Log4ALA.internalLog4net.config"; if (DisableInfoLogFile) { internalLog4NetConfig = "Log4ALA.internalLog4netOnlyErr.config"; } #if !NETSTANDARD2_0 && !NETCOREAPP2_0 using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(internalLog4NetConfig)) { XmlConfigurator.Configure(stream); } log = LogManager.GetLogger("Log4ALAInternalLogger"); #else using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(internalLog4NetConfig)) { XmlConfigurator.Configure(LogManager.GetRepository(Assembly.GetEntryAssembly()), stream); } log = LogManager.GetLogger(REPOSITORY.Name, "Log4ALAInternalLogger"); #endif string setErrAppFileNameMessage, setInfoAppFileNameMessage = null; bool isErrFile = SetAppenderFileNameIfAvailable(string.IsNullOrWhiteSpace(configSettings.ALAErrAppenderFile) ? ErrAppenderFile : configSettings.ALAErrAppenderFile, ConfigSettings.LOG_ERR_APPENDER, out setErrAppFileNameMessage); bool isInfoFile = false; if (!DisableInfoLogFile) { isInfoFile = SetAppenderFileNameIfAvailable(string.IsNullOrWhiteSpace(configSettings.ALAInfoAppenderFile) ? InfoAppenderFile : configSettings.ALAInfoAppenderFile, ConfigSettings.LOG_INFO_APPENDER, out setInfoAppFileNameMessage); } if (isErrFile) { log.Inf(setErrAppFileNameMessage, true); } else { System.Console.WriteLine(setErrAppFileNameMessage); log.Err(setErrAppFileNameMessage); extraLog.Err(setErrAppFileNameMessage); } if (isInfoFile) { log.Inf(setInfoAppFileNameMessage, true); } else { if (!DisableInfoLogFile) { System.Console.WriteLine(setInfoAppFileNameMessage); log.Err(setInfoAppFileNameMessage); extraLog.Err(setInfoAppFileNameMessage); } } if (!string.IsNullOrWhiteSpace(configSettings.ALAErrLoggerName)) { #if NETSTANDARD2_0 || NETCOREAPP2_0 extraLog = LogManager.GetLogger(REPOSITORY.Name, configSettings.ALAErrLoggerName); #else extraLog = LogManager.GetLogger(configSettings.ALAErrLoggerName); #endif log.Inf($"[{this.Name}] - errLoggerName:[{configSettings.ALAErrLoggerName}]", true); } else if (!string.IsNullOrWhiteSpace(ErrLoggerName)) { #if NETSTANDARD2_0 || NETCOREAPP2_0 extraLog = LogManager.GetLogger(REPOSITORY.Name, ErrLoggerName); #else extraLog = LogManager.GetLogger(ErrLoggerName); #endif log.Inf($"[{this.Name}] - errLoggerName:[{ErrLoggerName}]", true); } #if NETSTANDARD2_0 || NETCOREAPP2_0 log.Inf($"[{this.Name}] - appsettings directory:[{ConfigSettings.ContentRootPath}]", true); log.Inf($"[{this.Name}] - ASPNETCORE_ENVIRONMENT:[{ConfigSettings.AspNetCoreEnvironment}]", true); log.Inf($"[{this.Name}] - APPSETTINGS_SUFFIX:[{ConfigSettings.AppsettingsSuffix}]", true); if (ConfigSettings.ALAEnableDebugConsoleLog) { System.Console.WriteLine($@"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff")}|Log4ALA|TRACE|[{this.Name}] - appsettings directory:[{ConfigSettings.ContentRootPath}]"); System.Console.WriteLine($@"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff")}|Log4ALA|TRACE|[{this.Name}] - ASPNETCORE_ENVIRONMENT:[{ConfigSettings.AspNetCoreEnvironment}]"); System.Console.WriteLine($@"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffffff")}|Log4ALA|TRACE|[{this.Name}] - APPSETTINGS_SUFFIX:[{ConfigSettings.AppsettingsSuffix}]"); } #endif if (string.IsNullOrWhiteSpace(configSettings.ALAWorkspaceId) && string.IsNullOrWhiteSpace(WorkspaceId)) { throw new Exception($"the Log4ALAAppender property workspaceId [{WorkspaceId}] shouldn't be empty"); } WorkspaceId = string.IsNullOrWhiteSpace(configSettings.ALAWorkspaceId) ? WorkspaceId : configSettings.ALAWorkspaceId; log.Inf($"[{this.Name}] - workspaceId:[{WorkspaceId}]", true); if (string.IsNullOrWhiteSpace(configSettings.ALASharedKey) && string.IsNullOrWhiteSpace(SharedKey)) { throw new Exception($"the Log4ALAAppender property sharedKey [{SharedKey}] shouldn't be empty"); } SharedKey = string.IsNullOrWhiteSpace(configSettings.ALASharedKey) ? SharedKey : configSettings.ALASharedKey; log.Inf($"[{this.Name}] - sharedKey:[{SharedKey.Remove(15)}...]", true); if (string.IsNullOrWhiteSpace(configSettings.ALALogType) && string.IsNullOrWhiteSpace(LogType)) { throw new Exception($"the Log4ALAAppender property logType [{LogType}] shouldn't be empty"); } LogType = string.IsNullOrWhiteSpace(configSettings.ALALogType) ? LogType : configSettings.ALALogType; log.Inf($"[{this.Name}] - logType:[{LogType}]", true); AzureApiVersion = string.IsNullOrWhiteSpace(configSettings.ALAAzureApiVersion) ? AzureApiVersion : configSettings.ALAAzureApiVersion; log.Inf($"[{this.Name}] - azureApiVersion:[{AzureApiVersion}]", true); CoreFieldNames = string.IsNullOrWhiteSpace(configSettings.ALACoreFieldNames) ? CoreFieldNames : configSettings.ALACoreFieldNames; log.Inf($"[{this.Name}] - coreFieldNames:[{CoreFieldNames}]", true); DebugHTTPReqURI = string.IsNullOrWhiteSpace(configSettings.ALADebugHttpReqUri) ? DebugHTTPReqURI : configSettings.ALADebugHttpReqUri; DisableAnonymousPropsPrefix = configSettings.ALADisableAnonymousPropsPrefix == null ? DisableAnonymousPropsPrefix : (bool)configSettings.ALADisableAnonymousPropsPrefix; ThreadPriority = string.IsNullOrWhiteSpace(configSettings.ALAThreadPriority) ? ThreadPriority : configSettings.ALAThreadPriority; ThreadPriority priority; if (!Enum.TryParse(ThreadPriority, out priority)) { throw new Exception($"the Log4ALAAppender wrong threadPriority value [{ThreadPriority}] possible values -> Lowest/BelowNormal/Normal/AboveNormal/Highest"); } log.Inf($"[{this.Name}] - threadPriority:[{ThreadPriority}]", true); HttpDataCollectorRetry = configSettings.ALAHttpDataCollectorRetry == null ? HttpDataCollectorRetry : (int)configSettings.ALAHttpDataCollectorRetry; log.Inf($"[{this.Name}] - httpDataCollectorRetry:[{HttpDataCollectorRetry}]", true); BatchSizeInBytes = configSettings.ALABatchSizeInBytes == null ? BatchSizeInBytes : (int)configSettings.ALABatchSizeInBytes; log.Inf($"[{this.Name}] - batchSizeInBytes:[{BatchSizeInBytes}]", true); BatchNumItems = configSettings.ALABatchNumItems == null ? BatchNumItems : (int)configSettings.ALABatchNumItems; BatchWaitInSec = configSettings.ALABatchWaitInSec == null ? BatchWaitInSec : (int)configSettings.ALABatchWaitInSec; log.Inf($"[{this.Name}] - batchWaitInSec:[{BatchWaitInSec}]", true); LoggingQueueSize = configSettings.ALALoggingQueueSize == null ? LoggingQueueSize : (int)configSettings.ALALoggingQueueSize; log.Inf($"[{this.Name}] - loggingQueueSize:[{LoggingQueueSize}]", true); BatchWaitMaxInSec = configSettings.ALABatchWaitMaxInSec == null ? BatchWaitMaxInSec : (int)configSettings.ALABatchWaitMaxInSec; log.Inf($"[{this.Name}] - batchWaitMaxInSec:[{BatchWaitMaxInSec}]", true); MaxFieldByteLength = configSettings.ALAMaxFieldByteLength == null ? MaxFieldByteLength : (int)configSettings.ALAMaxFieldByteLength; if (MaxFieldByteLength > ConfigSettings.DEFAULT_MAX_FIELD_BYTE_LENGTH) { MaxFieldByteLength = ConfigSettings.DEFAULT_MAX_FIELD_BYTE_LENGTH; } log.Inf($"[{this.Name}] - maxFieldByteLength:[{MaxFieldByteLength}]", true); MaxFieldNameLength = configSettings.ALAMaxFieldNameLength == null ? MaxFieldNameLength : (int)configSettings.ALAMaxFieldNameLength; if (MaxFieldNameLength > ConfigSettings.DEFAULT_MAX_FIELD_NAME_LENGTH) { MaxFieldNameLength = ConfigSettings.DEFAULT_MAX_FIELD_NAME_LENGTH; } log.Inf($"[{this.Name}] - maxFieldNameLength:[{MaxFieldNameLength}]", true); if (BatchSizeInBytes > 0 || BatchWaitInSec > 0) { BatchNumItems = 0; } QueueReadTimeout = configSettings.ALAQueueReadTimeout == null ? QueueReadTimeout : configSettings.ALAQueueReadTimeout; log.Inf($"[{this.Name}] - queueReadTimeout:[{QueueReadTimeout}]", true); log.Inf($"[{this.Name}] - batchNumItems:[{BatchNumItems}]", true); AppendLogger = configSettings.ALAAppendLogger == null ? AppendLogger : (bool)configSettings.ALAAppendLogger; log.Inf($"[{this.Name}] - appendLogger:[{AppendLogger}]", true); AppendLogLevel = configSettings.ALAAppendLogLevel == null ? AppendLogLevel : (bool)configSettings.ALAAppendLogLevel; log.Inf($"[{this.Name}] - appendLogLevel:[{AppendLogLevel}]", true); KeyValueDetection = configSettings.ALAKeyValueDetection == null ? KeyValueDetection : (bool)configSettings.ALAKeyValueDetection; log.Inf($"[{this.Name}] - keyValueDetection:[{KeyValueDetection}]", true); JsonDetection = configSettings.ALAJsonDetection == null ? JsonDetection : (bool)configSettings.ALAJsonDetection; log.Inf($"[{this.Name}] - jsonDetecton:[{JsonDetection}]", true); log.Inf($"[{this.Name}] - abortTimeoutSeconds:[{ConfigSettings.AbortTimeoutSeconds}]", true); log.Inf($"[{this.Name}] - logMessageToFile:[{LogMessageToFile}]", true); KeyValueSeparator = string.IsNullOrWhiteSpace(configSettings.ALAKeyValueSeparator) ? KeyValueSeparator : configSettings.ALAKeyValueSeparator; log.Inf($"[{this.Name}] - keyValueSeparator:[{KeyValueSeparator}]", true); if (KeyValueSeparator.Length > 1 && KeyValueSeparators == null) { KeyValueSeparators = new string[] { KeyValueSeparator }; } KeyValuePairSeparator = string.IsNullOrWhiteSpace(configSettings.ALAKeyValuePairSeparator) ? KeyValuePairSeparator : configSettings.ALAKeyValuePairSeparator; log.Inf($"[{this.Name}] - keyValuePairSeparator:[{KeyValuePairSeparator}]", true); if (KeyValuePairSeparator.Length > 1 && KeyValuePairSeparators == null) { KeyValuePairSeparators = new string[] { KeyValuePairSeparator }; } string configDisableInfoLogFile = configSettings.ALADisableInfoAppenderFileCommon ? "CommonConfiguration" : this.Name; log.Inf($"[{configDisableInfoLogFile}] - disableInfoLogFile:[{DisableInfoLogFile}]", true); string configDisableAnonymousPropsPrefix = configSettings.ALADisableAnonymousPropsPrefixCommon ? "CommonConfiguration" : this.Name; log.Inf($"[{configDisableAnonymousPropsPrefix}] - disableAnonymousPropsPrefix:[{DisableAnonymousPropsPrefix}]", true); if (!string.IsNullOrWhiteSpace(DebugHTTPReqURI)) { string configDebugHTTPReqURI = configSettings.ALADebugHttpReqUriCommon ? "CommonConfiguration" : this.Name; log.Inf($"[{configDebugHTTPReqURI}] - debugHTTPReqURI:[{DebugHTTPReqURI}]", true); } log.Inf($"[CommonConfiguration] - alaQueueSizeLogIntervalEnabled:[{ConfigSettings.IsLogQueueSizeInterval}]", true); log.Inf($"[CommonConfiguration] - alaQueueSizeLogIntervalInSec:[{ConfigSettings.LogQueueSizeInterval}]", true); log.Inf($"[CommonConfiguration] - enableDebugConsoleLog:[{ConfigSettings.ALAEnableDebugConsoleLog}]", true); serializer = new LoggingEventSerializer(this); queueLogger = new QueueLogger(this); } catch (Exception ex) { queueLogger = null; string message = $"[{this.Name}] - Unable to activate Log4ALAAppender: [{ex.Message}]"; System.Console.WriteLine(message); log.Err(message); extraLog.Err(message); } }
public void InitializeAssumptions() { #region A bel A <Kab> B var f1 = new Believe { Agent1 = AgentList["A"], Formula = new SharedKey() }; ((SharedKey)f1.Formula).Agent1 = f1.Agent1; ((SharedKey)f1.Formula).Agent2 = AgentList["B"]; ((SharedKey)f1.Formula).Key = "Kab"; InitialAssumptions.Add(f1); #endregion #region B bel A<Kab> B var f2 = new Believe { Agent1 = AgentList["B"], Formula = new SharedKey() }; ((SharedKey)f2.Formula).Agent1 = AgentList["A"]; ((SharedKey)f2.Formula).Agent2 = AgentList["B"]; ((SharedKey)f2.Formula).Key = "Kab"; InitialAssumptions.Add(f2); #endregion #region B bel A <Kab'> B var f3 = new Believe { Agent1 = AgentList["B"], Formula = new SharedKey() }; ((SharedKey)f3.Formula).Agent1 = AgentList["A"]; ((SharedKey)f3.Formula).Agent2 = AgentList["B"]; ((SharedKey)f3.Formula).Key = "Kab'"; InitialAssumptions.Add(f3); #endregion #region A bel B controls A<K>B var f4 = new Believe { Agent1 = AgentList["A"] }; var f5 = new Controls { Agent1 = AgentList["B"] }; var f6 = new SharedKey(); f4.Formula = f5; f5.Formula = f6; f6.Agent1 = AgentList["A"]; f6.Agent2 = AgentList["B"]; f6.Key = "K"; InitialAssumptions.Add(f4); #endregion #region A bel fresh(Na) var f10 = new Believe { Agent1 = AgentList["A"] }; var f11 = new Fresh { Message = "Na" }; f10.Formula = f11; InitialAssumptions.Add(f10); #endregion #region B bel fresh(Nb) var f12 = new Believe { Agent1 = AgentList["B"] }; var f13 = new Fresh { Message = "Nb" }; f12.Formula = f13; InitialAssumptions.Add(f12); #endregion #region B bel fresh(Nb') var f14 = new Believe { Agent1 = AgentList["B"] }; var f15 = new Fresh { Message = "Nb'" }; f14.Formula = f15; InitialAssumptions.Add(f14); #endregion }
public void InitializeProtocolSteps() { #region Step 1: B sees {Na}Kab var step1EncryptionRule = new Encryption { Key = "Kab", Message = "Na" }; var step1 = new Receives { Agent1 = AgentList["B"], Formula = step1EncryptionRule }; ProtocolSteps.Add(step1); #endregion // pas2 #region Step 2: A sees {Na,Nb}Kab var step2Concatenate = new Concatenate(); var param1 = new BaseLogic { Message = "Na" }; var param2 = new BaseLogic { Message = "Nb" }; step2Concatenate.Formulas.Add(param1); step2Concatenate.Formulas.Add(param2); var step2Encryption = new Encryption { Key = "Kab", Formula = step2Concatenate }; var step2 = new Receives { Agent1 = AgentList["A"], Formula = step2Encryption }; ProtocolSteps.Add(step2); #endregion // pas3 (KERBEROS) #region Step 3: B sees {Nb} Kab var step3EncryptionRule = new Encryption { Key = "Kab", Message = "Nb" }; var step3 = new Receives { Agent1 = AgentList["B"], Formula = step3EncryptionRule }; ProtocolSteps.Add(step3); #endregion // pas2 #region Step 4: A sees { A<Kab'>B, Nb'}Kab var f22 = new Encryption { Key = "Kab", Formula = new Concatenate() }; var step4C1 = new SharedKey { Agent1 = AgentList["A"], Agent2 = AgentList["B"], Key = "Kab'" }; ((Concatenate)f22.Formula).Formulas.Add(step4C1); var step4C2 = new BaseLogic { Message = "Nb'" }; ((Concatenate)f22.Formula).Formulas.Add(step4C2); var step4 = new Receives { Agent1 = AgentList["A"], Formula = f22 }; ProtocolSteps.Add(step4); #endregion // pas4 }
public void SharedKeySignatureTest() { // Taken directly from the payload emitted by the .NET Storage FX var headers = new List <Tuple <string, string> >() { Tuple.Create("User-Agent", "WA-Storage/4.3.0 (.NET CLR 4.0.30319.34014; Win32NT 6.2.9200.0)"), Tuple.Create("Content-Length", "423"), Tuple.Create("Content-MD5", "LHmMkMS8mTXh0bRP4e4Ptw=="), Tuple.Create("Content-MD5", "LHmMkMS8mTXh0bRP4e4Ptw=="), Tuple.Create("x-ms-blob-type", "BlockBlob"), Tuple.Create("x-ms-client-request-id", "82370d95-e820-4817-bd3f-6c266544ee8b"), Tuple.Create("x-ms-date", "Thu, 30 Oct 2014 17:31:22 GMT"), Tuple.Create("x-ms-version", "2014-02-14"), Tuple.Create("Connection", "Keep-Alive"), Tuple.Create("Expect", "100-continue"), Tuple.Create("Host", "dashstorage1.blob.core.windows.net"), }; Assert.AreEqual("mDTyDIDy8yt7D81qAmYEYiXH1X/bmBHJF2+ZPn/r74k=", SharedKey.GenerateSignature(true, false, "PUT", "/test/test.txt", RequestHeaders.Create(headers.ToLookup(header => header.Item1, header => header.Item2)), RequestQueryParameters.Empty, "", "423"), "Generated SharedKey signature should match expected one 1"); // Taken directly from the payload emitted by the .NET Storage FX headers = new List <Tuple <string, string> >() { Tuple.Create("User-Agent", "WA-Storage/4.3.0 (.NET CLR 4.0.30319.34014; Win32NT 6.2.9200.0)"), Tuple.Create("Content-Length", "423"), Tuple.Create("Content-MD5", "LHmMkMS8mTXh0bRP4e4Ptw=="), Tuple.Create("x-ms-blob-type", "BlockBlob"), Tuple.Create("x-ms-client-request-id", "TestRequest1"), Tuple.Create("x-ms-date", "Thu, 30 Oct 2014 19:48:43 GMT"), Tuple.Create("x-ms-version", "2014-02-14"), Tuple.Create("x-ms-test", "testvalue"), Tuple.Create("x-test", "differentvalue"), Tuple.Create("Connection", "Keep-Alive"), Tuple.Create("Expect", "100-continue"), Tuple.Create("Host", "dashstorage1.blob.core.windows.net"), }; Assert.AreEqual("9q8Xz2jAkDaNpLeDoOUAo5hfZ3nbg696xt5F17wcX7Y=", SharedKey.GenerateSignature(false, false, "PUT", "/test/test.txt", RequestHeaders.Create(headers.ToLookup(header => header.Item1, header => header.Item2)), RequestQueryParameters.Empty, "", "423"), "Generated SharedKey signature should match expected one 2"); // Taken directly from the payload emitted by the .NET Storage FX headers = new List <Tuple <string, string> >() { Tuple.Create("User-Agent", "WA-Storage/4.3.0 (.NET CLR 4.0.30319.34014; Win32NT 6.2.9200.0)"), Tuple.Create("Content-Length", "423"), Tuple.Create("Content-MD5", "LHmMkMS8mTXh0bRP4e4Ptw=="), Tuple.Create("x-ms-version", "2014-02-14"), Tuple.Create("x-ms-blob-type", "BlockBlob"), Tuple.Create("x-ms-client-request-id", "d0863cd4-ae43-4dd4-aa27-eff01d30b5cf"), Tuple.Create("x-ms-date", "Thu, 30 Oct 2014 20:15:46 GMT"), Tuple.Create("If-Modified-Since", "Thu, 30 Oct 2014 20:15:41 GMT"), Tuple.Create("Connection", "Keep-Alive"), Tuple.Create("Expect", "100-continue"), Tuple.Create("Host", "dashstorage1.blob.core.windows.net"), }; Assert.AreEqual("21rAYhnoRQQu6MmxXj6W5Rx3YWI8OCjO50CNNniohAA=", SharedKey.GenerateSignature(true, false, "PUT", "/test/test.txt", RequestHeaders.Create(headers.ToLookup(header => header.Item1, header => header.Item2)), RequestQueryParameters.Empty, "", "423"), "Generated SharedKey signature should match expected one 3"); // Taken directly from the payload emitted by the .NET Storage FX headers = new List <Tuple <string, string> >() { Tuple.Create("User-Agent", "WA-Storage/4.3.0 (.NET CLR 4.0.30319.34014; Win32NT 6.2.9200.0)"), Tuple.Create("x-ms-version", "2014-02-14"), Tuple.Create("Content-Type", "application/octet-stream"), Tuple.Create("Content-MD5", "LHmMkMS8mTXh0bRP4e4Ptw=="), Tuple.Create("Content-Language", "EN-US"), Tuple.Create("Content-Encoding", "gzip"), Tuple.Create("x-ms-blob-type", "BlockBlob"), Tuple.Create("If-Match", "DummyETag"), Tuple.Create("x-ms-client-request-id", "93399f8e-6ce2-4020-81a4-4f1f53f427fd"), Tuple.Create("x-ms-date", "Thu, 30 Oct 2014 20:46:48 GMT"), Tuple.Create("Connection", "Keep-Alive"), Tuple.Create("Content-Length", "423"), Tuple.Create("Expect", "100-continue"), Tuple.Create("Host", "dashstorage1.blob.core.windows.net"), }; Assert.AreEqual("LzmxJ091fSbkczQfZErnqG0QEbsYQ+/mKx4gyBIjmFA=", SharedKey.GenerateSignature(false, false, "PUT", "/test/test.txt", RequestHeaders.Create(headers.ToLookup(header => header.Item1, header => header.Item2)), RequestQueryParameters.Empty, "", "423"), "Generated SharedKey signature should match expected one 4"); // Taken directly from the payload emitted by the .NET Storage FX headers = new List <Tuple <string, string> >() { Tuple.Create("User-Agent", "WA-Storage/4.3.0 (.NET CLR 4.0.30319.34014; Win32NT 6.2.9200.0)"), Tuple.Create("x-ms-version", "2014-02-14"), Tuple.Create("x-ms-client-request-id", "9e51b5a3-2dff-4fb2-98f8-c7cfe05a223a"), Tuple.Create("x-ms-date", "Thu, 30 Oct 2014 20:55:13 GMT"), Tuple.Create("Content-Length", "0"), Tuple.Create("Connection", "Keep-Alive"), Tuple.Create("Expect", "100-continue"), Tuple.Create("Host", "dashstorage1.blob.core.windows.net"), }; var queryParams = new List <Tuple <string, string> >() { Tuple.Create("restype", "container"), Tuple.Create("comp", "list"), Tuple.Create("prefix", "te"), Tuple.Create("include", "snapshots"), Tuple.Create("INCLUDE", "uncommittedblobs,metadata,copy"), }; Assert.AreEqual("C0mPsPAiMs+4qlDQXGXMXpRGUkQgyMLzOHBiCmoC4LE=", SharedKey.GenerateSignature(true, false, "GET", "/test", RequestHeaders.Create(headers.ToLookup(header => header.Item1, header => header.Item2)), RequestQueryParameters.Create(queryParams.ToLookup(queryParam => queryParam.Item1, queryParam => queryParam.Item2)), "", ""), "Generated SharedKey signature should match expected one 5"); headers = new List <Tuple <string, string> >() { Tuple.Create("User-Agent", "WA-Storage/4.3.0 (.NET CLR 4.0.30319.34014; Win32NT 6.2.9200.0)"), Tuple.Create("x-ms-version", "2014-02-14"), Tuple.Create("x-ms-client-request-id", "9e51b5a3-2dff-4fb2-98f8-c7cfe05a223a"), Tuple.Create("x-ms-date", "Thu, 30 Oct 2014 20:55:13 GMT"), Tuple.Create("Content-Length", "0"), Tuple.Create("Connection", "Keep-Alive"), Tuple.Create("Expect", "100-continue"), Tuple.Create("Host", "dashstorage1.blob.core.windows.net"), }; Assert.AreEqual("9ADGhBpIykIHJ+egWUVSP0LyzFF6aV9hPrT+6++IOPA=", SharedKey.GenerateSignature(true, false, "PUT", "/test/TEST%20Encoded", RequestHeaders.Create(headers.ToLookup(header => header.Item1, header => header.Item2)), RequestQueryParameters.Empty, "", "0"), "Generated SharedKey signature should match expected one 6"); }
public void InitializeAssumptions() { #region A bel A <Kas>S var f1 = new Believe { Agent1 = AgentList["A"], Formula = new SharedKey() }; ((SharedKey)f1.Formula).Agent1 = f1.Agent1; ((SharedKey)f1.Formula).Agent2 = AgentList["S"]; ((SharedKey)f1.Formula).Key = "Kas"; InitialAssumptions.Add(f1); #endregion #region S bel A<Kas>S var f2 = new Believe { Agent1 = AgentList["S"], Formula = new SharedKey() }; ((SharedKey)f2.Formula).Agent1 = AgentList["A"]; ((SharedKey)f2.Formula).Agent2 = AgentList["S"]; ((SharedKey)f2.Formula).Key = "Kas"; InitialAssumptions.Add(f2); #endregion #region S bel A<Kab>S var f3 = new Believe { Agent1 = AgentList["S"], Formula = new SharedKey() }; ((SharedKey)f3.Formula).Agent1 = AgentList["A"]; ((SharedKey)f3.Formula).Agent2 = AgentList["S"]; ((SharedKey)f3.Formula).Key = "Kab"; InitialAssumptions.Add(f3); #endregion #region A bel S controls A<K>B var f4 = new Believe { Agent1 = AgentList["A"] }; var f5 = new Controls { Agent1 = AgentList["S"] }; var f6 = new SharedKey(); f4.Formula = f5; f5.Formula = f6; f6.Agent1 = AgentList["A"]; f6.Agent2 = AgentList["B"]; f6.Key = "K"; InitialAssumptions.Add(f4); #endregion #region B bel S controls A<K>B var f7 = new Believe { Agent1 = AgentList["B"] }; var f8 = new Controls { Agent1 = AgentList["S"] }; var f9 = new SharedKey(); f7.Formula = f8; f8.Formula = f9; f9.Agent1 = AgentList["A"]; f9.Agent2 = AgentList["B"]; f9.Key = "K"; InitialAssumptions.Add(f7); #endregion #region A bel fresh(TS) var f10 = new Believe { Agent1 = AgentList["A"] }; var f11 = new Fresh { Message = "TS" }; f10.Formula = f11; InitialAssumptions.Add(f10); #endregion #region B bel fresh(TS) var f12 = new Believe { Agent1 = AgentList["B"] }; var f13 = new Fresh { Message = "TS" }; f12.Formula = f13; InitialAssumptions.Add(f12); #endregion #region B bel fresh(TA) var f14 = new Believe { Agent1 = AgentList["B"] }; var f15 = new Fresh { Message = "TA" }; f14.Formula = f15; InitialAssumptions.Add(f14); #endregion #region A bel fresh(TA) var f16 = new Believe { Agent1 = AgentList["A"] }; var f17 = new Fresh { Message = "TA" }; f16.Formula = f17; InitialAssumptions.Add(f16); #endregion #region B bel B <Kbs>S var f18 = new Believe { Agent1 = AgentList["B"], Formula = new SharedKey() }; ((SharedKey)f18.Formula).Agent1 = f18.Agent1; ((SharedKey)f18.Formula).Agent2 = AgentList["S"]; ((SharedKey)f18.Formula).Key = "Kbs"; InitialAssumptions.Add(f18); #endregion #region S bel B <Kbs>S var f19 = new Believe { Agent1 = AgentList["S"], Formula = new SharedKey() }; ((SharedKey)f19.Formula).Agent1 = AgentList["B"]; ((SharedKey)f19.Formula).Agent2 = AgentList["S"]; ((SharedKey)f19.Formula).Key = "Kbs"; InitialAssumptions.Add(f19); #endregion }
public void InitializeProtocolSteps() { #region Step 2: A sees {Ts, A<Kab>B,{Ts,A<Kab>B}Kbs}Kas var step1EncryptionRule = new Encryption { Key = "Kas", Formula = new Concatenate() }; var step1BaseLogicTs = new BaseLogic { Message = "TS" }; ((Concatenate)step1EncryptionRule.Formula).Formulas.Add(step1BaseLogicTs); var step1SharedKey = new SharedKey { Agent1 = AgentList["A"], Agent2 = AgentList["B"], Key = "Kab" }; ((Concatenate)step1EncryptionRule.Formula).Formulas.Add(step1SharedKey); var p3 = new Encryption { Key = "Kbs", Formula = new Concatenate() }; ((Concatenate)p3.Formula).Formulas.Add(step1BaseLogicTs); ((Concatenate)p3.Formula).Formulas.Add(step1SharedKey); ((Concatenate)step1EncryptionRule.Formula).Formulas.Add(p3); var step1 = new Receives { Agent1 = AgentList["A"], Formula = step1EncryptionRule }; ProtocolSteps.Add(step1); #endregion // pas2 (KERBEROS) #region Step 3: B sees {{Ts, A<Kab>B}Kbs,{Ta,A<Kab>B}Kab}} var f21 = new Concatenate(); var param1 = new Encryption { Key = "Kbs", Formula = new Concatenate() }; var m1 = new BaseLogic { Message = "TS" }; ((Concatenate)param1.Formula).Formulas.Add(m1); var m2 = new SharedKey { Agent1 = AgentList["A"], Agent2 = AgentList["B"], Key = "Kab" }; ((Concatenate)param1.Formula).Formulas.Add(m2); ((Concatenate)f21).Formulas.Add(param1); var param2 = new Encryption { Key = "Kab", Formula = new Concatenate() }; var msg1 = new BaseLogic { Message = "Ta" }; ((Concatenate)param2.Formula).Formulas.Add(msg1); var msg2 = new SharedKey { Agent1 = AgentList["A"], Agent2 = AgentList["B"], Key = "Kab" }; ((Concatenate)param2.Formula).Formulas.Add(msg2); ((Concatenate)f21).Formulas.Add(param2); var step2 = new Receives { Agent1 = AgentList["B"], Formula = f21 }; ProtocolSteps.Add(step2); #endregion // pas3 (KERBEROS) #region Step 4: A sees {Ta, A<Kab>B}Kab var f22 = new Encryption { Key = "Kab", Formula = new Concatenate() }; var v1 = new BaseLogic { Message = "Ta" }; ((Concatenate)f22.Formula).Formulas.Add(v1); var v2 = new SharedKey { Agent1 = AgentList["A"], Agent2 = AgentList["B"], Key = "Kab" }; ((Concatenate)f22.Formula).Formulas.Add(v2); var step3 = new Receives { Agent1 = AgentList["A"], Formula = f22 }; ProtocolSteps.Add(step3); #endregion // pas4 (KERBEROS) }
public override void ExecuteCmdlet() { try { var route = ExpressRouteClient.GetAzureBGPPeering(ServiceKey, AccessType); var advertisedPublicPrefixes = AdvertisedPublicPrefixes ?? ((PeerAddressType == PeerAddressTypeValues.IPv4) ? route.AdvertisedPublicPrefixes : route.AdvertisedPublicPrefixesIpv6); var routingRegistryName = RoutingRegistryName ?? ((PeerAddressType == PeerAddressTypeValues.IPv4) ? route.RoutingRegistryName : route.RoutingRegistryNameIpv6); var customerAsn = (CustomerAsn.HasValue) ? CustomerAsn.Value : ((PeerAddressType == PeerAddressTypeValues.IPv4) ? route.CustomerAutonomousSystemNumber : route.CustomerAutonomousSystemNumberIpv6); var updatedRoute = ExpressRouteClient.UpdateAzureBGPPeering(ServiceKey, PeerAddressType, AccessType, advertisedPublicPrefixes, customerAsn, PeerAsn.HasValue ? PeerAsn.Value : route.PeerAsn, PrimaryPeerSubnet, routingRegistryName, SecondaryPeerSubnet, VlanId.HasValue ? VlanId.Value : route.VlanId, string.IsNullOrWhiteSpace(SharedKey) ? null : SharedKey.Trim()); WriteObject(updatedRoute, false); } catch { if (!PeerAsn.HasValue) { throw new ArgumentException(Resources.PeerAsnRequired); } if (!VlanId.HasValue) { throw new ArgumentException(Resources.VlanIdRequired); } if (PrimaryPeerSubnet == null) { throw new ArgumentException(Resources.PrimaryPeerSubnetRequired); } if (SecondaryPeerSubnet == null) { throw new ArgumentException(Resources.SecondaryPeerSubnetRequired); } var newRoute = ExpressRouteClient.NewAzureBGPPeering(ServiceKey, PeerAddressType, AdvertisedPublicPrefixes, CustomerAsn.Value, PeerAsn.Value, PrimaryPeerSubnet, RoutingRegistryName, SecondaryPeerSubnet, VlanId.Value, AccessType, SharedKey); WriteObject(newRoute); } }
public void InitializeAssumptions() { #region A bel A <Kas>S var i1 = new Believe { Agent1 = AgentList["A"], Formula = new SharedKey() }; ((SharedKey)i1.Formula).Agent1 = AgentList["A"]; ((SharedKey)i1.Formula).Agent2 = AgentList["S"]; ((SharedKey)i1.Formula).Key = "Kas"; InitialAssumptions.Add(i1); #endregion #region B bel B <Kbs>S var i2 = new Believe { Agent1 = AgentList["B"], Formula = new SharedKey() }; ((SharedKey)i2.Formula).Agent1 = AgentList["B"]; ((SharedKey)i2.Formula).Agent2 = AgentList["S"]; ((SharedKey)i2.Formula).Key = "Kbs"; InitialAssumptions.Add(i2); #endregion #region A bel S controls A<K>B var i3 = new Believe { Agent1 = AgentList["A"] }; var i4 = new Controls { Agent1 = AgentList["S"] }; var i5 = new SharedKey(); i3.Formula = i4; i4.Formula = i5; i5.Agent1 = AgentList["A"]; i5.Agent2 = AgentList["B"]; i5.Key = "K"; InitialAssumptions.Add(i3); #endregion #region B bel S controls A<K>B var i6 = new Believe { Agent1 = AgentList["B"] }; var i7 = new Controls { Agent1 = AgentList["S"] }; var i10 = new SharedKey(); i6.Formula = i7; i7.Formula = i10; i10.Agent1 = AgentList["A"]; i10.Agent2 = AgentList["B"]; i10.Key = "K"; InitialAssumptions.Add(i6); #endregion #region A bel fresh(Na) var i11 = new Believe { Agent1 = AgentList["A"], Formula = new Fresh() }; ((Fresh)i11.Formula).Message = "Na"; InitialAssumptions.Add(i11); #endregion #region B bel fresh(Nb) var i12 = new Believe { Agent1 = AgentList["B"], Formula = new Fresh() }; ((Fresh)i12.Formula).Message = "Nb"; InitialAssumptions.Add(i12); #endregion #region A bel S controls fresh(A,K>B) var i13 = new Believe { Agent1 = AgentList["A"] }; var i14 = new Controls { Agent1 = AgentList["S"] }; var i15 = new Fresh(); i13.Formula = i14; i14.Formula = i15; i15.Formula = new SharedKey(); ((SharedKey)i15.Formula).Key = "K"; ((SharedKey)i15.Formula).Agent1 = AgentList["A"]; ((SharedKey)i15.Formula).Agent1 = AgentList["B"]; InitialAssumptions.Add(i13); #endregion }
public void InitializeProtocolSteps() { #region Step 1: A receives {Na, a<Kab>B, fresh(Kab), {A<Kab>B}Kbs}Kas var step1Sees = new Receives { Agent1 = AgentList["A"] }; var encryptionFormula = new Encryption { Key = "Kas" }; step1Sees.Formula = encryptionFormula; var concatenateFormula = new Concatenate(); encryptionFormula.Formula = concatenateFormula; var baseLogicFormula = new BaseLogic { Message = "Na" }; concatenateFormula.Formulas.Add(baseLogicFormula); var sharedKeyFormula = new SharedKey { Key = "Kab", Agent1 = AgentList["A"], Agent2 = AgentList["B"] }; concatenateFormula.Formulas.Add(sharedKeyFormula); var freshFormula = new Fresh { Message = "Kab" }; concatenateFormula.Formulas.Add(freshFormula); var encryptionFormula2 = new Encryption { Key = "Kbs" }; var sharedKeyFormula2 = new SharedKey() { Key = "Kab", Agent1 = AgentList["A"], Agent2 = AgentList["B"] }; encryptionFormula2.Formula = sharedKeyFormula2; concatenateFormula.Formulas.Add(encryptionFormula2); ProtocolSteps.Add(step1Sees); #endregion // pas1 NSSK #region Step 2: B receives {A<Kab>B}Kbs var step2Sees = new Receives { Agent1 = AgentList["B"], Formula = new Encryption() }; ((Encryption)step2Sees.Formula).Formula = new SharedKey(); ((Encryption)step2Sees.Formula).Key = "Kbs"; ((SharedKey)((Encryption)step2Sees.Formula).Formula).Agent1 = AgentList["A"]; ((SharedKey)((Encryption)step2Sees.Formula).Formula).Agent2 = AgentList["B"]; ((SharedKey)((Encryption)step2Sees.Formula).Formula).Key = "Kab"; ProtocolSteps.Add(step2Sees); #endregion // pas2 NSSK #region Step 3: A receives {Nb,A<Kab>B}Kab var step3Sees = new Receives { Agent1 = AgentList["A"], Formula = new Encryption() }; ((Encryption)step3Sees.Formula).Key = "Kab"; ((Encryption)step3Sees.Formula).Formula = new Concatenate(); var par1 = new BaseLogic { Message = "Nb" }; ((Concatenate)((Encryption)step3Sees.Formula).Formula).Formulas.Add(par1); var par2 = new SharedKey { Key = "Kab", Agent1 = AgentList["A"], Agent2 = AgentList["B"] }; ((Concatenate)((Encryption)step3Sees.Formula).Formula).Formulas.Add(par2); ProtocolSteps.Add(step3Sees); //pas3 NSSK #endregion #region Step 4: B receives {Nb,A<Kab>B}Kab var step4Sees = new Receives() { Agent1 = AgentList["B"], Formula = new Encryption() }; ((Encryption)step4Sees.Formula).Key = "Kab"; ((Encryption)step4Sees.Formula).Formula = new Concatenate(); var param1 = new BaseLogic { Message = "Nb" }; ((Concatenate)((Encryption)step4Sees.Formula).Formula).Formulas.Add(param1); var param2 = new SharedKey { Key = "KB", Agent1 = AgentList["A"], Agent2 = AgentList["B"] }; ((Concatenate)((Encryption)step4Sees.Formula).Formula).Formulas.Add(param2); ProtocolSteps.Add(step4Sees); //pas4 NSSK #endregion }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (ConnectorPingTimeout != null) { hashCode = hashCode * 59 + ConnectorPingTimeout.GetHashCode(); } if (ConnectorPingInterval != null) { hashCode = hashCode * 59 + ConnectorPingInterval.GetHashCode(); } if (DiscoveryLiteCheckInterval != null) { hashCode = hashCode * 59 + DiscoveryLiteCheckInterval.GetHashCode(); } if (ClusterSyncServiceTimeout != null) { hashCode = hashCode * 59 + ClusterSyncServiceTimeout.GetHashCode(); } if (ClusterSyncServiceInterval != null) { hashCode = hashCode * 59 + ClusterSyncServiceInterval.GetHashCode(); } if (EnableSyncToken != null) { hashCode = hashCode * 59 + EnableSyncToken.GetHashCode(); } if (MinEventDelay != null) { hashCode = hashCode * 59 + MinEventDelay.GetHashCode(); } if (SocketConnectTimeout != null) { hashCode = hashCode * 59 + SocketConnectTimeout.GetHashCode(); } if (SoTimeout != null) { hashCode = hashCode * 59 + SoTimeout.GetHashCode(); } if (TopologyConnectorUrls != null) { hashCode = hashCode * 59 + TopologyConnectorUrls.GetHashCode(); } if (TopologyConnectorWhitelist != null) { hashCode = hashCode * 59 + TopologyConnectorWhitelist.GetHashCode(); } if (AutoStopLocalLoopEnabled != null) { hashCode = hashCode * 59 + AutoStopLocalLoopEnabled.GetHashCode(); } if (GzipConnectorRequestsEnabled != null) { hashCode = hashCode * 59 + GzipConnectorRequestsEnabled.GetHashCode(); } if (HmacEnabled != null) { hashCode = hashCode * 59 + HmacEnabled.GetHashCode(); } if (EnableEncryption != null) { hashCode = hashCode * 59 + EnableEncryption.GetHashCode(); } if (SharedKey != null) { hashCode = hashCode * 59 + SharedKey.GetHashCode(); } if (HmacSharedKeyTTL != null) { hashCode = hashCode * 59 + HmacSharedKeyTTL.GetHashCode(); } if (BackoffStandbyFactor != null) { hashCode = hashCode * 59 + BackoffStandbyFactor.GetHashCode(); } if (BackoffStableFactor != null) { hashCode = hashCode * 59 + BackoffStableFactor.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if OrgApacheSlingDiscoveryOakConfigProperties instances are equal /// </summary> /// <param name="other">Instance of OrgApacheSlingDiscoveryOakConfigProperties to be compared</param> /// <returns>Boolean</returns> public bool Equals(OrgApacheSlingDiscoveryOakConfigProperties other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( ConnectorPingTimeout == other.ConnectorPingTimeout || ConnectorPingTimeout != null && ConnectorPingTimeout.Equals(other.ConnectorPingTimeout) ) && ( ConnectorPingInterval == other.ConnectorPingInterval || ConnectorPingInterval != null && ConnectorPingInterval.Equals(other.ConnectorPingInterval) ) && ( DiscoveryLiteCheckInterval == other.DiscoveryLiteCheckInterval || DiscoveryLiteCheckInterval != null && DiscoveryLiteCheckInterval.Equals(other.DiscoveryLiteCheckInterval) ) && ( ClusterSyncServiceTimeout == other.ClusterSyncServiceTimeout || ClusterSyncServiceTimeout != null && ClusterSyncServiceTimeout.Equals(other.ClusterSyncServiceTimeout) ) && ( ClusterSyncServiceInterval == other.ClusterSyncServiceInterval || ClusterSyncServiceInterval != null && ClusterSyncServiceInterval.Equals(other.ClusterSyncServiceInterval) ) && ( EnableSyncToken == other.EnableSyncToken || EnableSyncToken != null && EnableSyncToken.Equals(other.EnableSyncToken) ) && ( MinEventDelay == other.MinEventDelay || MinEventDelay != null && MinEventDelay.Equals(other.MinEventDelay) ) && ( SocketConnectTimeout == other.SocketConnectTimeout || SocketConnectTimeout != null && SocketConnectTimeout.Equals(other.SocketConnectTimeout) ) && ( SoTimeout == other.SoTimeout || SoTimeout != null && SoTimeout.Equals(other.SoTimeout) ) && ( TopologyConnectorUrls == other.TopologyConnectorUrls || TopologyConnectorUrls != null && TopologyConnectorUrls.Equals(other.TopologyConnectorUrls) ) && ( TopologyConnectorWhitelist == other.TopologyConnectorWhitelist || TopologyConnectorWhitelist != null && TopologyConnectorWhitelist.Equals(other.TopologyConnectorWhitelist) ) && ( AutoStopLocalLoopEnabled == other.AutoStopLocalLoopEnabled || AutoStopLocalLoopEnabled != null && AutoStopLocalLoopEnabled.Equals(other.AutoStopLocalLoopEnabled) ) && ( GzipConnectorRequestsEnabled == other.GzipConnectorRequestsEnabled || GzipConnectorRequestsEnabled != null && GzipConnectorRequestsEnabled.Equals(other.GzipConnectorRequestsEnabled) ) && ( HmacEnabled == other.HmacEnabled || HmacEnabled != null && HmacEnabled.Equals(other.HmacEnabled) ) && ( EnableEncryption == other.EnableEncryption || EnableEncryption != null && EnableEncryption.Equals(other.EnableEncryption) ) && ( SharedKey == other.SharedKey || SharedKey != null && SharedKey.Equals(other.SharedKey) ) && ( HmacSharedKeyTTL == other.HmacSharedKeyTTL || HmacSharedKeyTTL != null && HmacSharedKeyTTL.Equals(other.HmacSharedKeyTTL) ) && ( BackoffStandbyFactor == other.BackoffStandbyFactor || BackoffStandbyFactor != null && BackoffStandbyFactor.Equals(other.BackoffStandbyFactor) ) && ( BackoffStableFactor == other.BackoffStableFactor || BackoffStableFactor != null && BackoffStableFactor.Equals(other.BackoffStableFactor) )); }