/// <summary> /// Verify RopRestrict Failure Response /// </summary> /// <param name="ropRestrictResponse">The response of RopRestrict request</param> /// <param name="inputHandleIndex">The field of InputHandleIndex in RopRestrict request</param> private void VerifyRopRestrictFailureResponse(RopRestrictResponse ropRestrictResponse, byte inputHandleIndex) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1152"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1152 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropRestrictResponse.RopId.GetType(), 1152, @"[In RopRestrict ROP Failure Response Buffer] RopId (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1154"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1154 Site.CaptureRequirementIfAreEqual<byte>( (byte)RopId.RopRestrict, ropRestrictResponse.RopId, 1154, @"[In RopRestrict ROP Failure Response Buffer] RopId (1 byte): For this operation[RopRestrict], this field[RopId (1 byte)] is set to 0x14."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1155"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1155 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropRestrictResponse.InputHandleIndex.GetType(), 1155, @"[In RopRestrict ROP Failure Response Buffer] InputHandleIndex (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1156"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1156 Site.CaptureRequirementIfAreEqual<byte>( inputHandleIndex, ropRestrictResponse.InputHandleIndex, 1156, @"[In RopRestrict 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_R1157"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1157 Site.CaptureRequirementIfAreEqual<Type>( typeof(uint), ropRestrictResponse.ReturnValue.GetType(), 1157, @"[In RopRestrict ROP Failure Response Buffer] ReturnValue (4 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1159"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1159 Site.CaptureRequirementIfAreNotEqual<uint>( SuccessReturnValue, ropRestrictResponse.ReturnValue, 1159, @"[In RopRestrict ROP Failure Response Buffer] ReturnValue (4 bytes): For this response[Failure Response], this field is set to a value other than 0x00000000."); }
/// <summary> /// Verify RopRestrict Response /// </summary> /// <param name="restrictResponse">RopRestrictResponse structure data that needs verification</param> private void VerifyRopRestrictResponse(RopRestrictResponse restrictResponse) { this.VerifyRPCLayerRequirement(); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R93"); // Verify MS-OXCTABL requirement: MS-OXCTABL_R93 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), restrictResponse.TableStatus.GetType(), 93, @"[In RopRestrict ROP Response Buffer] TableStatus (1 byte): An enumeration that indicates the status of asynchronous operations being performed on the table.<8>"); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R94: the current table status is {0}", restrictResponse.TableStatus); // Verify MS-OXCTABL requirement: MS-OXCTABL_R94 bool isVerifyR94 = (restrictResponse.TableStatus == 0x00) || (restrictResponse.TableStatus == 0x09) || (restrictResponse.TableStatus == 0x0A) || (restrictResponse.TableStatus == 0x0B) || (restrictResponse.TableStatus == 0x0D) || (restrictResponse.TableStatus == 0x0E) || (restrictResponse.TableStatus == 0x0F); Site.CaptureRequirementIfIsTrue( isVerifyR94, 94, @"[In TableStatus] This field MUST have one of the table status values[0x00,0x09,0x0A,0x0B,0x0D,0x0E,0x0F] that are specified in section 2.2.2.1.3."); if ((TableRopReturnValues)restrictResponse.ReturnValue == TableRopReturnValues.success && !this.globalIsRestrictAsynchronous) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R33"); // Verify MS-OXCTABL requirement: MS-OXCTABL_R33 Site.CaptureRequirementIfAreEqual( 0x00, restrictResponse.TableStatus, 33, @"[In TableStatus] When the Table Status is TBLSTAT_COMPLETE with value 0x00 means no operations are in progress."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R43"); // Verify MS-OXCTABL requirement: MS-OXCTABL_R43 Site.CaptureRequirementIfAreEqual( 0x00, restrictResponse.TableStatus, 43, @"[In Asynchronous Flags] When TBL_ASYNC value is 0x00,the server will perform the operation synchronously."); } if (this.globalIsRestrictAsynchronous) { if (Common.IsRequirementEnabled(819, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R819"); // Verify MS-OXCTABL requirement: MS-OXCTABL_R819 Site.CaptureRequirementIfAreEqual( 0x0E, restrictResponse.TableStatus, 819, @"[In Appendix A: Product Behavior] When the Table Status returned by the implementation is TBLSTAT_RESTRICTING with value 0x0E means a RopRestrict ROP is in progress. (Microsoft Exchange Server 2007 follows this behavior.)"); } if (Common.IsRequirementEnabled(42, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R42"); // Verify MS-OXCTABL requirement: MS-OXCTABL_R42 Site.CaptureRequirementIfAreEqual( 0x0E, restrictResponse.TableStatus, 42, @"[In Appendix A: Product Behavior] When TBL_ASYNC value is 0x01,the implementation performs the ROP asynchronously. (Microsoft Exchange Server 2007 follows this behavior.)"); } // If the client requests that the server perform a RopRestrict ROP request asynchronously, the server does not perform the operation synchronously and return "TBLSTAT_COMPLETE" in the TableStatus field of the ROP response buffer. if (Common.IsRequirementEnabled(801, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R801"); // Verify MS-OXCTABL requirement: MS-OXCTABL_R801 Site.CaptureRequirementIfAreNotEqual( 0x00, restrictResponse.TableStatus, 801, @"[In Appendix A: Product Behavior] If the client requests that the implementation perform a RopRestrict ([MS-OXCROPS] section 2.2.5.3) ROP request asynchronously, it does not perform the operation synchronously and not return ""TBLSTAT_COMPLETE"" in the TableStatus field of the ROP response buffer. (Microsoft Exchange Server 2007 follows this behavior.)"); } if (Common.IsRequirementEnabled(811, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R811"); // Verify MS-OXCTABL requirement: MS-OXCTABL_R811 Site.CaptureRequirementIfAreNotEqual( 0x00, restrictResponse.TableStatus, 811, @"[In Appendix A: Product Behavior] If the TBL_ASYNC bit of the RestrictFlags field is set, the implementation does execute the ROP as a table-asynchronous ROP, as specified in section 3.2.5.1. (Microsoft Exchange Server 2007 follows this behavior.)"); } if (Common.IsRequirementEnabled(802, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R802"); // Verify MS-OXCTABL requirement: MS-OXCTABL_R802 Site.CaptureRequirementIfAreEqual( 0x00, restrictResponse.TableStatus, 802, @"[In Appendix A: Product Behavior] If the client requests that the implementation perform a RopRestrict ([MS-OXCROPS] section 2.2.5.3) ROP request asynchronously, it does perform the operation synchronously and return ""TBLSTAT_COMPLETE"" in the TableStatus field of the ROP response buffer. ( <20> Section 3.2.5.1: Exchange 2010, Exchange 2013, and Exchange 2016 do not support asynchronous operations on tables and ignore the TABL_ASYNC flags, as described in section 2.2.2.1.4.)"); } // In the environments that cannot support asynchronous, it will ignore the asynchronous flags, and return Table Status "TBLSTAT_COMPLETE" with value 0x00 when asynchronous flags is set to 0x01 in a RopRestrict ROP. if (Common.IsRequirementEnabled(774, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R774"); // Verify MS-OXCTABL requirement: MS-OXCTABL_R774 Site.CaptureRequirementIfAreEqual( 0x00, restrictResponse.TableStatus, 774, @"[In Appendix A: Product Behavior] Implementation does return Table Status ""TBLSTAT_COMPLETE"" with value 0x00 when asynchronous flags is set to 0x01 in a RopRestrict ROP on tables. (<7> Section 2.2.2.4.1: Exchange 2010, Exchange 2013, and Exchange 2016 will return Table Status ""TBLSTAT_COMPLETE"" with value 0x00 when asynchronous flags is set to 0x01 in a RopRestrict ROP on tables.)"); } // Here it can partially verify MS-OXCTABL requirement: MS-OXCTABL_418 // if the server executes the ROP asynchronously, the server return "TBLSTAT_RESTRICTING" in the TableStatus field of the ROP response buffer and do the work asynchronously. if (Common.IsRequirementEnabled(418, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R418"); // Verify MS-OXCTABL requirement: MS-OXCTABL_R418 Site.CaptureRequirementIfAreEqual( 0x0E, restrictResponse.TableStatus, 418, @"[In Appendix A: Product Behavior] However, if the implementation executes the ROP asynchronously, it return ""TBLSTAT_SORTING"", ""TBLSTAT_SETTING_COLS"", or ""TBLSTAT_RESTRICTING"" (depending on the ROP performed) in the TableStatus field of the ROP response buffer and do the work asynchronously. (Microsoft Exchange Server 2007 follows this behavior.)"); } if (Common.IsRequirementEnabled(810, this.Site)) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCTABL_R810"); // Verify MS-OXCTABL requirement: MS-OXCTABL_R810 // TableStatus in response with value 0x00 means server executes synchronous ROP Site.CaptureRequirementIfAreEqual<byte>( 0x00, restrictResponse.TableStatus, 810, @"[In Appendix A: Product Behavior] If the TBL_ASYNC bit of the RestrictFlags field is set, the implementation does not execute the ROP as a table-asynchronous ROP, as specified in section 3.2.5.1. (<24> Section 3.2.5.4: Exchange 2010, Exchange 2013, and Exchange 2016 do not support asynchronous operations on tables and ignore the TABL_ASYNC flags, as described in section 2.2.2.1.4.)"); } } }
/// <summary> /// Verify RopRestrict Success Response /// </summary> /// <param name="ropRestrictResponse">The response of RopRestrict request</param> /// <param name="inputHandleIndex">The field of InputHandleIndex in RopRestrict request</param> private void VerifyRopRestrictSuccessResponse(RopRestrictResponse ropRestrictResponse, byte inputHandleIndex) { // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1141"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1141 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropRestrictResponse.RopId.GetType(), 1141, @"[In RopRestrict ROP Success Response Buffer] RopId (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1143"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1143 Site.CaptureRequirementIfAreEqual<byte>( (byte)RopId.RopRestrict, ropRestrictResponse.RopId, 1143, @"[In RopRestrict ROP Success Response Buffer] RopId (1 byte): For this operation[RopRestrict], this field[RopId (1 byte)] is set to 0x14."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1144"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1144 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropRestrictResponse.InputHandleIndex.GetType(), 1144, @"[In RopRestrict ROP Success Response Buffer] InputHandleIndex (1 byte): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1145"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1145 Site.CaptureRequirementIfAreEqual<byte>( inputHandleIndex, ropRestrictResponse.InputHandleIndex, 1145, @"[In RopRestrict ROP Success Response Buffer] InputHandleIndex (1 byte): This index that 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_R1146"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1146 Site.CaptureRequirementIfAreEqual<Type>( typeof(uint), ropRestrictResponse.ReturnValue.GetType(), 1146, @"[In RopRestrict ROP Success Response Buffer] ReturnValue (4 bytes): An unsigned integer."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1148"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1148 Site.CaptureRequirementIfAreEqual<uint>( SuccessReturnValue, ropRestrictResponse.ReturnValue, 1148, @"[In RopRestrict ROP Success Response Buffer] ReturnValue (4 bytes): For this response[Success Response], this field is set to 0x00000000."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1149"); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1149 Site.CaptureRequirementIfAreEqual<Type>( typeof(byte), ropRestrictResponse.TableStatus.GetType(), 1149, @"[In RopRestrict ROP Success Response Buffer] TableStatus (1 byte): An enumeration."); // Add the debug information Site.Log.Add(LogEntryKind.Debug, "Verify MS-OXCROPS_R1150,TableStatus:{0}", ropRestrictResponse.TableStatus); // Verify MS-OXCROPS requirement: MS-OXCROPS_R1150 bool isVerifyR1150 = ((ropRestrictResponse.TableStatus & ((byte)TableStatus.TblstatComplete)) == ((byte)TableStatus.TblstatComplete)) || ((ropRestrictResponse.TableStatus & ((byte)TableStatus.TblstatSorting)) == ((byte)TableStatus.TblstatSorting)) || ((ropRestrictResponse.TableStatus & ((byte)TableStatus.TblstatSortError)) == ((byte)TableStatus.TblstatSortError)) || ((ropRestrictResponse.TableStatus & ((byte)TableStatus.TblstatSettingCols)) == ((byte)TableStatus.TblstatSettingCols)) || ((ropRestrictResponse.TableStatus & ((byte)TableStatus.TblstatSetColError)) == ((byte)TableStatus.TblstatSetColError)) || ((ropRestrictResponse.TableStatus & ((byte)TableStatus.TblstatRestricting)) == ((byte)TableStatus.TblstatRestricting)) || ((ropRestrictResponse.TableStatus & ((byte)TableStatus.TblstatRestrictError)) == ((byte)TableStatus.TblstatRestrictError)); Site.CaptureRequirementIfIsTrue( isVerifyR1150, 1150, @"[In RopRestrict ROP Success Response Buffer] TableStatus (1 byte): The possible values[the value of TBLSTAT_COMPLETE is 0x00, the value of TBLSTAT_SORTING is 0x09, the value of TBLSTAT_SORT_ERROR is 0x0A, the value of TBLSTAT_SETTING_COLS is 0x0B, the value of TBLSTAT_SETCOL_ERROR is 0x0D, the value of TBLSTAT_RESTRICTING is 0x0E and the value of TBLSTAT_RESTRICT_ERROR is 0x0F] for this enumeration are specified in [MS-OXCTABL] section 2.2.2.1.3."); }