Commit 0a880e57 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

klist: Match native output for encryption type.

parent a5c90922
...@@ -37,43 +37,42 @@ static const WCHAR *load_resource(UINT id) ...@@ -37,43 +37,42 @@ static const WCHAR *load_resource(UINT id)
static const WCHAR *get_etype_text(LONG encryption_type) static const WCHAR *get_etype_text(LONG encryption_type)
{ {
switch (encryption_type) { switch (encryption_type)
#define EXPAND_ETYPE(x) case KERB_ETYPE_##x: return L ## #x {
EXPAND_ETYPE(NULL); case KERB_ETYPE_NULL: return L"NULL";
EXPAND_ETYPE(DES_CBC_CRC); case KERB_ETYPE_DES_CBC_CRC: return L"DES-CBC-CRC";
EXPAND_ETYPE(DES_CBC_MD4); case KERB_ETYPE_DES_CBC_MD4: return L"DES-CBC-MD4";
EXPAND_ETYPE(DES_CBC_MD5); case KERB_ETYPE_DES_CBC_MD5: return L"DES-CBC-MD5";
EXPAND_ETYPE(AES128_CTS_HMAC_SHA1_96); case KERB_ETYPE_AES128_CTS_HMAC_SHA1_96: return L"AES-128-CTS-HMAC-SHA1-96";
EXPAND_ETYPE(AES256_CTS_HMAC_SHA1_96); case KERB_ETYPE_AES256_CTS_HMAC_SHA1_96: return L"AES-256-CTS-HMAC-SHA1-96";
EXPAND_ETYPE(RC4_MD4); case KERB_ETYPE_RC4_MD4: return L"RC4-MD4";
EXPAND_ETYPE(RC4_PLAIN2); case KERB_ETYPE_RC4_PLAIN2: return L"RC4-PLAIN2";
EXPAND_ETYPE(RC4_LM); case KERB_ETYPE_RC4_LM: return L"RC4-LM";
EXPAND_ETYPE(RC4_SHA); case KERB_ETYPE_RC4_SHA: return L"RC4-SHA";
EXPAND_ETYPE(DES_PLAIN); case KERB_ETYPE_DES_PLAIN: return L"DES-PLAIN";
EXPAND_ETYPE(RC4_HMAC_OLD); case KERB_ETYPE_RC4_HMAC_OLD: return L"RC4-HMAC-OLD";
EXPAND_ETYPE(RC4_PLAIN_OLD); case KERB_ETYPE_RC4_PLAIN_OLD: return L"RC4-PLAIN-OLD";
EXPAND_ETYPE(RC4_HMAC_OLD_EXP); case KERB_ETYPE_RC4_HMAC_OLD_EXP: return L"RC4-HMAC-OLD-EXP";
EXPAND_ETYPE(RC4_PLAIN_OLD_EXP); case KERB_ETYPE_RC4_PLAIN_OLD_EXP: return L"RC4-PLAIN-OLD-EXP";
EXPAND_ETYPE(RC4_PLAIN); case KERB_ETYPE_RC4_PLAIN: return L"RC4-PLAIN";
EXPAND_ETYPE(RC4_PLAIN_EXP); case KERB_ETYPE_RC4_PLAIN_EXP: return L"RC4-PLAIN-EXP";
EXPAND_ETYPE(AES128_CTS_HMAC_SHA1_96_PLAIN); case KERB_ETYPE_AES128_CTS_HMAC_SHA1_96_PLAIN: return L"AES-128-CTS-HMAC-SHA1-96-PLAIN";
EXPAND_ETYPE(AES256_CTS_HMAC_SHA1_96_PLAIN); case KERB_ETYPE_AES256_CTS_HMAC_SHA1_96_PLAIN: return L"AES-256-CTS-HMAC-SHA1-96-PLAIN";
EXPAND_ETYPE(DSA_SHA1_CMS); case KERB_ETYPE_DSA_SHA1_CMS: return L"DSA-SHA1-CMS";
EXPAND_ETYPE(RSA_MD5_CMS); case KERB_ETYPE_RSA_MD5_CMS: return L"RSA-MD5-CMS";
EXPAND_ETYPE(RSA_SHA1_CMS); case KERB_ETYPE_RSA_SHA1_CMS: return L"RSA-SHA1-CMS";
EXPAND_ETYPE(RC2_CBC_ENV); case KERB_ETYPE_RC2_CBC_ENV: return L"RC2-CBC-ENV";
EXPAND_ETYPE(RSA_ENV); case KERB_ETYPE_RSA_ENV: return L"RSA-ENV";
EXPAND_ETYPE(RSA_ES_OEAP_ENV); case KERB_ETYPE_RSA_ES_OEAP_ENV: return L"RSA-ES-OEAP-ENV";
EXPAND_ETYPE(DES_EDE3_CBC_ENV); case KERB_ETYPE_DES_EDE3_CBC_ENV: return L"DES-EDE3-CBC-ENV";
EXPAND_ETYPE(DSA_SIGN); case KERB_ETYPE_DSA_SIGN: return L"DSA-SIGN";
EXPAND_ETYPE(DES3_CBC_MD5); case KERB_ETYPE_DES3_CBC_MD5: return L"DES3-CBC-MD5";
EXPAND_ETYPE(DES3_CBC_SHA1); case KERB_ETYPE_DES3_CBC_SHA1: return L"DES3-CBC-SHA1";
EXPAND_ETYPE(DES3_CBC_SHA1_KD); case KERB_ETYPE_DES3_CBC_SHA1_KD: return L"DES3-CBC-SHA1-KD";
EXPAND_ETYPE(DES_CBC_MD5_NT); case KERB_ETYPE_DES_CBC_MD5_NT: return L"DES-CBC-MD5-NT";
EXPAND_ETYPE(RC4_HMAC_NT); case KERB_ETYPE_RC4_HMAC_NT: return L"RC4-HMAC-NT";
EXPAND_ETYPE(RC4_HMAC_NT_EXP); case KERB_ETYPE_RC4_HMAC_NT_EXP: return L"RC4-HMAC-NT-EXP";
#undef EXPAND_ETYPE default: return L"unknown";
default: return NULL;
} }
} }
...@@ -200,7 +199,6 @@ static int tickets(void) ...@@ -200,7 +199,6 @@ static int tickets(void)
const FILETIME *const filetimes[] = { (FILETIME*)&ticket.StartTime, const FILETIME *const filetimes[] = { (FILETIME*)&ticket.StartTime,
(FILETIME*)&ticket.EndTime, (FILETIME*)&ticket.RenewTime }; (FILETIME*)&ticket.EndTime, (FILETIME*)&ticket.RenewTime };
const WCHAR *dates[3]; const WCHAR *dates[3];
const WCHAR *etype_text;
format_dates_and_times(filetimes, dates, 3); format_dates_and_times(filetimes, dates, 3);
...@@ -211,16 +209,8 @@ static int tickets(void) ...@@ -211,16 +209,8 @@ static int tickets(void)
ticket.ServerName.Length / sizeof(WCHAR), ticket.ServerName.Buffer, ticket.ServerName.Length / sizeof(WCHAR), ticket.ServerName.Buffer,
ticket.RealmName.Length / sizeof(WCHAR), ticket.RealmName.Buffer); ticket.RealmName.Length / sizeof(WCHAR), ticket.RealmName.Buffer);
etype_text = get_etype_text(ticket.EncryptionType);
wprintf(L" %ls: ", load_resource(STRING_ENCRYPTION_TYPE)); wprintf(L" %ls: ", load_resource(STRING_ENCRYPTION_TYPE));
if (etype_text) wprintf(L"%s\n", get_etype_text(ticket.EncryptionType));
{
wprintf(L"%s\n", etype_text);
}
else
{
wprintf(L"%ld\n", ticket.EncryptionType);
}
wprintf(L" %ls: 0x%lx ->", load_resource(STRING_TICKET_FLAGS), ticket.TicketFlags); wprintf(L" %ls: 0x%lx ->", load_resource(STRING_TICKET_FLAGS), ticket.TicketFlags);
#define EXPAND_TICKET_FLAG(x) if (ticket.TicketFlags & KERB_TICKET_FLAGS_##x) wprintf(L" %ls", L ## #x) #define EXPAND_TICKET_FLAG(x) if (ticket.TicketFlags & KERB_TICKET_FLAGS_##x) wprintf(L" %ls", L ## #x)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment