projects
/
mech_eap.orig
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e3842cc
)
allow binary resolved attributes
author
Luke Howard
<lukeh@padl.com>
Sun, 15 May 2011 23:16:41 +0000
(
01:16
+0200)
committer
Luke Howard
<lukeh@padl.com>
Sun, 15 May 2011 23:16:41 +0000
(
01:16
+0200)
mech_eap/util_shib.cpp
patch
|
blob
|
history
diff --git
a/mech_eap/util_shib.cpp
b/mech_eap/util_shib.cpp
index
418cb77
..
a83a7ea
100644
(file)
--- a/
mech_eap/util_shib.cpp
+++ b/
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);
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);
if (value != NULL)
duplicateBuffer(buf, value);