From 37d0e761b81bac04c33cd9aec63f582e8771155e Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sep 20 2018 21:58:48 +0000 Subject: [PATCH 1/2] Remove statically defined enctype Always use the encype we selected from the keytab. Signed-off-by: Simo Sorce --- diff --git a/src/gp_export.c b/src/gp_export.c index 5e8e160..9ac2d7b 100644 --- a/src/gp_export.c +++ b/src/gp_export.c @@ -14,8 +14,6 @@ #include #include -#define GP_CREDS_HANDLE_KEY_ENCTYPE ENCTYPE_AES256_CTS_HMAC_SHA1_96 - struct gp_creds_handle { krb5_context context; krb5_keyblock *key; @@ -164,8 +162,7 @@ uint32_t gp_init_creds_handle(uint32_t *min, const char *svc_name, ret_maj = gp_init_creds_with_keytab(&ret_min, svc_name, keytab, handle); if (ret_maj != GSS_S_COMPLETE) { /* fallback */ - ret = krb5_init_keyblock(handle->context, - GP_CREDS_HANDLE_KEY_ENCTYPE, 0, + ret = krb5_init_keyblock(handle->context, handle->key->enctype, 0, &handle->key); if (ret == 0) { ret = krb5_c_make_random_key(handle->context, handle->key->enctype, From dc4ee9be48d9914613df6b7e58044e2ad75abf5b Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sep 20 2018 22:07:49 +0000 Subject: [PATCH 2/2] Revert "Remove statically defined enctype" This reverts commit 37d0e761b81bac04c33cd9aec63f582e8771155e. Bad commit, it tries to remove the *fallback* case ... --- diff --git a/src/gp_export.c b/src/gp_export.c index 9ac2d7b..5e8e160 100644 --- a/src/gp_export.c +++ b/src/gp_export.c @@ -14,6 +14,8 @@ #include #include +#define GP_CREDS_HANDLE_KEY_ENCTYPE ENCTYPE_AES256_CTS_HMAC_SHA1_96 + struct gp_creds_handle { krb5_context context; krb5_keyblock *key; @@ -162,7 +164,8 @@ uint32_t gp_init_creds_handle(uint32_t *min, const char *svc_name, ret_maj = gp_init_creds_with_keytab(&ret_min, svc_name, keytab, handle); if (ret_maj != GSS_S_COMPLETE) { /* fallback */ - ret = krb5_init_keyblock(handle->context, handle->key->enctype, 0, + ret = krb5_init_keyblock(handle->context, + GP_CREDS_HANDLE_KEY_ENCTYPE, 0, &handle->key); if (ret == 0) { ret = krb5_c_make_random_key(handle->context, handle->key->enctype,