From bca694200748354c7ee3e51084586d30b9b0164b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20B=C5=99ezina?= Date: Thu, 26 Nov 2020 12:07:06 +0100 Subject: [PATCH 19/19] secrets: remove base64 enctype This was added as part of KCM performance improvements but never used. Ldb is fully capable of holding binary data without the need for base64 encoding so this is not needed. --- src/util/secrets/secrets.c | 15 --------------- src/util/secrets/secrets.h | 1 - 2 files changed, 16 deletions(-) diff --git a/src/util/secrets/secrets.c b/src/util/secrets/secrets.c index ae9c7c83f335c8c2d9d97a736700fbcdaf0d36af..c6310b58526d6f4c063d028cd0e78b5e4f2e12db 100644 --- a/src/util/secrets/secrets.c +++ b/src/util/secrets/secrets.c @@ -75,8 +75,6 @@ static const char *sss_sec_enctype_to_str(enum sss_sec_enctype enctype) return "plaintext"; case SSS_SEC_MASTERKEY: return "masterkey"; - case SSS_SEC_BASE64: - return "base64"; default: DEBUG(SSSDBG_CRIT_FAILURE, "Bug: unknown encryption type %d\n", enctype); @@ -94,10 +92,6 @@ static enum sss_sec_enctype sss_sec_str_to_enctype(const char *str) return SSS_SEC_MASTERKEY; } - if (strcmp("base64", str) == 0) { - return SSS_SEC_BASE64; - } - return SSS_SEC_ENCTYPE_SENTINEL; } @@ -141,10 +135,6 @@ static int local_decrypt(struct sss_sec_ctx *sctx, return ret; } break; - case SSS_SEC_BASE64: - output = (uint8_t *)sss_base64_decode(mem_ctx, (const char *)secret, - &output_len); - break; default: DEBUG(SSSDBG_CRIT_FAILURE, "Unknown encryption type '%d'\n", enctype); return EINVAL; @@ -196,11 +186,6 @@ static int local_encrypt(struct sss_sec_ctx *sec_ctx, output_len = strlen(b64) + 1; talloc_free(_secret.data); break; - case SSS_SEC_BASE64: - b64 = sss_base64_encode(mem_ctx, secret, secret_len); - output = (uint8_t*)b64; - output_len = strlen(b64) + 1; - break; default: DEBUG(SSSDBG_CRIT_FAILURE, "Unknown encryption type '%d'\n", enctype); return EINVAL; diff --git a/src/util/secrets/secrets.h b/src/util/secrets/secrets.h index f8caa53eec376bb0c8d52615ce9111efbbb26393..f79bfaa4b9dc2df577a815c03b86770e3066de75 100644 --- a/src/util/secrets/secrets.h +++ b/src/util/secrets/secrets.h @@ -46,7 +46,6 @@ enum sss_sec_enctype { SSS_SEC_PLAINTEXT, SSS_SEC_MASTERKEY, - SSS_SEC_BASE64, SSS_SEC_ENCTYPE_SENTINEL }; -- 2.25.4