From f88fcaf732b948f6d3d2871f4699f5ce1bbbcb14 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Mon, 16 May 2011 01:16:41 +0200 Subject: [PATCH] allow binary resolved attributes --- moonshot/mech_eap/util_shib.cpp | 17 ++++++++++++++++- shibboleth/sp | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/moonshot/mech_eap/util_shib.cpp b/moonshot/mech_eap/util_shib.cpp index 418cb77..a83a7ea 100644 --- a/moonshot/mech_eap/util_shib.cpp +++ b/moonshot/mech_eap/util_shib.cpp @@ -304,7 +304,22 @@ gss_eap_shib_attr_provider::getAttribute(const gss_buffer_t attr, buf.value = (void *)shibAttr->getSerializedValues()[*more].c_str(); buf.length = strlen((char *)buf.value); - if (buf.length != 0) { + if (base64Valid((char *)buf.value)) { + ssize_t octetLen; + + value->value = GSSEAP_MALLOC(buf.length); + if (value->value == NULL) + throw std::bad_alloc(); + + octetLen = base64Decode((char *)buf.value, value->value); + if (octetLen < 0) { + GSSEAP_FREE(value->value); + value->value = NULL; + return false; + } + + value->length = octetLen; + } else if (buf.length != 0) { if (value != NULL) duplicateBuffer(buf, value); diff --git a/shibboleth/sp b/shibboleth/sp index 28fcbaa..bdbac80 160000 --- a/shibboleth/sp +++ b/shibboleth/sp @@ -1 +1 @@ -Subproject commit 28fcbaa4e8c5090550a3e0ceaf0ea6a1355b890b +Subproject commit bdbac801c636a747fdb3c0a39a564f3f77452cf3 -- 2.1.4