projects
/
shibboleth
/
cpp-xmltooling.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
https://issues.shibboleth.net/jira/browse/CPPXT-53
[shibboleth/cpp-xmltooling.git]
/
xmltooling
/
security
/
impl
/
SecurityHelper.cpp
diff --git
a/xmltooling/security/impl/SecurityHelper.cpp
b/xmltooling/security/impl/SecurityHelper.cpp
index
c61d233
..
de4c422
100644
(file)
--- a/
xmltooling/security/impl/SecurityHelper.cpp
+++ b/
xmltooling/security/impl/SecurityHelper.cpp
@@
-22,9
+22,11
@@
#include "internal.h"
#include "logging.h"
#include "internal.h"
#include "logging.h"
+#include "io/HTTPResponse.h"
#include "security/OpenSSLCryptoX509CRL.h"
#include "security/SecurityHelper.h"
#include "security/X509Credential.h"
#include "security/OpenSSLCryptoX509CRL.h"
#include "security/SecurityHelper.h"
#include "security/X509Credential.h"
+#include "soap/HTTPSOAPTransport.h"
#include "util/NDC.h"
#include <fstream>
#include "util/NDC.h"
#include <fstream>
@@
-397,6
+399,10
@@
XSECCryptoKey* SecurityHelper::loadKeyFromURL(SOAPTransport& transport, const ch
transport.send();
istream& msg = transport.receive();
transport.send();
istream& msg = transport.receive();
+ // Check for "not modified" status.
+ if (dynamic_cast<HTTPSOAPTransport*>(&transport) && transport.getStatusCode() == HTTPResponse::XMLTOOLING_HTTP_STATUS_NOTMODIFIED)
+ throw (long)HTTPResponse::XMLTOOLING_HTTP_STATUS_NOTMODIFIED;
+
// Dump to output file.
ofstream out(backing, fstream::trunc|fstream::binary);
out << msg.rdbuf();
// Dump to output file.
ofstream out(backing, fstream::trunc|fstream::binary);
out << msg.rdbuf();
@@
-412,6
+418,10
@@
vector<XSECCryptoX509*>::size_type SecurityHelper::loadCertificatesFromURL(
transport.send();
istream& msg = transport.receive();
transport.send();
istream& msg = transport.receive();
+ // Check for "not modified" status.
+ if (dynamic_cast<HTTPSOAPTransport*>(&transport) && transport.getStatusCode() == HTTPResponse::XMLTOOLING_HTTP_STATUS_NOTMODIFIED)
+ throw (long)HTTPResponse::XMLTOOLING_HTTP_STATUS_NOTMODIFIED;
+
// Dump to output file.
ofstream out(backing, fstream::trunc|fstream::binary);
out << msg.rdbuf();
// Dump to output file.
ofstream out(backing, fstream::trunc|fstream::binary);
out << msg.rdbuf();
@@
-428,6
+438,10
@@
vector<XSECCryptoX509CRL*>::size_type SecurityHelper::loadCRLsFromURL(
transport.send();
istream& msg = transport.receive();
transport.send();
istream& msg = transport.receive();
+ // Check for "not modified" status.
+ if (dynamic_cast<HTTPSOAPTransport*>(&transport) && transport.getStatusCode() == HTTPResponse::XMLTOOLING_HTTP_STATUS_NOTMODIFIED)
+ throw (long)HTTPResponse::XMLTOOLING_HTTP_STATUS_NOTMODIFIED;
+
// Dump to output file.
ofstream out(backing, fstream::trunc|fstream::binary);
out << msg.rdbuf();
// Dump to output file.
ofstream out(backing, fstream::trunc|fstream::binary);
out << msg.rdbuf();