summaryrefslogtreecommitdiffstats
path: root/lasso/Attic/protocols/elements
diff options
context:
space:
mode:
authorValery Febvre <vfebvre at easter-eggs.com>2004-04-27 23:45:04 +0000
committerValery Febvre <vfebvre at easter-eggs.com>2004-04-27 23:45:04 +0000
commit2918460bf597b3ea14bc4e09d5e71cdd271b62f5 (patch)
tree44b3bddd74926d0413b70d836042f7c17ec2b38c /lasso/Attic/protocols/elements
parentd961d62221220e82732e2fc5c9cff4ab718ac4de (diff)
downloadlasso-2918460bf597b3ea14bc4e09d5e71cdd271b62f5.tar.gz
lasso-2918460bf597b3ea14bc4e09d5e71cdd271b62f5.tar.xz
lasso-2918460bf597b3ea14bc4e09d5e71cdd271b62f5.zip
Initial commit
Diffstat (limited to 'lasso/Attic/protocols/elements')
-rw-r--r--lasso/Attic/protocols/elements/.cvsignore6
-rw-r--r--lasso/Attic/protocols/elements/Makefile.am21
-rw-r--r--lasso/Attic/protocols/elements/assertion.c97
-rw-r--r--lasso/Attic/protocols/elements/assertion.h63
-rw-r--r--lasso/Attic/protocols/elements/authentication_statement.c126
-rw-r--r--lasso/Attic/protocols/elements/authentication_statement.h71
6 files changed, 384 insertions, 0 deletions
diff --git a/lasso/Attic/protocols/elements/.cvsignore b/lasso/Attic/protocols/elements/.cvsignore
new file mode 100644
index 00000000..c97e85d7
--- /dev/null
+++ b/lasso/Attic/protocols/elements/.cvsignore
@@ -0,0 +1,6 @@
+Makefile
+Makefile.in
+*.lo
+*.la
+.libs
+.deps
diff --git a/lasso/Attic/protocols/elements/Makefile.am b/lasso/Attic/protocols/elements/Makefile.am
new file mode 100644
index 00000000..b285a2ed
--- /dev/null
+++ b/lasso/Attic/protocols/elements/Makefile.am
@@ -0,0 +1,21 @@
+liblassoincludedir = $(includedir)/lasso/protocols/elements
+
+INCLUDES = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/lasso \
+ $(LASSO_DEFINES) \
+ $(GLIB_CFLAGS) \
+ $(LIBXSLT_CFLAGS) \
+ $(LIBXML_CFLAGS) \
+ $(XMLSEC1_CFLAGS) \
+ -DG_LOG_DOMAIN=\"lasso\"
+
+noinst_LTLIBRARIES = liblasso-elements.la
+
+liblasso_elements_la_SOURCES = \
+ assertion.c \
+ authentication_statement.c
+
+liblassoinclude_HEADERS = \
+ assertion.h \
+ authentication_statement.h
diff --git a/lasso/Attic/protocols/elements/assertion.c b/lasso/Attic/protocols/elements/assertion.c
new file mode 100644
index 00000000..d4f25733
--- /dev/null
+++ b/lasso/Attic/protocols/elements/assertion.c
@@ -0,0 +1,97 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Valery Febvre <vfebvre@easter-eggs.com>
+ * Nicolas Clapies <nclapies@entrouvert.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <lasso/protocols/elements/assertion.h>
+
+/*****************************************************************************/
+/* public methods */
+/*****************************************************************************/
+
+/*****************************************************************************/
+/* instance and class init functions */
+/*****************************************************************************/
+
+static void
+lasso_assertion_instance_init(LassoAssertion *assertion)
+{
+}
+
+static void
+lasso_assertion_class_init(LassoAssertionClass *class)
+{
+}
+
+GType lasso_assertion_get_type() {
+ static GType this_type = 0;
+
+ if (!this_type) {
+ static const GTypeInfo this_info = {
+ sizeof (LassoAssertionClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) lasso_assertion_class_init,
+ NULL,
+ NULL,
+ sizeof(LassoAssertion),
+ 0,
+ (GInstanceInitFunc) lasso_assertion_instance_init,
+ };
+
+ this_type = g_type_register_static(LASSO_TYPE_LIB_ASSERTION,
+ "LassoAssertion",
+ &this_info, 0);
+ }
+ return this_type;
+}
+
+LassoNode*
+lasso_assertion_new(const xmlChar *issuer,
+ xmlChar *requestID)
+{
+ LassoNode *assertion;
+
+ g_return_val_if_fail(issuer != NULL, NULL);
+
+ assertion = LASSO_NODE(g_object_new(LASSO_TYPE_ASSERTION, NULL));
+
+ lasso_saml_assertion_set_assertionID(LASSO_SAML_ASSERTION(assertion),
+ (const xmlChar *)lasso_build_unique_id(32));
+ lasso_saml_assertion_set_majorVersion(LASSO_SAML_ASSERTION(assertion),
+ lassoLibMajorVersion);
+ lasso_saml_assertion_set_minorVersion(LASSO_SAML_ASSERTION(assertion),
+ lassoLibMajorVersion);
+ lasso_saml_assertion_set_issueInstance(LASSO_SAML_ASSERTION(assertion),
+ lasso_get_current_time());
+
+ lasso_saml_assertion_set_issuer(LASSO_SAML_ASSERTION(assertion), issuer);
+
+ /* InResponseTo */
+ if (requestID != NULL) {
+ lasso_lib_assertion_set_inResponseTo(LASSO_LIB_ASSERTION(assertion),
+ requestID);
+ }
+
+ return (assertion);
+}
diff --git a/lasso/Attic/protocols/elements/assertion.h b/lasso/Attic/protocols/elements/assertion.h
new file mode 100644
index 00000000..a12bef1e
--- /dev/null
+++ b/lasso/Attic/protocols/elements/assertion.h
@@ -0,0 +1,63 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Valery Febvre <vfebvre@easter-eggs.com>
+ * Nicolas Clapies <nclapies@entrouvert.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LASSO_ASSERTION_H__
+#define __LASSO_ASSERTION_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <lasso/xml/lib_assertion.h>
+
+#define LASSO_TYPE_ASSERTION (lasso_assertion_get_type())
+#define LASSO_ASSERTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_ASSERTION, LassoAssertion))
+#define LASSO_ASSERTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_ASSERTION, LassoAssertionClass))
+#define LASSO_IS_ASSERTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_ASSERTION))
+#define LASSP_IS_ASSERTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_ASSERTION))
+#define LASSO_ASSERTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_ASSERTION, LassoAssertionClass))
+
+typedef struct _LassoAssertion LassoAssertion;
+typedef struct _LassoAssertionClass LassoAssertionClass;
+
+struct _LassoAssertion {
+ LassoLibAssertion parent;
+ /*< public >*/
+ /*< private >*/
+};
+
+struct _LassoAssertionClass {
+ LassoLibAssertionClass parent;
+};
+
+LASSO_EXPORT GType lasso_assertion_get_type (void);
+LASSO_EXPORT LassoNode* lasso_assertion_new (const xmlChar *issuer,
+ xmlChar *requestID);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __LASSO_ASSERTION_H__ */
diff --git a/lasso/Attic/protocols/elements/authentication_statement.c b/lasso/Attic/protocols/elements/authentication_statement.c
new file mode 100644
index 00000000..c2f8d49c
--- /dev/null
+++ b/lasso/Attic/protocols/elements/authentication_statement.c
@@ -0,0 +1,126 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Valery Febvre <vfebvre@easter-eggs.com>
+ * Nicolas Clapies <nclapies@entrouvert.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <lasso/protocols/elements/authentication_statement.h>
+
+/*****************************************************************************/
+/* public methods */
+/*****************************************************************************/
+
+/*****************************************************************************/
+/* instance and class init functions */
+/*****************************************************************************/
+
+static void
+lasso_authentication_statement_instance_init(LassoAuthenticationStatement *authentication_statement)
+{
+}
+
+static void
+lasso_authentication_statement_class_init(LassoAuthenticationStatementClass *class)
+{
+}
+
+GType lasso_authentication_statement_get_type() {
+ static GType this_type = 0;
+
+ if (!this_type) {
+ static const GTypeInfo this_info = {
+ sizeof (LassoAuthenticationStatementClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) lasso_authentication_statement_class_init,
+ NULL,
+ NULL,
+ sizeof(LassoAuthenticationStatement),
+ 0,
+ (GInstanceInitFunc) lasso_authentication_statement_instance_init,
+ };
+
+ this_type = g_type_register_static(LASSO_TYPE_LIB_AUTHENTICATION_STATEMENT,
+ "LassoAuthenticationStatement",
+ &this_info, 0);
+ }
+ return this_type;
+}
+
+LassoNode*
+lasso_authentication_statement_new(const xmlChar *authenticationMethod,
+ const xmlChar *sessionIndex,
+ const xmlChar *reauthenticateOnOrAfter,
+ xmlChar *nameIdentifier,
+ const xmlChar *nameQualifier,
+ const xmlChar *format,
+ xmlChar *idp_nameIdentifier,
+ const xmlChar *idp_nameQualifier,
+ const xmlChar *idp_format,
+ const xmlChar *confirmationMethod)
+{
+ LassoNode *statement;
+ LassoNode *subject, *identifier, *idp_identifier, *subject_confirmation;
+
+ statement = LASSO_NODE(g_object_new(LASSO_TYPE_AUTHENTICATION_STATEMENT, NULL));
+
+ lasso_saml_authentication_statement_set_authenticationMethod(LASSO_SAML_AUTHENTICATION_STATEMENT(statement),
+ authenticationMethod);
+ lasso_saml_authentication_statement_set_authenticationInstant(LASSO_SAML_AUTHENTICATION_STATEMENT(statement),
+ lasso_get_current_time());
+ if (sessionIndex != NULL) {
+ lasso_lib_authentication_statement_set_sessionIndex(LASSO_LIB_AUTHENTICATION_STATEMENT(statement),
+ sessionIndex);
+ }
+ lasso_lib_authentication_statement_set_reauthenticateOnOrAfter(LASSO_LIB_AUTHENTICATION_STATEMENT(statement),
+ reauthenticateOnOrAfter);
+
+ subject = lasso_lib_subject_new();
+ identifier = lasso_saml_name_identifier_new(nameIdentifier);
+ lasso_saml_name_identifier_set_nameQualifier(LASSO_SAML_NAME_IDENTIFIER(identifier),
+ nameQualifier);
+ lasso_saml_name_identifier_set_format(LASSO_SAML_NAME_IDENTIFIER(identifier),
+ format);
+ lasso_saml_subject_set_nameIdentifier(LASSO_SAML_SUBJECT(subject),
+ LASSO_SAML_NAME_IDENTIFIER(identifier));
+ idp_identifier = lasso_lib_idp_provided_name_identifier_new(idp_nameIdentifier);
+ lasso_saml_name_identifier_set_nameQualifier(LASSO_SAML_NAME_IDENTIFIER(idp_identifier),
+ idp_nameQualifier);
+ lasso_saml_name_identifier_set_format(LASSO_SAML_NAME_IDENTIFIER(idp_identifier),
+ idp_format);
+ lasso_saml_subject_set_nameIdentifier(LASSO_SAML_SUBJECT(subject),
+ LASSO_SAML_NAME_IDENTIFIER(idp_identifier));
+ lasso_lib_subject_set_idpProvidedNameIdentifier(LASSO_LIB_SUBJECT(subject),
+ LASSO_LIB_IDP_PROVIDED_NAME_IDENTIFIER(idp_identifier));
+ subject_confirmation = lasso_saml_subject_confirmation_new();
+ lasso_saml_subject_confirmation_set_subjectConfirmationMethod(LASSO_SAML_SUBJECT_CONFIRMATION(subject_confirmation),
+ confirmationMethod);
+ lasso_saml_subject_set_subjectConfirmation(LASSO_SAML_SUBJECT(subject),
+ LASSO_SAML_SUBJECT_CONFIRMATION(subject_confirmation));
+
+ if (confirmationMethod != NULL) {
+ lasso_saml_subject_statement_abstract_set_subject(LASSO_SAML_SUBJECT_STATEMENT_ABSTRACT(statement),
+ LASSO_SAML_SUBJECT(subject));
+ }
+
+ return (statement);
+}
diff --git a/lasso/Attic/protocols/elements/authentication_statement.h b/lasso/Attic/protocols/elements/authentication_statement.h
new file mode 100644
index 00000000..d1360541
--- /dev/null
+++ b/lasso/Attic/protocols/elements/authentication_statement.h
@@ -0,0 +1,71 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Valery Febvre <vfebvre@easter-eggs.com>
+ * Nicolas Clapies <nclapies@entrouvert.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LASSO_AUTHENTICATION_STATEMENT_H__
+#define __LASSO_AUTHENTICATION_STATEMENT_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <lasso/xml/lib_authentication_statement.h>
+
+#define LASSO_TYPE_AUTHENTICATION_STATEMENT (lasso_authentication_statement_get_type())
+#define LASSO_AUTHENTICATION_STATEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_AUTHENTICATION_STATEMENT, LassoAuthenticationStatement))
+#define LASSO_AUTHENTICATION_STATEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_AUTHENTICATION_STATEMENT, LassoAuthenticationStatementClass))
+#define LASSO_IS_AUTHENTICATION_STATEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_AUTHENTICATION_STATEMENT))
+#define LASSP_IS_AUTHENTICATION_STATEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_AUTHENTICATION_STATEMENT))
+#define LASSO_AUTHENTICATION_STATEMENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_AUTHENTICATION_STATEMENT, LassoAuthenticationStatementClass))
+
+typedef struct _LassoAuthenticationStatement LassoAuthenticationStatement;
+typedef struct _LassoAuthenticationStatementClass LassoAuthenticationStatementClass;
+
+struct _LassoAuthenticationStatement {
+ LassoLibAuthenticationStatement parent;
+ /*< public >*/
+ /*< private >*/
+};
+
+struct _LassoAuthenticationStatementClass {
+ LassoLibAuthenticationStatementClass parent;
+};
+
+LASSO_EXPORT GType lasso_authentication_statement_get_type (void);
+LASSO_EXPORT LassoNode* lasso_authentication_statement_new (const xmlChar *authenticationMethod,
+ const xmlChar *sessionIndex,
+ const xmlChar *reauthenticateOnOrAfter,
+ xmlChar *nameIdentifier,
+ const xmlChar *nameQualifier,
+ const xmlChar *format,
+ xmlChar *idp_nameIdentifier,
+ const xmlChar *idp_nameQualifier,
+ const xmlChar *idp_format,
+ const xmlChar *confirmationMethod);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __LASSO_AUTHENTICATION_STATEMENT_H__ */