From f2c56756ac6fa3990ea94a2e92ec8110cbbe398d Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 12 Mar 2016 18:26:44 +0100 Subject: Add mbedtls/openssl as STEAM_CRYPT_BACKEND Also fix the ifdef check to include linux systems. --- steam-mobile/Makefile | 6 ++++++ steam-mobile/steam_rsa.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/steam-mobile/Makefile b/steam-mobile/Makefile index 3f66ee1..212e6f8 100644 --- a/steam-mobile/Makefile +++ b/steam-mobile/Makefile @@ -21,6 +21,12 @@ ifeq ($(STEAM_CRYPT_BACKEND), nss) else ifeq ($(STEAM_CRYPT_BACKEND), gcrypt) LIBPURPLE_CFLAGS += $(shell libgcrypt-config --cflags) -DUSE_GCRYPT_CRYPTO LIBPURPLE_LIBS += $(shell libgcrypt-config --libs) +else ifeq ($(STEAM_CRYPT_BACKEND), mbedtls) + LIBPURPLE_CFLAGS += -DUSE_MBEDTLS_CRYPTO + LIBPURPLE_LIBS += -lmbedtls -lmbedcrypto -lmbedx509 +else ifeq ($(STEAM_CRYPT_BACKEND), openssl) + LIBPURPLE_CFLAGS += $(shell ${PKG_CONFIG} --cflags openssl) -DUSE_OPENSSL_CRYPTO + LIBPURPLE_LIBS += $(shell ${PKG_CONFIG} --libs openssl) endif STEAM_SOURCES = \ diff --git a/steam-mobile/steam_rsa.c b/steam-mobile/steam_rsa.c index c14196e..650baa9 100644 --- a/steam-mobile/steam_rsa.c +++ b/steam-mobile/steam_rsa.c @@ -9,7 +9,7 @@ password=&username=&emailauth=&captchagid= */ -#if defined USE_OPENSSL_CRYPTO && !(defined __APPLE__ || defined __FreeBSD__ || defined __OpenBSD__) +#if defined USE_OPENSSL_CRYPTO && !(defined __APPLE__ || defined __unix__) # undef USE_OPENSSL_CRYPTO #endif -- cgit v1.2.3 From 08cec38a7a509982e9affc917358033a976dfe16 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 12 Mar 2016 18:05:17 +0100 Subject: Respect system LDFLAGS --- steam-mobile/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/steam-mobile/Makefile b/steam-mobile/Makefile index 212e6f8..274fbf4 100644 --- a/steam-mobile/Makefile +++ b/steam-mobile/Makefile @@ -48,4 +48,4 @@ clean: rm -f libsteam.so libsteam.so: $(STEAM_SOURCES) - $(CC) -Wall -I. -fPIC $(CFLAGS) $(STEAM_SOURCES) -o $@ $(LIBPURPLE_CFLAGS) $(LIBPURPLE_LIBS) -shared + $(CC) -Wall -I. -fPIC $(CFLAGS) $(STEAM_SOURCES) -o $@ $(LDFLAGS) $(LIBPURPLE_CFLAGS) $(LIBPURPLE_LIBS) -shared -- cgit v1.2.3 From a2e9619c0d3e6866b137875b1fff3ec8ce590cd5 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 12 Mar 2016 18:29:45 +0100 Subject: Fix format security warning --- steam-mobile/steam_rsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/steam-mobile/steam_rsa.c b/steam-mobile/steam_rsa.c index 650baa9..03d757c 100644 --- a/steam-mobile/steam_rsa.c +++ b/steam-mobile/steam_rsa.c @@ -561,7 +561,7 @@ steam_encrypt_password(const gchar *modulus_str, const gchar *exponent_str, cons { unsigned long error_num = ERR_get_error(); char *error_str = ERR_error_string(error_num, NULL); - purple_debug_error("steam", error_str); + purple_debug_error("steam", "%s", error_str); RSA_free(rsa); g_free(encrypted); return NULL; -- cgit v1.2.3 From 97e09fbf9fbbe7bf7241ff2ede16ebb72ade9870 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 12 Mar 2016 18:45:25 +0100 Subject: Use object dependencies in Makefile --- steam-mobile/Makefile | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/steam-mobile/Makefile b/steam-mobile/Makefile index 274fbf4..ccf880d 100644 --- a/steam-mobile/Makefile +++ b/steam-mobile/Makefile @@ -31,10 +31,13 @@ endif STEAM_SOURCES = \ steam_connection.c \ - libsteam.c + libsteam.c + +STEAM_OBJS = $(patsubst %.c, %.o, $(STEAM_SOURCES)) + -.PHONY: all clean install all: libsteam.so + install: mkdir -m $(DIR_PERM) -p $(DESTDIR)$(PLUGIN_DIR_PURPLE) install -m $(FILE_PERM) libsteam.so $(DESTDIR)$(PLUGIN_DIR_PURPLE)/$(PRPL_NAME) @@ -44,8 +47,16 @@ install: install -m $(FILE_PERM) steam22.png $(DESTDIR)$(DATA_ROOT_DIR_PURPLE)/pixmaps/pidgin/protocols/22/steam.png mkdir -m $(DIR_PERM) -p $(DESTDIR)$(DATA_ROOT_DIR_PURPLE)/pixmaps/pidgin/protocols/48 install -m $(FILE_PERM) steam48.png $(DESTDIR)$(DATA_ROOT_DIR_PURPLE)/pixmaps/pidgin/protocols/48/steam.png + clean: - rm -f libsteam.so + rm -f libsteam.so *.o + +%.o: %.c + $(CC) -Wall -I. -fPIC $(LIBPURPLE_CFLAGS) $(CFLAGS) -c $*.c + +libsteam.so: $(STEAM_OBJS) + $(CC) -Wall -I. -fPIC $(LIBPURPLE_CFLAGS) $(CFLAGS) $(STEAM_OBJS) -o $@ $(LDFLAGS) $(LIBPURPLE_LIBS) -shared + + +.PHONY: all clean install -libsteam.so: $(STEAM_SOURCES) - $(CC) -Wall -I. -fPIC $(CFLAGS) $(STEAM_SOURCES) -o $@ $(LDFLAGS) $(LIBPURPLE_CFLAGS) $(LIBPURPLE_LIBS) -shared -- cgit v1.2.3