add a testing path for setting initiator credentials
[mech_eap.orig] / util_shib.h
index 91950de..92198b0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, JANET(UK)
+ * Copyright (c) 2011, JANET(UK)
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * SUCH DAMAGE.
  */
 
+/*
+ * Local attribute provider.
+ */
+
 #ifndef _UTIL_SHIB_H_
 #define _UTIL_SHIB_H_ 1
 
@@ -56,10 +60,10 @@ public:
                             const gss_cred_id_t cred,
                             const gss_ctx_id_t ctx);
 
-    void setAttribute(int complete,
+    bool setAttribute(int complete,
                       const gss_buffer_t attr,
                       const gss_buffer_t value);
-    void deleteAttribute(const gss_buffer_t value);
+    bool deleteAttribute(const gss_buffer_t value);
     bool getAttributeTypes(gss_eap_attr_enumeration_cb, void *data) const;
     bool getAttribute(const gss_buffer_t attr,
                       int *authenticated,
@@ -76,9 +80,10 @@ public:
     bool initFromBuffer(const gss_eap_attr_ctx *ctx,
                         const gss_buffer_t buffer);
 
+    static bool init(void);
+    static void finalize(void);
 
-    static bool init();
-    static void finalize();
+    OM_uint32 mapException(OM_uint32 *minor, std::exception &e) const;
 
     static gss_eap_attr_provider *createAttrContext(void);
 
@@ -88,14 +93,14 @@ private:
     static std::vector <shibsp::Attribute *>
         duplicateAttributes(const std::vector <shibsp::Attribute *>src);
 
-    int getAttributeIndex(const gss_buffer_t attr) const;
+    ssize_t getAttributeIndex(const gss_buffer_t attr) const;
     const shibsp::Attribute *getAttribute(const gss_buffer_t attr) const;
 
     std::vector<shibsp::Attribute *> getAttributes(void) const {
         return m_attributes;
     }
 
-    bool authenticated() const { return m_authenticated; }
+    bool authenticated(void) const { return m_authenticated; }
 
     friend bool
     addRadiusAttribute(const gss_eap_attr_provider *source,