Leaked source code of windows server 2003
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.

145 lines
2.9 KiB

  1. //=============================================================================
  2. //
  3. // MODULE: ASN1EData.cxx
  4. //
  5. // Description:
  6. //
  7. // Implementation of ASN.1 address error data parsing logic
  8. //
  9. // Modification History
  10. //
  11. // Mark Pustilnik Date: 06/18/02 - created
  12. //
  13. //=============================================================================
  14. #include "ASN1Parser.hxx"
  15. DWORD
  16. ASN1ParserErrorData::ParseBlob(
  17. IN OUT ASN1VALUE * Value
  18. )
  19. {
  20. DWORD dw = ERROR_SUCCESS;
  21. ASN1VALUE * Modifier = QueryModifier();
  22. if ( Modifier == NULL )
  23. {
  24. return ERROR_INTERNAL_ERROR;
  25. }
  26. if ( Modifier->ut != utInteger )
  27. {
  28. return ERROR_INTERNAL_ERROR;
  29. }
  30. switch ( Modifier->dw )
  31. {
  32. case KDC_ERR_ETYPE_NOTSUPP:
  33. case KDC_ERR_PREAUTH_REQUIRED:
  34. case KDC_ERR_PREAUTH_FAILED:
  35. Value->SubParser = new ASN1ParserPaDataSequence(
  36. FALSE,
  37. 0,
  38. PROP( KERB_PREAUTH_DATA_LIST ));
  39. break;
  40. default:
  41. //
  42. // Leave as is
  43. //
  44. break;
  45. }
  46. return dw;
  47. }
  48. DWORD
  49. ASN1ParserKerbEtypeInfoEntry::DisplayCollectedValues(
  50. IN ASN1FRAME * Frame,
  51. IN ULONG Length,
  52. IN ULPBYTE Address
  53. )
  54. {
  55. DWORD dw;
  56. ASN1VALUE * EncryptionType;
  57. ASN1VALUE * Salt;
  58. ASN1VALUE * Integer;
  59. if ( QueryCollectedCount() != 3 )
  60. {
  61. dw = ERROR_INTERNAL_ERROR;
  62. goto Cleanup;
  63. }
  64. EncryptionType = QueryCollectedValue( 0 );
  65. Salt = QueryCollectedValue( 1 );
  66. Integer = QueryCollectedValue( 2 );
  67. if ( EncryptionType->ut != utInteger )
  68. {
  69. dw = ERROR_INTERNAL_ERROR;
  70. goto Cleanup;
  71. }
  72. if ( Salt &&
  73. Salt->ut != utOctetString &&
  74. Salt->ut != utGeneralString )
  75. {
  76. dw = ERROR_INTERNAL_ERROR;
  77. goto Cleanup;
  78. }
  79. dw = Display(
  80. Frame,
  81. EncryptionType,
  82. PROP( KERB_ETYPE_INFO_ENTRY_encryption_type ),
  83. 0
  84. );
  85. if ( dw != ERROR_SUCCESS )
  86. {
  87. goto Cleanup;
  88. }
  89. if ( Salt || Integer )
  90. {
  91. Frame->Level += 1;
  92. if ( Salt )
  93. {
  94. dw = Display(
  95. Frame,
  96. Salt,
  97. PROP( KERB_ETYPE_INFO_ENTRY_salt ),
  98. 0
  99. );
  100. }
  101. if ( Integer &&
  102. dw == ERROR_SUCCESS )
  103. {
  104. dw = Display(
  105. Frame,
  106. Integer,
  107. PROP( INTEGER_NOT_IN_ASN ),
  108. 0
  109. );
  110. }
  111. Frame->Level -= 1;
  112. }
  113. if ( dw != ERROR_SUCCESS )
  114. {
  115. goto Cleanup;
  116. }
  117. Cleanup:
  118. return dw;
  119. }