/// <summary> /// Verify RopGetSearchCriteria Failure Response /// </summary> /// <param name="ropGetSearchCriteriaResponse">The failure response of RopGetSearchCriteria request</param> /// <param name="inputHandleIndex">The field of InputHandleIndex in RopGetSearchCriteria request</param> private void VerifyRopGetSearchCriteriaFailureResponse(RopGetSearchCriteriaResponse ropGetSearchCriteriaResponse, byte inputHandleIndex) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R743"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R743 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropGetSearchCriteriaResponse.RopId.GetType(), 743, @"[In RopGetSearchCriteria ROP Failure Response Buffer] RopId (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R745"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R745 Site.CaptureRequirementIfAreEqual<byte>( (byte)RopId.RopGetSearchCriteria, ropGetSearchCriteriaResponse.RopId, 745, @"[In RopGetSearchCriteria ROP Failure Response Buffer] RopId (1 byte): For this operation[RopGetSearchCriteria], this field[RopId (1 byte)] is set to 0x31."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R746"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R746 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropGetSearchCriteriaResponse.InputHandleIndex.GetType(), 746, @"[In RopGetSearchCriteria ROP Failure Response Buffer] InputHandleIndex (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R747"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R747 Site.CaptureRequirementIfAreEqual<byte>( inputHandleIndex, ropGetSearchCriteriaResponse.InputHandleIndex, 747, @"[In RopGetSearchCriteria ROP Failure Response Buffer] InputHandleIndex (1 byte): This index MUST be set to the value specified in the InputHandleIndex field in the request."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R748"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R748 Site.CaptureRequirementIfAreEqual<Type>( typeof(uint), ropGetSearchCriteriaResponse.ReturnValue.GetType(), 748, @"[In RopGetSearchCriteria ROP Failure Response Buffer] ReturnValue (4 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R750"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R750 Site.CaptureRequirementIfAreNotEqual<uint>( SuccessReturnValue, ropGetSearchCriteriaResponse.ReturnValue, 750, @"[In RopGetSearchCriteria ROP Failure Response Buffer] ReturnValue (4 bytes): For this response[Failure Response], this field[ReturnValue (4 bytes)] is set to a value other than 0x00000000."); }
/// <summary> /// Verify the response of RopGetSearchCriteria ROP operation. /// </summary> /// <param name="getSearchCriteriaResponse">The response of RopGetSearchCriteria operation</param> private void VerifyRopGetSearchCriteria(RopGetSearchCriteriaResponse getSearchCriteriaResponse) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R134"); // Verify MS-OXCFOLD requirement: MS-OXCFOLD_R134 Site.CaptureRequirementIfAreEqual<uint>( Constants.SuccessCode, getSearchCriteriaResponse.ReturnValue, 134, @"[In RopGetSearchCriteria ROP Response Buffer] ReturnValue (4 bytes): The server returns 0x00000000 to indicate success."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, @"Verify MS-OXCFOLD_R120"); // Verify MS-OXCFOLD requirement: MS-OXCFOLD_R120 Site.CaptureRequirementIfAreEqual<uint>( Constants.SuccessCode, getSearchCriteriaResponse.ReturnValue, 120, @"[In RopGetSearchCriteria ROP] The RopGetSearchCriteria ROP ([MS-OXCROPS] section 2.2.4.5) obtains the search criteria and the status of a search for a search folder."); if (getSearchCriteriaResponse.RestrictionData != null) { RestrictsFactory.Deserialize(getSearchCriteriaResponse.RestrictionData); // Add the debug information. Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R137"); // Verify MS-OXCFOLD requirement: MS-OXCFOLD_R137. // The RestrictionData in RopGetSearchCriteria ROP response were deserialized successfully, MS-OXCFOLD_R137 can be verified directly. Site.CaptureRequirement( 137, @"[In RopGetSearchCriteria ROP Response Buffer] RestrictionData (variable): A packet of structures that specify restrictions for the search folder."); byte restrictions = getSearchCriteriaResponse.RestrictionData[0]; bool isVerifiedR510 = restrictions == 0 || restrictions == (byte)0x01 || restrictions == (byte)0x02 || restrictions == (byte)0x03 || restrictions == (byte)0x04 || restrictions == (byte)0x05 || restrictions == (byte)0x06 || restrictions == (byte)0x07 || restrictions == (byte)0x08 || restrictions == (byte)0x09 || restrictions == (byte)0x0A || restrictions == (byte)0x0B; // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCDATA_R510, RestrictType expected value is: 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A and 0x0B, actual value is {0}", restrictions.ToString()); // Verify MS-OXCDATA requirement: MS-OXCDATA_R510 Site.CaptureRequirementIfIsTrue( isVerifiedR510, Constants.MSOXCDATA, 510, @"[In Restrictions] Although the packet formats differ, the first 8 bits always store RestrictType, an unsigned byte value specifying the type of restriction."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R958"); // Verify MS-OXCFOLD requirement: MS-OXCFOLD_R958 Site.CaptureRequirementIfAreEqual<int>( getSearchCriteriaResponse.RestrictionData.Length, getSearchCriteriaResponse.RestrictionDataSize, 958, @"[In RopGetSearchCriteria ROP Response Buffer] The size of this field [RestrictionData] is specified by the RestrictionDataSize field."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R957"); // Verify MS-OXCFOLD requirement: MS-OXCFOLD_R957 Site.CaptureRequirementIfAreEqual<int>( getSearchCriteriaResponse.RestrictionData.Length, getSearchCriteriaResponse.RestrictionDataSize, 957, @"[In RopGetSearchCriteria ROP Response Buffer] RestrictionDataSize (2 bytes): An integer that specifies the size, in bytes, of the RestrictionData field."); } if (getSearchCriteriaResponse.FolderIds != null) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R138"); // Verify MS-OXCFOLD requirement: MS-OXCFOLD_R138 Site.CaptureRequirementIfAreEqual<int>( getSearchCriteriaResponse.FolderIds.Length, getSearchCriteriaResponse.FolderIdCount, 138, @"[InRopGetSearchCriteria ROP Response Buffer] FolderIdCount (2 bytes): An integer that specifies the number of structures contained in the FolderIds field."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R2140"); // Verify MS-OXCFOLD requirement: MS-OXCFOLD_R2140 Site.CaptureRequirementIfAreEqual<int>( getSearchCriteriaResponse.FolderIdCount, getSearchCriteriaResponse.FolderIds.Length, 2140, @"[InRopGetSearchCriteria ROP Response Buffer] The number of structures contained in the array is specified by the value of the FolderIdCount field. "); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R140"); // Verify MS-OXCFOLD requirement: MS-OXCFOLD_R140 // The RopGetSearchCriteriaResponse ROP response was parsed successfully and the FolderIdCount field was verified, MS-OXCFOLD_R140 can be captured directly. Site.CaptureRequirement( 140, "[In RopGetSearchCriteria ROP Response Buffer] FolderIds (variable): An array of FID structures ([MS-OXCDATA] section 2.2.1.1), each of which specifies a folder that is being searched."); } // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCFOLD_R121"); // Verify MS-OXCFOLD requirement: MS-OXCFOLD_R121 Site.CaptureRequirementIfAreEqual<uint>( Constants.SuccessCode, getSearchCriteriaResponse.ReturnValue, 121, @"[In RopGetSearchCriteria ROP] The search criteria are created by using RopSetSearchCriteria (section 2.2.1.4)."); }
/// <summary> /// Verify RopGetSearchCriteria Success Response /// </summary> /// <param name="ropGetSearchCriteriaResponse">The success response of RopGetSearchCriteria request</param> /// <param name="logonId">The field of LogonId in RopGetSearchCriteria request</param> /// <param name="inputHandleIndex">The field of InputHandleIndex in RopGetSearchCriteria request</param> private void VerifyRopGetSearchCriteriaSuccessResponse(RopGetSearchCriteriaResponse ropGetSearchCriteriaResponse, byte logonId, byte inputHandleIndex) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R720"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R720 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropGetSearchCriteriaResponse.RopId.GetType(), 720, @"[In RopGetSearchCriteria ROP Success Response Buffer] RopId (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R722"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R722 Site.CaptureRequirementIfAreEqual<byte>( (byte)RopId.RopGetSearchCriteria, ropGetSearchCriteriaResponse.RopId, 722, @"[In RopGetSearchCriteria ROP Success Response Buffer] RopId (1 byte): For this operation[RopGetSearchCriteria], this field[RopId (1 byte)] is set to 0x31."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R723"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R723 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropGetSearchCriteriaResponse.InputHandleIndex.GetType(), 723, @"[In RopGetSearchCriteria ROP Success Response Buffer] InputHandleIndex (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R724"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R724 Site.CaptureRequirementIfAreEqual<byte>( inputHandleIndex, ropGetSearchCriteriaResponse.InputHandleIndex, 724, @"[In RopGetSearchCriteria ROP Success Response Buffer] InputHandleIndex (1 byte): This index MUST be set to the value specified in the InputHandleIndex field in the request."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R725"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R725 Site.CaptureRequirementIfAreEqual<Type>( typeof(uint), ropGetSearchCriteriaResponse.ReturnValue.GetType(), 725, @"[In RopGetSearchCriteria ROP Success Response Buffer] ReturnValue (4 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R727"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R727 Site.CaptureRequirementIfAreEqual<uint>( SuccessReturnValue, ropGetSearchCriteriaResponse.ReturnValue, 727, @"[In RopGetSearchCriteria ROP Success Response Buffer] ReturnValue (4 bytes): For this response[Success Response], this field[ReturnValue (4 bytes)] is set to 0x00000000."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R728"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R728 Site.CaptureRequirementIfAreEqual<Type>( typeof(ushort), ropGetSearchCriteriaResponse.RestrictionDataSize.GetType(), 728, @"[In RopGetSearchCriteria ROP Success Response Buffer] RestrictionDataSize (2 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R734"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R734 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropGetSearchCriteriaResponse.LogonId.GetType(), 734, @"[In RopGetSearchCriteria ROP Success Response Buffer] LogonId (1 byte): ): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R735"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R735 Site.CaptureRequirementIfAreEqual<byte>( logonId, ropGetSearchCriteriaResponse.LogonId, 735, @"[In RopGetSearchCriteria ROP Success Response Buffer] LogonId (1 byte): This field MUST be set to the value of the LogonId field in the request."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R736"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R736 Site.CaptureRequirementIfAreEqual<Type>( typeof(ushort), ropGetSearchCriteriaResponse.FolderIdCount.GetType(), 736, @"[In RopGetSearchCriteria ROP Success Response Buffer] FolderIdCount (2 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R738, the actual type of FolderIds is:{0}", ropGetSearchCriteriaResponse.FolderIds.GetType().Name); // Verify MS-OXCROPS requirement: MS-OXCROPS_R738 // If FolderIds is long array or ulong array, can be array of 64-bit bool isVerifyR738 = (typeof(long[]) == ropGetSearchCriteriaResponse.FolderIds.GetType()) || (typeof(ulong[]) == ropGetSearchCriteriaResponse.FolderIds.GetType()); Site.CaptureRequirementIfIsTrue( isVerifyR738, 738, @"[In RopGetSearchCriteria ROP Success Response Buffer] FolderIds (variable): An array of 64-bit identifiers."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R740"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R740 Site.CaptureRequirementIfAreEqual<ushort>( ropGetSearchCriteriaResponse.FolderIdCount, (ushort)ropGetSearchCriteriaResponse.FolderIds.Length, 740, @"[In RopGetSearchCriteria ROP Success Response Buffer] FolderIds (variable): The number of identifiers contained in this field is specified by the FolderIdCount field."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R741"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R741 Site.CaptureRequirementIfAreEqual<int>( 4, Marshal.SizeOf(ropGetSearchCriteriaResponse.SearchFlags), 741, @"[In RopGetSearchCriteria ROP Success Response Buffer] SearchFlags (4 bytes): ): A flags structure."); }