/pidgin/main: 82c3165b6201: Build aescipher even if there is no ...

Ankit Vani a at nevitus.org
Wed Feb 12 02:19:18 EST 2014


Changeset: 82c3165b62013f78c7c91a041dd086abd78d0259
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-02-12 12:48 +0530
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/82c3165b6201

Description:

Build aescipher even if there is no NSS or GnuTLS so that purple_aes_cipher_new is resolved

diffstat:

 libpurple/Makefile.am         |  13 ++-----------
 libpurple/ciphers/aescipher.c |   8 +++++---
 2 files changed, 7 insertions(+), 14 deletions(-)

diffs (69 lines):

diff --git a/libpurple/Makefile.am b/libpurple/Makefile.am
--- a/libpurple/Makefile.am
+++ b/libpurple/Makefile.am
@@ -38,15 +38,6 @@ pkgconfig_DATA = purple-3.pc
 
 SUBDIRS = $(GCONF_DIR) plugins protocols . tests example
 
-if USE_NSS
-AES_SOURCE = ciphers/aescipher.c
-AES_HEADER = aescipher.h
-endif
-if USE_GNUTLS
-AES_SOURCE = ciphers/aescipher.c
-AES_HEADER = aescipher.h
-endif
-
 purple_coresources = \
 	account.c \
 	accounts.c \
@@ -56,7 +47,7 @@ purple_coresources = \
 	buddylist.c \
 	buddyicon.c \
 	certificate.c \
-	$(AES_SOURCE) \
+	ciphers/aescipher.c \
 	ciphers/descipher.c \
 	ciphers/des3cipher.c \
 	ciphers/hmaccipher.c \
@@ -208,7 +199,7 @@ purple_mediaheaders = \
 	enum-types.h
 
 purple_cipherheaders = \
-	$(AES_HEADER) \
+	aescipher.h \
 	descipher.h \
 	des3cipher.h \
 	hmaccipher.h \
diff --git a/libpurple/ciphers/aescipher.c b/libpurple/ciphers/aescipher.c
--- a/libpurple/ciphers/aescipher.c
+++ b/libpurple/ciphers/aescipher.c
@@ -41,7 +41,7 @@
 #  include <pk11pub.h>
 #  include <prerror.h>
 #else
-#  error "No GnuTLS or NSS support"
+#  warning "No GnuTLS or NSS support"
 #endif
 
 /* 128bit */
@@ -438,7 +438,8 @@ purple_aes_cipher_encrypt(PurpleCipher *
 #elif defined(PURPLE_AES_USE_NSS)
 	encrypt_func = purple_aes_cipher_nss_encrypt;
 #else
-#  error "No matching encrypt_func"
+	purple_debug_error("cipher-aes", "No matching encrypt_func\n");
+	return -1;
 #endif
 
 	succ = encrypt_func(input_padded, output, out_len, priv->iv,
@@ -482,7 +483,8 @@ purple_aes_cipher_decrypt(PurpleCipher *
 #elif defined(PURPLE_AES_USE_NSS)
 	decrypt_func = purple_aes_cipher_nss_decrypt;
 #else
-#  error "No matching encrypt_func"
+	purple_debug_error("cipher-aes", "No matching decrypt_func\n");
+	return -1;
 #endif
 
 	succ = decrypt_func(input, output, in_len, priv->iv, priv->key,



More information about the Commits mailing list