Skip to content

Commit 93ccbff

Browse files
committed
Make non-standard SCRAM SHA algos opt-in
1 parent 817ec7c commit 93ccbff

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ if get_option('debug')
109109
defines += 'ENABLE_DEBUG'
110110
endif
111111

112+
if get_option('nonstandard-scram')
113+
defines += 'WOCKY_SCRAM_NONSTANDARD'
114+
endif
115+
112116
if get_option('google-relay')
113117
defines += 'ENABLE_GOOGLE_RELAY'
114118
endif

meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ option('code-style-check', type: 'boolean', description: 'enable coding style ch
44
option('install-headers', type: 'string', description: 'install development headers here')
55
option('libdir-suffix', type: 'string', description: 'install a shared library into project-specific subdir')
66
option('google-relay', type: 'boolean', value: false, description: 'enable google jingle relay support', yield: true)
7+
option('nonstandard-scram', type: 'boolean', value: false, description: 'enable non-standard scram methods', yield: true)

wocky/wocky-auth-registry.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,10 @@ wocky_auth_registry_select_handler (WockyAuthRegistry *self,
309309
gboolean is_plus;
310310
GChecksumType algo;
311311
} scram_handlers[] = {
312+
#ifdef WOCKY_AUTH_MECH_SASL_SCRAM_SHA_512
312313
{ WOCKY_AUTH_MECH_SASL_SCRAM_SHA_512_PLUS, TRUE, G_CHECKSUM_SHA512 },
313314
{ WOCKY_AUTH_MECH_SASL_SCRAM_SHA_512, FALSE, G_CHECKSUM_SHA512 },
315+
#endif
314316
#ifdef WOCKY_AUTH_MECH_SASL_SCRAM_SHA_384
315317
{ WOCKY_AUTH_MECH_SASL_SCRAM_SHA_384_PLUS, TRUE, G_CHECKSUM_SHA384 },
316318
{ WOCKY_AUTH_MECH_SASL_SCRAM_SHA_384, FALSE, G_CHECKSUM_SHA384 },

wocky/wocky-auth-registry.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ typedef enum
6262
#define WOCKY_AUTH_MECH_SASL_SCRAM_SHA_1_PLUS "SCRAM-SHA-1-PLUS"
6363
#define WOCKY_AUTH_MECH_SASL_SCRAM_SHA_256 "SCRAM-SHA-256"
6464
#define WOCKY_AUTH_MECH_SASL_SCRAM_SHA_256_PLUS "SCRAM-SHA-256-PLUS"
65+
#ifdef WOCKY_SCRAM_NONSTANDARD
6566
#define WOCKY_AUTH_MECH_SASL_SCRAM_SHA_512 "SCRAM-SHA-512"
6667
#define WOCKY_AUTH_MECH_SASL_SCRAM_SHA_512_PLUS "SCRAM-SHA-512-PLUS"
6768
#if GLIB_VERSION_CUR_STABLE >= GLIB_VERSION_2_52
6869
#define WOCKY_AUTH_MECH_SASL_SCRAM_SHA_384 "SCRAM-SHA-384"
6970
#define WOCKY_AUTH_MECH_SASL_SCRAM_SHA_384_PLUS "SCRAM-SHA-384-PLUS"
7071
#endif
72+
#endif
7173

7274
/**
7375
* WockyTLSBindingType

0 commit comments

Comments
 (0)