Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
3.5 KiB

  1. //=============================================================================
  2. // MODULE: apreq.c
  3. //
  4. // Description:
  5. //
  6. // Bloodhound Parser DLL for Kerberos Authentication Protocol
  7. //
  8. // Modification History
  9. //
  10. // Michael Webb & Kris Frost Date: 06/04/99
  11. //=============================================================================
  12. #include "kerbGlob.h"
  13. LPBYTE HandleAPReq(HFRAME hFrame, LPBYTE TempFrame)
  14. {
  15. // Display AP-Req (6E)
  16. TempFrame = DispASNTypes(hFrame, TempFrame, 5, DispKerbMsgType, KrbApReqBitF);
  17. // Calculate Length Octet
  18. TempFrame = CalcLengthSummary(hFrame, TempFrame, 7);
  19. // Incrementing TempFrame based on the number of octets
  20. // taken up by the Length octet
  21. TempFrame = IncTempFrame(TempFrame);
  22. // Display SEQUENCE
  23. TempFrame = DispSeqOctets(hFrame, TempFrame, 7, ASN1UnivTagSumID, ASN1UnivTag);
  24. // Incrementing TempFrame based on the number of octets
  25. // taken up by the Length octet
  26. TempFrame = IncTempFrame(TempFrame);
  27. // Display Protocol Version value at the Top level
  28. TempFrame = DispSum(hFrame, TempFrame, 0x02, 0x30, 6, DispProtocolVer);
  29. //Display Integer value of pvno[0]
  30. // Display ASN.1 Identifier
  31. TempFrame = DispASNTypes(hFrame, TempFrame, 7, KrbApReqID, KrbApReqBitF);
  32. // Break Down INTEGER values
  33. TempFrame = DefineValue(hFrame, TempFrame, 9, KdcContentsValue);
  34. // Display Message Type value at the Top level
  35. TempFrame = DispSum(hFrame, TempFrame, 0x02, 0x30, 6, DispKerbMsgType);
  36. // Display msg-type[1]
  37. TempFrame = DispASNTypes(hFrame, TempFrame, 7, KrbApReqID, KrbApReqBitF);
  38. // Break Down INTEGER values
  39. TempFrame = DefineValue(hFrame, TempFrame, 9, KrbMsgTypeID);
  40. // Display AP Options at the Top level
  41. TempFrame = DispTopSum(hFrame, TempFrame, 6, DispApOptionsSum);
  42. // Display ap-options[2]
  43. TempFrame = DispASNTypes(hFrame, TempFrame, 7, KrbApReqID, KrbApReqBitF);
  44. // Display Length Octet
  45. TempFrame = CalcLengthSummary(hFrame, TempFrame, 10);
  46. // Incrementing TempFrame based on the number of octets
  47. // taken up by the Length octet
  48. TempFrame = IncTempFrame(TempFrame);
  49. // Display Universal Class Tag
  50. TempFrame = DispASNTypes(hFrame, TempFrame, 9, ASN1UnivTagSumID, ASN1UnivTag);
  51. // Display Length Octet
  52. TempFrame = CalcLengthSummary(hFrame, TempFrame, 12);
  53. // Need to increment TempFrame by two because AP Options is 32bit
  54. TempFrame+=2;
  55. // Break down AP-Option Flags
  56. TempFrame = DefineKdcOptions(hFrame, TempFrame, 7, DispFlagApOptions);
  57. // Incrementing TempFrame to next Class Tag
  58. TempFrame+=3;
  59. // Display Ticket at Top Level
  60. TempFrame = DispTopSum(hFrame, TempFrame, 6, DispSumTicket);
  61. // Display ticket[3]
  62. TempFrame = HandleTicket(hFrame, TempFrame, 7);
  63. // Handle the display of authenticator[4]
  64. // Display Ciper Text at the Top level
  65. TempFrame = DispTopSum(hFrame, TempFrame, 6, DispCipherText);
  66. // Display authenticator[4] of Ticket
  67. TempFrame = DispASNTypes(hFrame, TempFrame, 7, KrbApReqID, KrbApReqBitF);
  68. // Display Length Octet
  69. TempFrame = CalcLengthSummary(hFrame, TempFrame, 10);
  70. // Incrementing TempFrame based on the number of octets
  71. // taken up by the Length octet
  72. TempFrame = IncTempFrame(TempFrame);
  73. // Display SEQUENCE
  74. TempFrame = DispASNTypes(hFrame, TempFrame, 9, ASN1UnivTagSumID, ASN1UnivTag);
  75. // Display Long form Length Octet
  76. TempFrame = CalcLengthSummary(hFrame, TempFrame, 11);
  77. // Incrementing TempFrame based on the number of octets
  78. // taken up by the Length octet
  79. TempFrame = IncTempFrame(TempFrame);
  80. // Handle EncryptedData Needs to start with A0
  81. TempFrame = HandleEncryptedData(hFrame, TempFrame, 7);
  82. return TempFrame;
  83. }