Provide support for enctype aliases for ease of use.
This should be compatible with MIT krb5 at least from my memory.
This commit is contained in:
@@ -142,6 +142,7 @@ AES_PRF(krb5_context context,
|
|||||||
struct _krb5_encryption_type _krb5_enctype_aes128_cts_hmac_sha1 = {
|
struct _krb5_encryption_type _krb5_enctype_aes128_cts_hmac_sha1 = {
|
||||||
ETYPE_AES128_CTS_HMAC_SHA1_96,
|
ETYPE_AES128_CTS_HMAC_SHA1_96,
|
||||||
"aes128-cts-hmac-sha1-96",
|
"aes128-cts-hmac-sha1-96",
|
||||||
|
"aes128-cts",
|
||||||
16,
|
16,
|
||||||
1,
|
1,
|
||||||
16,
|
16,
|
||||||
@@ -157,6 +158,7 @@ struct _krb5_encryption_type _krb5_enctype_aes128_cts_hmac_sha1 = {
|
|||||||
struct _krb5_encryption_type _krb5_enctype_aes256_cts_hmac_sha1 = {
|
struct _krb5_encryption_type _krb5_enctype_aes256_cts_hmac_sha1 = {
|
||||||
ETYPE_AES256_CTS_HMAC_SHA1_96,
|
ETYPE_AES256_CTS_HMAC_SHA1_96,
|
||||||
"aes256-cts-hmac-sha1-96",
|
"aes256-cts-hmac-sha1-96",
|
||||||
|
"aes256-cts",
|
||||||
16,
|
16,
|
||||||
1,
|
1,
|
||||||
16,
|
16,
|
||||||
|
@@ -312,6 +312,7 @@ ARCFOUR_encrypt(krb5_context context,
|
|||||||
struct _krb5_encryption_type _krb5_enctype_arcfour_hmac_md5 = {
|
struct _krb5_encryption_type _krb5_enctype_arcfour_hmac_md5 = {
|
||||||
ETYPE_ARCFOUR_HMAC_MD5,
|
ETYPE_ARCFOUR_HMAC_MD5,
|
||||||
"arcfour-hmac-md5",
|
"arcfour-hmac-md5",
|
||||||
|
"rc4-hmac",
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
8,
|
8,
|
||||||
|
@@ -288,6 +288,7 @@ DES_PCBC_encrypt_key_ivec(krb5_context context,
|
|||||||
struct _krb5_encryption_type _krb5_enctype_des_cbc_crc = {
|
struct _krb5_encryption_type _krb5_enctype_des_cbc_crc = {
|
||||||
ETYPE_DES_CBC_CRC,
|
ETYPE_DES_CBC_CRC,
|
||||||
"des-cbc-crc",
|
"des-cbc-crc",
|
||||||
|
NULL,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
@@ -303,6 +304,7 @@ struct _krb5_encryption_type _krb5_enctype_des_cbc_crc = {
|
|||||||
struct _krb5_encryption_type _krb5_enctype_des_cbc_md4 = {
|
struct _krb5_encryption_type _krb5_enctype_des_cbc_md4 = {
|
||||||
ETYPE_DES_CBC_MD4,
|
ETYPE_DES_CBC_MD4,
|
||||||
"des-cbc-md4",
|
"des-cbc-md4",
|
||||||
|
NULL,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
@@ -318,6 +320,7 @@ struct _krb5_encryption_type _krb5_enctype_des_cbc_md4 = {
|
|||||||
struct _krb5_encryption_type _krb5_enctype_des_cbc_md5 = {
|
struct _krb5_encryption_type _krb5_enctype_des_cbc_md5 = {
|
||||||
ETYPE_DES_CBC_MD5,
|
ETYPE_DES_CBC_MD5,
|
||||||
"des-cbc-md5",
|
"des-cbc-md5",
|
||||||
|
NULL,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
@@ -333,6 +336,7 @@ struct _krb5_encryption_type _krb5_enctype_des_cbc_md5 = {
|
|||||||
struct _krb5_encryption_type _krb5_enctype_des_cbc_none = {
|
struct _krb5_encryption_type _krb5_enctype_des_cbc_none = {
|
||||||
ETYPE_DES_CBC_NONE,
|
ETYPE_DES_CBC_NONE,
|
||||||
"des-cbc-none",
|
"des-cbc-none",
|
||||||
|
NULL,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
0,
|
0,
|
||||||
@@ -348,6 +352,7 @@ struct _krb5_encryption_type _krb5_enctype_des_cbc_none = {
|
|||||||
struct _krb5_encryption_type _krb5_enctype_des_cfb64_none = {
|
struct _krb5_encryption_type _krb5_enctype_des_cfb64_none = {
|
||||||
ETYPE_DES_CFB64_NONE,
|
ETYPE_DES_CFB64_NONE,
|
||||||
"des-cfb64-none",
|
"des-cfb64-none",
|
||||||
|
NULL,
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
@@ -363,6 +368,7 @@ struct _krb5_encryption_type _krb5_enctype_des_cfb64_none = {
|
|||||||
struct _krb5_encryption_type _krb5_enctype_des_pcbc_none = {
|
struct _krb5_encryption_type _krb5_enctype_des_pcbc_none = {
|
||||||
ETYPE_DES_PCBC_NONE,
|
ETYPE_DES_PCBC_NONE,
|
||||||
"des-pcbc-none",
|
"des-pcbc-none",
|
||||||
|
NULL,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
0,
|
0,
|
||||||
|
@@ -131,6 +131,7 @@ struct _krb5_checksum_type _krb5_checksum_hmac_sha1_des3 = {
|
|||||||
struct _krb5_encryption_type _krb5_enctype_des3_cbc_md5 = {
|
struct _krb5_encryption_type _krb5_enctype_des3_cbc_md5 = {
|
||||||
ETYPE_DES3_CBC_MD5,
|
ETYPE_DES3_CBC_MD5,
|
||||||
"des3-cbc-md5",
|
"des3-cbc-md5",
|
||||||
|
NULL,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
@@ -147,6 +148,7 @@ struct _krb5_encryption_type _krb5_enctype_des3_cbc_md5 = {
|
|||||||
struct _krb5_encryption_type _krb5_enctype_des3_cbc_sha1 = {
|
struct _krb5_encryption_type _krb5_enctype_des3_cbc_sha1 = {
|
||||||
ETYPE_DES3_CBC_SHA1,
|
ETYPE_DES3_CBC_SHA1,
|
||||||
"des3-cbc-sha1",
|
"des3-cbc-sha1",
|
||||||
|
NULL,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
@@ -163,6 +165,7 @@ struct _krb5_encryption_type _krb5_enctype_des3_cbc_sha1 = {
|
|||||||
struct _krb5_encryption_type _krb5_enctype_old_des3_cbc_sha1 = {
|
struct _krb5_encryption_type _krb5_enctype_old_des3_cbc_sha1 = {
|
||||||
ETYPE_OLD_DES3_CBC_SHA1,
|
ETYPE_OLD_DES3_CBC_SHA1,
|
||||||
"old-des3-cbc-sha1",
|
"old-des3-cbc-sha1",
|
||||||
|
NULL,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
@@ -179,6 +182,7 @@ struct _krb5_encryption_type _krb5_enctype_old_des3_cbc_sha1 = {
|
|||||||
struct _krb5_encryption_type _krb5_enctype_des3_cbc_none = {
|
struct _krb5_encryption_type _krb5_enctype_des3_cbc_none = {
|
||||||
ETYPE_DES3_CBC_NONE,
|
ETYPE_DES3_CBC_NONE,
|
||||||
"des3-cbc-none",
|
"des3-cbc-none",
|
||||||
|
NULL,
|
||||||
8,
|
8,
|
||||||
8,
|
8,
|
||||||
0,
|
0,
|
||||||
|
@@ -87,6 +87,7 @@ NULL_encrypt(krb5_context context,
|
|||||||
struct _krb5_encryption_type _krb5_enctype_null = {
|
struct _krb5_encryption_type _krb5_enctype_null = {
|
||||||
ETYPE_NULL,
|
ETYPE_NULL,
|
||||||
"null",
|
"null",
|
||||||
|
NULL,
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
|
@@ -679,11 +679,17 @@ krb5_string_to_enctype(krb5_context context,
|
|||||||
krb5_enctype *etype)
|
krb5_enctype *etype)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < _krb5_num_etypes; i++)
|
for(i = 0; i < _krb5_num_etypes; i++) {
|
||||||
if(strcasecmp(_krb5_etypes[i]->name, string) == 0){
|
if(strcasecmp(_krb5_etypes[i]->name, string) == 0){
|
||||||
*etype = _krb5_etypes[i]->type;
|
*etype = _krb5_etypes[i]->type;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if(_krb5_etypes[i]->alias != NULL &&
|
||||||
|
strcasecmp(_krb5_etypes[i]->alias, string) == 0){
|
||||||
|
*etype = _krb5_etypes[i]->type;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
krb5_set_error_message (context, KRB5_PROG_ETYPE_NOSUPP,
|
krb5_set_error_message (context, KRB5_PROG_ETYPE_NOSUPP,
|
||||||
N_("encryption type %s not supported", ""),
|
N_("encryption type %s not supported", ""),
|
||||||
string);
|
string);
|
||||||
|
@@ -103,6 +103,7 @@ struct _krb5_checksum_type {
|
|||||||
struct _krb5_encryption_type {
|
struct _krb5_encryption_type {
|
||||||
krb5_enctype type;
|
krb5_enctype type;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
const char *alias;
|
||||||
size_t blocksize;
|
size_t blocksize;
|
||||||
size_t padsize;
|
size_t padsize;
|
||||||
size_t confoundersize;
|
size_t confoundersize;
|
||||||
|
Reference in New Issue
Block a user