commit 7506dd998836e9475a09f398a2662b27163f67f6
parent 7f2cc1b35642b2bae5c2d1c7e08ffaed57be18d2
Author: Ricardo Mones <ricardo@mones.org>
Date: Wed, 23 Aug 2023 19:48:57 +0200
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
Diffstat:
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git 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 <http://www.gnu.org/licenses/>.
- *
*/
#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
@@ -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 <http://www.gnu.org/licenses/>.
- *
*/
#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