SHLIB_DIRS=-L$(TOPLIBD)
SHLIB_RDIRS=$(KRB5_LIBDIR)
STOBJLISTS=OBJS.ST
-STLIBOBJS= saml_authdata.o ../saml_server/saml_util.o
+STLIBOBJS= saml_authdata.o ../saml_server/saml_util.o ../saml_server/saml_trust.o
-SRCS= saml_authdata.cpp ../saml_server/saml_util.cpp
+SRCS= saml_authdata.cpp ../saml_server/saml_util.cpp ../saml_server/saml_trust.cpp
all-unix:: all-liblinks
install-unix:: install-libs
SHLIB_DIRS=-L$(TOPLIBD)
SHLIB_RDIRS=$(KRB5_LIBDIR)
STOBJLISTS=OBJS.ST
-STLIBOBJS= saml_kdc.o saml_ldap.o saml_util.o
-SRCS=saml_kdc.cpp saml_ldap.cpp saml_util.cpp
+STLIBOBJS= saml_kdc.o saml_ldap.o saml_util.o saml_trust.o
+SRCS=saml_kdc.cpp saml_ldap.cpp saml_util.cpp saml_trust.cpp
all-unix:: all-liblinks
install-unix:: install-libs
# XXX for now
CC=$(CXX)
-CXXFLAGS=-g
+CXXFLAGS=-g -DGCC_HASCLASSVISIBILITY=1 -fvisibility=default
#define SAML_KRB_USAGE_SESSION_KEY 1 /* derive from session key */
#define SAML_KRB_USAGE_SERVER_KEY 2 /* derive from server key */
+/* saml_util.cpp */
+
krb5_error_code
saml_krb_derive_key(krb5_context context,
const krb5_keyblock *basekey,
XMLCh *m_buf;
};
+/* saml_trust.cpp */
+
+krb5_error_code
+saml_krb_verify_trustengine(krb5_context context,
+ Signature *signature,
+ const krb5_keyblock *key,
+ krb5_const_principal server,
+ unsigned int flags,
+ krb5_boolean bound,
+ krb5_boolean *pValid);
+
#endif /* SAML_KRB_H_ */
saml_krb_verify_signature(krb5_context context,
Signature *signature,
const krb5_keyblock *key,
+ krb5_const_principal server,
unsigned int flags,
krb5_boolean bound,
krb5_boolean *pValid)
* Note the verification policy may differ depending on whether
* we also trust this signer to bind the name.
*/
+ code = saml_krb_verify_trustengine(context, signature, key,
+ server, flags, bound, pValid);
}
} catch (exception &e) {
code = KRB5_CRYPTO_INTERNAL;
if (signature == NULL)
return 0;
+ /*
+ * Verify any signatures present on the assertion.
+ */
+ if ((flags & SAML_KRB_VERIFY_KDC_VOUCHED) == 0) {
+ code = saml_krb_verify_signature(context, signature, key, server,
+ flags, bound, &verified);
+ if (code != 0 || verified == FALSE)
+ return KRB5KRB_AP_ERR_MODIFIED;
+ }
+
if (saml_krb_get_authtime(context, assertion) < authtime)
return KRB5KDC_ERR_CLIENT_NOTYET;
else if (verified == FALSE)
return KRB5KDC_ERR_CLIENT_NOT_TRUSTED;
- /*
- * Verify any signatures present on the assertion.
- */
- if ((flags & SAML_KRB_VERIFY_KDC_VOUCHED) != 0) {
- code = saml_krb_verify_signature(context, signature, key,
- flags, bound, &verified);
- if (code != 0 || verified == FALSE)
- return KRB5KRB_AP_ERR_MODIFIED;
- }
-
- /*
+ /*
* Verify that the Recipient in any bearer SubjectConfirmationData
* matches the service principal.
*/