From 7506dd998836e9475a09f398a2662b27163f67f6 Mon Sep 17 00:00:00 2001 From: Ricardo Mones Date: Wed, 23 Aug 2023 19:48:57 +0200 Subject: [PATCH] Don't link unused function with newer encryption Encryption with previous broken method is only used when explicitly requested by configuring with --with-password-encryption=old --- src/password.c | 7 +++++-- src/password.h | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/password.c b/src/password.c index dc0203bd4..f9a21a57f 100644 --- a/src/password.c +++ b/src/password.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 2016-2021 The Claws Mail Team + * Copyright (C) 2016-2023 The Claws Mail Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ #ifdef HAVE_CONFIG_H @@ -267,6 +266,7 @@ void primary_passphrase_change(const gchar *oldp, const gchar *newp) } #endif +#ifdef PASSWORD_CRYPTO_OLD gchar *password_encrypt_old(const gchar *password) { if (!password || strlen(password) == 0) { @@ -285,7 +285,10 @@ gchar *password_encrypt_old(const gchar *password) return result; } +#endif +/* Decryption is still needed for supporting migration of old + * configurations to newer encryption mechanisms. */ gchar *password_decrypt_old(const gchar *password) { if (!password || strlen(password) == 0) { diff --git a/src/password.h b/src/password.h index bc083d487..7a185d9c8 100644 --- a/src/password.h +++ b/src/password.h @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 2016 Claws Mail team + * Copyright (C) 2016-2023 The Claws Mail team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ #ifndef __PASSWORD_H @@ -50,7 +49,11 @@ void primary_passphrase_change(const gchar *oldp, const gchar *newp); * returns a newly allocated string for the encrypt/decrypt result. * This is for compatibility with with the rest of password-related * functions.*/ +#ifdef PASSWORD_CRYPTO_OLD gchar *password_encrypt_old(const gchar *password); +#endif +/* Decryption is still needed for supporting migration of old + * configurations to newer encryption mechanisms. */ gchar *password_decrypt_old(const gchar *password); #ifdef PASSWORD_CRYPTO_GNUTLS -- 2.11.4.GIT