From 81a628202d2ea0da9f6466a6edb48cdd3a6757b4 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 1 May 2018 10:51:46 +0200 Subject: [PATCH] add a pem-public-key runtime flag We want to deprecate support for loading PEM formatted key from ds:KeyValue nodes, before final removal it will have to be activated through a runtime flag (using LASSO_FLAG environment variable). --- lasso/debug.h | 1 + lasso/lasso.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/lasso/debug.h b/lasso/debug.h index 4f3643d5..2de48b63 100644 --- a/lasso/debug.h +++ b/lasso/debug.h @@ -37,6 +37,7 @@ LASSO_EXPORT extern gboolean lasso_flag_strict_checking; LASSO_EXPORT extern gboolean lasso_flag_add_signature; LASSO_EXPORT extern gboolean lasso_flag_sign_messages; LASSO_EXPORT extern gboolean lasso_flag_thin_sessions; +LASSO_EXPORT extern gboolean lasso_flag_pem_public_key; #ifdef __cplusplus } diff --git a/lasso/lasso.c b/lasso/lasso.c index ca3be951..08748599 100644 --- a/lasso/lasso.c +++ b/lasso/lasso.c @@ -61,6 +61,10 @@ * no-sign-messages * Disable signatures on messages. * + * + * pem-public-key + * Allow PEM key in ds:KeyValue nodes, it's outside the XMLSig specification. + * * * * @@ -97,6 +101,8 @@ static void lasso_flag_parse_environment_variable(); gboolean lasso_flag_sign_messages = TRUE; /* thin sessions */ gboolean lasso_flag_thin_sessions = FALSE; +/* PEM public key */ +gboolean lasso_flag_pem_public_key = FALSE; #ifndef LASSO_FLAG_ENV_VAR #define LASSO_FLAG_ENV_VAR "LASSO_FLAG" @@ -329,6 +335,9 @@ void lasso_set_flag(char *flag) { if (lasso_strisequal(flag,"thin-sessions")) { lasso_flag_thin_sessions = value; } + if (lasso_strisequal(flag,"pem-public-key")) { + lasso_flag_pem_public_key = value; + } } while (FALSE); }