[shibboleth-sp2] 05/09: https://issues.shibboleth.net/jira/browse/SSPCPP-103
Ferenc Wágner
wferi-guest at moszumanska.debian.org
Tue Jan 26 21:30:20 UTC 2016
This is an automated email from the git hooks/post-receive script.
wferi-guest pushed a commit to annotated tag 1.3.5
in repository shibboleth-sp2.
commit 04d8ff4f265086fc6dc49ce814deefbc4f9a5fa9
Author: Scott Cantor <cantor.2 at osu.edu>
Date: Fri Oct 30 03:58:02 2009 +0000
https://issues.shibboleth.net/jira/browse/SSPCPP-103
---
adfs/listener.cpp | 10 +++++++---
shib-target/MemoryListener.cpp | 10 +++++++---
shib-target/shib-ccache.cpp | 11 ++++++++---
shib-target/shib-target.cpp | 2 +-
shib/Makefile.am | 2 +-
shib/ShibBrowserProfile.cpp | 16 +++++++++++-----
6 files changed, 35 insertions(+), 16 deletions(-)
diff --git a/adfs/listener.cpp b/adfs/listener.cpp
index 890ac27..5b6a0a1 100644
--- a/adfs/listener.cpp
+++ b/adfs/listener.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2005 Internet2
+ * Copyright 2001-2009 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -365,7 +365,11 @@ void ADFSListener::sessionNew(
}
auto_ptr_char oname(role->getEntityDescriptor()->getId());
- auto_ptr_char hname(bpr.authnStatement->getSubject()->getNameIdentifier()->getName());
+ auto_ptr_char hname(
+ bpr.authnStatement->getSubject()->getNameIdentifier() ?
+ bpr.authnStatement->getSubject()->getNameIdentifier()->getName() :
+ NULL
+ );
try {
// Create a new session key.
@@ -423,7 +427,7 @@ void ADFSListener::sessionNew(
") at (ClientAddress: " <<
ip <<
") with (NameIdentifier: " <<
- hname.get() <<
+ (hname.get() ? hname.get() : "none") <<
")";
//stc.releaseTransactionLog();
}
diff --git a/shib-target/MemoryListener.cpp b/shib-target/MemoryListener.cpp
index 79b8129..0bb6a33 100644
--- a/shib-target/MemoryListener.cpp
+++ b/shib-target/MemoryListener.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2005 Internet2
+ * Copyright 2001-2009 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -232,7 +232,11 @@ void MemoryListener::sessionNew(
}
auto_ptr_char oname(role->getEntityDescriptor()->getId());
- auto_ptr_char hname(bpr.authnStatement->getSubject()->getNameIdentifier()->getName());
+ auto_ptr_char hname(
+ bpr.authnStatement->getSubject()->getNameIdentifier() ?
+ bpr.authnStatement->getSubject()->getNameIdentifier()->getName()
+ : NULL
+ );
try {
// Create a new session key.
@@ -286,7 +290,7 @@ void MemoryListener::sessionNew(
") at (ClientAddress: " <<
ip <<
") with (NameIdentifier: " <<
- hname.get() <<
+ (hname.get() ? hname.get() : "none") <<
")";
stc.releaseTransactionLog();
diff --git a/shib-target/shib-ccache.cpp b/shib-target/shib-ccache.cpp
index af3ea0e..8184158 100644
--- a/shib-target/shib-ccache.cpp
+++ b/shib-target/shib-ccache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2005 Internet2
+ * Copyright 2001-2009 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -487,8 +487,8 @@ InternalCCacheEntry::InternalCCacheEntry(
m_cache->log->info("new session created with session ID (%s)", key);
if (m_cache->log->isDebugEnabled()) {
- auto_ptr_char h(s->getSubject()->getNameIdentifier()->getName());
- m_cache->log->debug("NameID (%s), IdP (%s), Address (%s)", h.get(), providerId, client_addr);
+ auto_ptr_char h(s->getSubject()->getNameIdentifier() ? s->getSubject()->getNameIdentifier()->getName() : NULL);
+ m_cache->log->debug("NameID (%s), IdP (%s), Address (%s)", (h.get() ? h.get() : "none"), providerId, client_addr);
}
}
@@ -646,6 +646,11 @@ pair<SAMLResponse*,SAMLResponse*> InternalCCacheEntry::getNewResponse()
m_lastRetry=now;
m_cache->log->debug("trying to get new attributes for session (ID=%s)", m_id.c_str());
+
+ if (!m_auth_statement->getSubject()->getNameIdentifier()) {
+ m_cache->log->info("no NameIdentifier available");
+ return pair<SAMLResponse*,SAMLResponse*>(NULL,NULL);
+ }
// Transaction Logging
STConfig& stc=static_cast<STConfig&>(ShibTargetConfig::getConfig());
diff --git a/shib-target/shib-target.cpp b/shib-target/shib-target.cpp
index b04f341..27920f3 100644
--- a/shib-target/shib-target.cpp
+++ b/shib-target/shib-target.cpp
@@ -610,7 +610,7 @@ pair<bool,void*> ShibTarget::doExportAssertions(bool requireSession)
Iterator<IAAP*> provs=m_priv->m_app->getAAPProviders();
// Export NameID?
- while (provs.hasNext()) {
+ while (provs.hasNext() && m_priv->m_cacheEntry->getAuthnStatement()->getSubject()->getNameIdentifier()) {
IAAP* aap=provs.next();
Locker locker(aap);
const XMLCh* format = m_priv->m_cacheEntry->getAuthnStatement()->getSubject()->getNameIdentifier()->getFormat();
diff --git a/shib/Makefile.am b/shib/Makefile.am
index bd2375f..9d8c4fb 100644
--- a/shib/Makefile.am
+++ b/shib/Makefile.am
@@ -22,7 +22,7 @@ libshib_la_SOURCES = \
# this is different from the project version
# http://sources.redhat.com/autobook/autobook/autobook_91.html
-libshib_la_LDFLAGS = -version-info 6:3:0
+libshib_la_LDFLAGS = -version-info 6:4:0
install-exec-hook:
for la in $(lib_LTLIBRARIES) ; do rm -f $(DESTDIR)$(libdir)/$$la ; done
diff --git a/shib/ShibBrowserProfile.cpp b/shib/ShibBrowserProfile.cpp
index 10f8467..b867129 100644
--- a/shib/ShibBrowserProfile.cpp
+++ b/shib/ShibBrowserProfile.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2005 Internet2
+ * Copyright 2001-2009 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,8 +18,6 @@
Scott Cantor
2/6/05
-
- $History:$
*/
#include "internal.h"
@@ -98,7 +96,11 @@ SAMLBrowserProfile::BrowserProfileResponse ShibBrowserProfile::receive(
// No metadata at all.
if (!provider) {
auto_ptr_char issuer(bpr.assertion->getIssuer());
- auto_ptr_char nq(bpr.authnStatement->getSubject()->getNameIdentifier()->getNameQualifier());
+ auto_ptr_char nq(
+ bpr.authnStatement->getSubject()->getNameIdentifier() ?
+ bpr.authnStatement->getSubject()->getNameIdentifier()->getNameQualifier()
+ : NULL
+ );
log.error("assertion issuer not found in metadata (Issuer='%s', NameQualifier='%s')",
issuer.get(), (nq.get() ? nq.get() : "none"));
@@ -160,7 +162,11 @@ SAMLBrowserProfile::BrowserProfileResponse ShibBrowserProfile::receive(
}
auto_ptr_char issuer(bpr.assertion->getIssuer());
- auto_ptr_char nq(bpr.authnStatement->getSubject()->getNameIdentifier()->getNameQualifier());
+ auto_ptr_char nq(
+ bpr.authnStatement->getSubject()->getNameIdentifier() ?
+ bpr.authnStatement->getSubject()->getNameIdentifier()->getNameQualifier()
+ : NULL
+ );
log.error("metadata for assertion issuer indicates no SAML 1.%d identity provider role (Issuer='%s', NameQualifier='%s'",
minorVersion, issuer.get(), (nq.get() ? nq.get() : "none"));
bpr.clear();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-shibboleth/shibboleth-sp2.git
More information about the Pkg-shibboleth-devel
mailing list