remove util_alloc.c
[mech_eap.orig] / util_saml.h
index 730ebd4..7a750a0 100644 (file)
@@ -33,6 +33,8 @@
 #ifndef _UTIL_SAML_H_
 #define _UTIL_SAML_H_ 1
 
+#ifdef __cplusplus
+
 namespace opensaml {
     namespace saml2 {
         class Attribute;
@@ -43,7 +45,7 @@ namespace opensaml {
 
 struct gss_eap_saml_assertion_provider : gss_eap_attr_provider {
 public:
-    gss_eap_saml_assertion_provider(void) {}
+    gss_eap_saml_assertion_provider(void);
     ~gss_eap_saml_assertion_provider(void);
 
     bool initFromExistingContext(const gss_eap_attr_ctx *source,
@@ -72,14 +74,17 @@ public:
     bool initFromBuffer(const gss_eap_attr_ctx *ctx,
                         const gss_buffer_t buffer);
 
-    void setAssertion(const opensaml::saml2::Assertion *assertion);
-
     const opensaml::saml2::Assertion *getAssertion(void) const {
         return m_assertion;
     }
+    bool authenticated(void) const {
+        return m_authenticated;
+    }
 
-    static bool init();
-    static void finalize();
+    time_t getExpiryTime(void) const;
+
+    static bool init(void);
+    static void finalize(void);
 
     static gss_eap_attr_provider *createAttrContext(void);
 
@@ -87,13 +92,19 @@ private:
     static opensaml::saml2::Assertion *
         parseAssertion(const gss_buffer_t buffer);
 
+    void setAssertion(const opensaml::saml2::Assertion *assertion,
+                      bool authenticated = false);
+    void setAssertion(const gss_buffer_t buffer,
+                      bool authenticated = false);
+
     opensaml::saml2::Assertion *m_assertion;
+    bool m_authenticated;
 };
 
 struct gss_eap_saml_attr_provider : gss_eap_attr_provider {
 public:
     gss_eap_saml_attr_provider(void) {}
-    ~gss_eap_saml_attr_provider(void);
+    ~gss_eap_saml_attr_provider(void) {}
 
     bool getAttributeTypes(gss_eap_attr_enumeration_cb, void *data) const;
     void setAttribute(int complete,
@@ -115,17 +126,29 @@ public:
     bool initFromBuffer(const gss_eap_attr_ctx *ctx,
                         const gss_buffer_t buffer);
 
-    const opensaml::saml2::Attribute *
-        getAttribute(const gss_buffer_t attr) const;
-
-    const opensaml::saml2::Assertion *getAssertion(void) const;
+    bool getAttribute(const gss_buffer_t attr,
+                      int *authenticated,
+                      int *complete,
+                      const opensaml::saml2::Attribute **pAttribute) const;
+    bool getAssertion(int *authenticated,
+                      const opensaml::saml2::Assertion **pAssertion) const;
 
-    static bool init();
-    static void finalize();
+    static bool init(void);
+    static void finalize(void);
 
     static gss_eap_attr_provider *createAttrContext(void);
 
 private:
 };
 
+extern "C" {
+#endif
+
+OM_uint32 gssEapSamlAttrProvidersInit(OM_uint32 *minor);
+OM_uint32 gssEapSamlAttrProvidersFinalize(OM_uint32 *minor);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _UTIL_SAML_H_ */