[gnome-keyring/trust-store] [gcr] Certificate chain has a 'status' not a 'type'



commit 299cde4da206cb3083cd3c68d77c94a7e1d17626
Author: Stef Walter <stefw collabora co uk>
Date:   Sat Dec 11 03:07:32 2010 +0000

    [gcr] Certificate chain has a 'status' not a 'type'
    
    This makes things clearer. Also add enum and flags types for
    certificate chain stuff.

 docs/reference/gcr/gcr-sections.txt |    4 +-
 gcr/gcr-certificate-chain.c         |  122 +++++++++++++++++++++++------------
 gcr/gcr-certificate-chain.h         |   27 ++++++--
 gcr/gcr-trust.c                     |    2 +-
 gcr/tests/test-certificate-chain.c  |   36 +++++-----
 5 files changed, 122 insertions(+), 69 deletions(-)
---
diff --git a/docs/reference/gcr/gcr-sections.txt b/docs/reference/gcr/gcr-sections.txt
index 8eeedf5..2947d0d 100644
--- a/docs/reference/gcr/gcr-sections.txt
+++ b/docs/reference/gcr/gcr-sections.txt
@@ -183,11 +183,11 @@ gcr_pkcs11_set_trust_store_uri
 <SECTION>
 <FILE>gcr-certificate-chain</FILE>
 GcrCertificateChain
-GcrCertificateChainType
+GcrCertificateChainStatus
 gcr_certificate_chain_new
 gcr_certificate_chain_add
 gcr_certificate_chain_get_certificate
-gcr_certificate_chain_get_chain_type
+gcr_certificate_chain_get_status
 gcr_certificate_chain_get_anchor
 gcr_certificate_chain_get_endpoint
 gcr_certificate_chain_get_length
diff --git a/gcr/gcr-certificate-chain.c b/gcr/gcr-certificate-chain.c
index 39a3e0c..d0b2d0d 100644
--- a/gcr/gcr-certificate-chain.c
+++ b/gcr/gcr-certificate-chain.c
@@ -58,20 +58,20 @@
  * found, then the chain is considered built. Any extra certificates are
  * removed from the chain.
  *
- * Once the certificate chain has been built, you can access its type
- * through gcr_certificate_chain_get_chain_type(). The type signifies whether
+ * Once the certificate chain has been built, you can access its status
+ * through gcr_certificate_chain_get_status(). The status signifies whether
  * the chain is anchored on a trust root, self-signed, incomplete etc. See
- * #GcrCertificateChainType for information on the various types.
+ * #GcrCertificateChainStatus for information on the various statuses.
  *
  * It's important to understand that the building of a certificate chain is
  * merely the first step towards verifying trust in a certificate.
  */
 
 /**
- * GcrCertificateChainType:
- * @GCR_CERTIFICATE_CHAIN_UNKNOWN: The certificate chain's type is unknown.
- * When a chain is not yet built it has this type. If a chain is modified after
- * being built, it has this type.
+ * GcrCertificateChainStatus:
+ * @GCR_CERTIFICATE_CHAIN_UNKNOWN: The certificate chain's status is unknown.
+ * When a chain is not yet built it has this status. If a chain is modified after
+ * being built, it has this status.
  * @GCR_CERTIFICATE_CHAIN_INCOMPLETE: A full chain could not be loaded. The
  * chain does not end with a self-signed certificate, a trusted anchor, or a
  * pinned certificate.
@@ -83,7 +83,7 @@
  * pinned certificate is an exception which trusts a given certificate
  * explicitly for a purpose and communication with a certain peer.
  *
- * The type of a built certificate chain. Will be set to
+ * The status of a built certificate chain. Will be set to
  * %GCR_CERTIFICATE_CHAIN_UNKNOWN for certificate chains that have not been
  * built.
  */
@@ -100,13 +100,13 @@
 
 enum {
 	PROP_0,
-	PROP_TYPE,
+	PROP_STATUS,
 	PROP_LENGTH,
 };
 
 struct _GcrCertificateChainPrivate {
 	GPtrArray *certificates;
-	GcrCertificateChainType type;
+	GcrCertificateChainStatus status;
 
 	/* Used in build operation */
 	gchar *purpose;
@@ -158,7 +158,7 @@ prep_chain_private (GcrCertificateChainPrivate *orig, const gchar *purpose,
 		g_ptr_array_add (pv->certificates, g_object_ref (certificate));
 	}
 
-	pv->type = orig->type;
+	pv->status = orig->status;
 	pv->purpose = g_strdup (purpose);
 	pv->peer = g_strdup (peer);
 	pv->flags = flags;
@@ -238,7 +238,7 @@ perform_build_chain (GcrCertificateChainPrivate *pv, GCancellable *cancellable,
 	g_assert (pv);
 	g_assert (pv->certificates);
 
-	pv->type = GCR_CERTIFICATE_CHAIN_UNKNOWN;
+	pv->status = GCR_CERTIFICATE_CHAIN_UNKNOWN;
 	lookups = !((pv->flags & GCR_CERTIFICATE_CHAIN_FLAG_NO_LOOKUPS) == GCR_CERTIFICATE_CHAIN_FLAG_NO_LOOKUPS);
 
 	/* This chain is built */
@@ -261,7 +261,7 @@ perform_build_chain (GcrCertificateChainPrivate *pv, GCancellable *cancellable,
 		 */
 		if (ret) {
 			g_ptr_array_set_size (pv->certificates, 1);
-			pv->type = GCR_CERTIFICATE_CHAIN_PINNED;
+			pv->status = GCR_CERTIFICATE_CHAIN_PINNED;
 			return TRUE;
 		}
 	}
@@ -269,11 +269,11 @@ perform_build_chain (GcrCertificateChainPrivate *pv, GCancellable *cancellable,
 	length = 1;
 
 	/* The first certificate is always unconditionally in the chain */
-	while (pv->type == GCR_CERTIFICATE_CHAIN_UNKNOWN) {
+	while (pv->status == GCR_CERTIFICATE_CHAIN_UNKNOWN) {
 
 		/* Stop the chain if previous was self-signed */
 		if (gcr_certificate_is_issuer (certificate, certificate)) {
-			pv->type = GCR_CERTIFICATE_CHAIN_SELFSIGNED;
+			pv->status = GCR_CERTIFICATE_CHAIN_SELFSIGNED;
 			break;
 		}
 
@@ -299,7 +299,7 @@ perform_build_chain (GcrCertificateChainPrivate *pv, GCancellable *cancellable,
 
 		/* Stop the chain if nothing found */
 		if (certificate == NULL) {
-			pv->type = GCR_CERTIFICATE_CHAIN_INCOMPLETE;
+			pv->status = GCR_CERTIFICATE_CHAIN_INCOMPLETE;
 			break;
 		}
 
@@ -316,7 +316,7 @@ perform_build_chain (GcrCertificateChainPrivate *pv, GCancellable *cancellable,
 
 			/* Stop the chain at the first anchor */
 			} else if (ret) {
-				pv->type = GCR_CERTIFICATE_CHAIN_ANCHORED;
+				pv->status = GCR_CERTIFICATE_CHAIN_ANCHORED;
 				break;
 			}
 		}
@@ -360,7 +360,7 @@ gcr_certificate_chain_dispose (GObject *obj)
 	GcrCertificateChain *self = GCR_CERTIFICATE_CHAIN (obj);
 
 	g_ptr_array_set_size (self->pv->certificates, 0);
-	self->pv->type = GCR_CERTIFICATE_CHAIN_UNKNOWN;
+	self->pv->status = GCR_CERTIFICATE_CHAIN_UNKNOWN;
 
 	G_OBJECT_CLASS (gcr_certificate_chain_parent_class)->dispose (obj);
 }
@@ -383,8 +383,8 @@ gcr_certificate_chain_get_property (GObject *obj, guint prop_id, GValue *value,
 	GcrCertificateChain *self = GCR_CERTIFICATE_CHAIN (obj);
 
 	switch (prop_id) {
-	case PROP_TYPE:
-		g_value_set_uint (value, gcr_certificate_chain_get_chain_type (self));
+	case PROP_STATUS:
+		g_value_set_enum (value, gcr_certificate_chain_get_status (self));
 		break;
 	case PROP_LENGTH:
 		g_value_set_uint (value, gcr_certificate_chain_get_length (self));
@@ -407,13 +407,13 @@ gcr_certificate_chain_class_init (GcrCertificateChainClass *klass)
 	gobject_class->get_property = gcr_certificate_chain_get_property;
 
 	/**
-	 * GcrCertificateChain:type:
+	 * GcrCertificateChain:status:
 	 *
-	 * The certificate chain type. See #GcrCertificateChainType
+	 * The certificate chain status. See #GcrCertificateChainStatus
 	 */
-	g_object_class_install_property (gobject_class, PROP_TYPE,
-	           g_param_spec_uint ("type", "Type", "Type of certificate chain",
-	                              0, _GCR_CERTIFICATE_CHAIN_TYPE_MAX,
+	g_object_class_install_property (gobject_class, PROP_STATUS,
+	           g_param_spec_enum ("status", "Status", "Status of certificate chain",
+	                              GCR_TYPE_CERTIFICATE_CHAIN_STATUS,
 	                              GCR_CERTIFICATE_CHAIN_UNKNOWN, G_PARAM_READABLE));
 
 	/**
@@ -433,6 +433,46 @@ gcr_certificate_chain_class_init (GcrCertificateChainClass *klass)
  * PUBLIC
  */
 
+GType
+gcr_certificate_chain_status_get_type (void)
+{
+	static volatile gsize initialized = 0;
+	static GType type = 0;
+	static const GEnumValue values[] = {
+		{ GCR_CERTIFICATE_CHAIN_UNKNOWN, "GCR_CERTIFICATE_CHAIN_UNKNOWN", "unknown" },
+		{ GCR_CERTIFICATE_CHAIN_INCOMPLETE, "GCR_CERTIFICATE_CHAIN_INCOMPLETE", "incomplete" },
+		{ GCR_CERTIFICATE_CHAIN_SELFSIGNED, "GCR_CERTIFICATE_CHAIN_SELFSIGNED", "self-signed" },
+		{ GCR_CERTIFICATE_CHAIN_PINNED, "GCR_CERTIFICATE_CHAIN_PINNED", "pinned" },
+		{ GCR_CERTIFICATE_CHAIN_ANCHORED, "GCR_CERTIFICATE_CHAIN_ANCHORED", "anchored" },
+		{ 0, NULL, NULL }
+	};
+
+	if (g_once_init_enter (&initialized)) {
+		type = g_enum_register_static ("GcrCertificateChainStatus", values);
+		g_once_init_leave (&initialized, 1);
+	}
+
+	return type;
+}
+
+GType
+gcr_certificate_chain_flags_get_type (void)
+{
+	static volatile gsize initialized = 0;
+	static GType type = 0;
+	static const GFlagsValue values[] = {
+		{ GCR_CERTIFICATE_CHAIN_FLAG_NO_LOOKUPS, "GCR_CERTIFICATE_CHAIN_FLAG_NO_LOOKUPS", "no-lookups" },
+		{ 0, NULL, NULL }
+	};
+
+	if (g_once_init_enter (&initialized)) {
+		type = g_flags_register_static ("GcrCertificateChainFlags", values);
+		g_once_init_leave (&initialized, 1);
+	}
+
+	return type;
+}
+
 /**
  * gcr_certificate_chain_new:
  *
@@ -466,36 +506,36 @@ gcr_certificate_chain_add (GcrCertificateChain *self, GcrCertificate *certificat
 	g_return_if_fail (GCR_IS_CERTIFICATE_CHAIN (self));
 	g_return_if_fail (GCR_IS_CERTIFICATE (certificate));
 	g_ptr_array_add (self->pv->certificates, g_object_ref (certificate));
-	self->pv->type = GCR_CERTIFICATE_CHAIN_UNKNOWN;
-	g_object_notify (G_OBJECT (self), "type");
+	self->pv->status = GCR_CERTIFICATE_CHAIN_UNKNOWN;
+	g_object_notify (G_OBJECT (self), "status");
 	g_object_notify (G_OBJECT (self), "length");
 }
 
 /**
- * gcr_certificate_chain_get_chain_type:
+ * gcr_certificate_chain_get_status:
  * @self: the #GcrCertificateChain
  *
- * Get the type of a certificate chain. If the certificate chain has not
- * been built, then the type will be %GCR_CERTIFICATE_CHAIN_UNKNOWN.
+ * Get the status of a certificate chain. If the certificate chain has not
+ * been built, then the status will be %GCR_CERTIFICATE_CHAIN_UNKNOWN.
  *
- * A type of %GCR_CERTIFICATE_CHAIN_ANCHORED does not mean that the
+ * A status of %GCR_CERTIFICATE_CHAIN_ANCHORED does not mean that the
  * certificate chain has been verified, but merely that an anchor has been
  * found.
  *
- * Returns: the type of the certificate chain.
+ * Returns: the status of the certificate chain.
  */
-GcrCertificateChainType
-gcr_certificate_chain_get_chain_type (GcrCertificateChain *self)
+GcrCertificateChainStatus
+gcr_certificate_chain_get_status (GcrCertificateChain *self)
 {
 	g_return_val_if_fail (GCR_IS_CERTIFICATE_CHAIN (self), GCR_CERTIFICATE_CHAIN_UNKNOWN);
-	return self->pv->type;
+	return self->pv->status;
 }
 
 /**
  * gcr_certificate_chain_get_anchor:
  * @self: the #GcrCertificateChain
  *
- * If the certificate chain has been built and is of type
+ * If the certificate chain has been built and is of status
  * %GCR_CERTIFICATE_CHAIN_ANCHORED, then this will return the anchor
  * certificate that was found. This is not necessarily a root certificate
  * authority. If an intermediate certificate authority in the chain was
@@ -510,7 +550,7 @@ GcrCertificate*
 gcr_certificate_chain_get_anchor (GcrCertificateChain *self)
 {
 	g_return_val_if_fail (GCR_IS_CERTIFICATE_CHAIN (self), NULL);
-	if (self->pv->type != GCR_CERTIFICATE_CHAIN_ANCHORED)
+	if (self->pv->status != GCR_CERTIFICATE_CHAIN_ANCHORED)
 		return NULL;
 	g_assert (self->pv->certificates->len > 0);
 	return GCR_CERTIFICATE (g_ptr_array_index (self->pv->certificates,
@@ -578,7 +618,7 @@ gcr_certificate_chain_get_certificate (GcrCertificateChain *self, guint index)
  * @error: a #GError or %NULL
  *
  * Complete a certificate chain. Once a certificate chain has been built
- * its type can be examined.
+ * its status can be examined.
  *
  * This operation will lookup missing certificates in PKCS\#11
  * modules and also that each certificate in the chain is the signer of the
@@ -627,7 +667,7 @@ gcr_certificate_chain_build (GcrCertificateChain *self, const gchar *purpose,
 	if (ret) {
 		free_chain_private (self->pv);
 		self->pv = cleanup_chain_private (pv);
-		g_object_notify (G_OBJECT (self), "type");
+		g_object_notify (G_OBJECT (self), "status");
 		g_object_notify (G_OBJECT (self), "length");
 	}
 
@@ -645,7 +685,7 @@ gcr_certificate_chain_build (GcrCertificateChain *self, const gchar *purpose,
  * @user_data: data to pass to the callback
  *
  * Complete a certificate chain. Once a certificate chain has been built
- * its type can be examined.
+ * its status can be examined.
  *
  * This will lookup missing certificates in PKCS\#11
  * modules and also that each certificate in the chain is the signer of the
@@ -729,7 +769,7 @@ gcr_certificate_chain_build_finish (GcrCertificateChain *self, GAsyncResult *res
 	free_chain_private (self->pv);
 	self->pv = cleanup_chain_private (pv);
 
-	g_object_notify (G_OBJECT (self), "type");
+	g_object_notify (G_OBJECT (self), "status");
 	g_object_notify (G_OBJECT (self), "length");
 	return TRUE;
 }
diff --git a/gcr/gcr-certificate-chain.h b/gcr/gcr-certificate-chain.h
index a1ed212..453b9a5 100644
--- a/gcr/gcr-certificate-chain.h
+++ b/gcr/gcr-certificate-chain.h
@@ -36,21 +36,34 @@
 
 G_BEGIN_DECLS
 
-typedef enum _GcrCertificateChainType {
+/*
+ * IMPORTANT: When adding a status, always update the
+ * gcr_certificate_chain_status_get_type() function
+ */
+typedef enum _GcrCertificateChainStatus {
 	GCR_CERTIFICATE_CHAIN_UNKNOWN,
 	GCR_CERTIFICATE_CHAIN_INCOMPLETE,
 	GCR_CERTIFICATE_CHAIN_SELFSIGNED,
-	GCR_CERTIFICATE_CHAIN_ANCHORED,
 	GCR_CERTIFICATE_CHAIN_PINNED,
+	GCR_CERTIFICATE_CHAIN_ANCHORED,
+} GcrCertificateChainStatus;
+
+#define GCR_TYPE_CERTIFICATE_CHAIN_STATUS        (gcr_certificate_chain_status_get_type())
 
-	/*< private >*/
-	_GCR_CERTIFICATE_CHAIN_TYPE_MAX
-} GcrCertificateChainType;
+GType                     gcr_certificate_chain_status_get_type       (void) G_GNUC_CONST;
 
+/*
+ * IMPORTANT: When adding a status, always update the
+ * gcr_certificate_chain_flags_get_type() function
+ */
 typedef enum _GcrCertificateChainFlags {
 	GCR_CERTIFICATE_CHAIN_FLAG_NO_LOOKUPS = 1 << 0,
 } GcrCertificateChainFlags;
 
+#define GCR_TYPE_CERTIFICATE_CHAIN_FLAGS         (gcr_certificate_chain_flags_get_type())
+
+GType                     gcr_certificate_chain_flags_get_type       (void) G_GNUC_CONST;
+
 #define GCR_TYPE_CERTIFICATE_CHAIN               (gcr_certificate_chain_get_type ())
 #define GCR_CERTIFICATE_CHAIN(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_CERTIFICATE_CHAIN, GcrCertificateChain))
 #define GCR_CERTIFICATE_CHAIN_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GCR_TYPE_CERTIFICATE_CHAIN, GcrCertificateChainClass))
@@ -71,14 +84,14 @@ struct _GcrCertificateChainClass {
 	GObjectClass parent_class;
 };
 
-GType                     gcr_certificate_chain_get_type           (void);
+GType                     gcr_certificate_chain_get_type           (void) G_GNUC_CONST;
 
 GcrCertificateChain*      gcr_certificate_chain_new                (void);
 
 void                      gcr_certificate_chain_add                (GcrCertificateChain *self,
                                                                     GcrCertificate *certificate);
 
-GcrCertificateChainType   gcr_certificate_chain_get_chain_type     (GcrCertificateChain *self);
+GcrCertificateChainStatus gcr_certificate_chain_get_status         (GcrCertificateChain *self);
 
 GcrCertificate*           gcr_certificate_chain_get_anchor         (GcrCertificateChain *self);
 
diff --git a/gcr/gcr-trust.c b/gcr/gcr-trust.c
index 575df92..045f8cf 100644
--- a/gcr/gcr-trust.c
+++ b/gcr/gcr-trust.c
@@ -50,7 +50,7 @@
  * purpose is the #GCR_PURPOSE_SERVER_AUTH and is used for a client application
  * to verify that the certificate at the server side of a TLS connection is
  * authorized to act as such. To check if a certificate is a trust anchor use
- * gcr_trust_is_certificate_anchor().
+ * gcr_trust_is_certificate_anchored().
  *
  * Pinned certificates are used when a user overrides the default trust
  * decision for a given certificate. They're often used with self-signed
diff --git a/gcr/tests/test-certificate-chain.c b/gcr/tests/test-certificate-chain.c
index 6749466..0556a8a 100644
--- a/gcr/tests/test-certificate-chain.c
+++ b/gcr/tests/test-certificate-chain.c
@@ -226,7 +226,7 @@ TESTING_TEST (certificate_chain_new)
 
 	chain = gcr_certificate_chain_new ();
 
-	g_assert_cmpuint (gcr_certificate_chain_get_chain_type (chain), ==,
+	g_assert_cmpuint (gcr_certificate_chain_get_status (chain), ==,
 	                  GCR_CERTIFICATE_CHAIN_UNKNOWN);
 	g_assert_cmpuint (gcr_certificate_chain_get_length (chain), ==, 0);
 
@@ -239,20 +239,20 @@ TESTING_TEST (certificate_chain_new_with_cert)
 {
 	GcrCertificateChain *chain;
 	GcrCertificate *check;
-	guint type, length;
+	guint status, length;
 
 	chain = gcr_certificate_chain_new ();
 	gcr_certificate_chain_add (chain, cert_signed);
 	gcr_certificate_chain_add (chain, cert_ca);
 
-	g_assert_cmpuint (gcr_certificate_chain_get_chain_type (chain), ==,
+	g_assert_cmpuint (gcr_certificate_chain_get_status (chain), ==,
 	                  GCR_CERTIFICATE_CHAIN_UNKNOWN);
 	g_assert_cmpuint (gcr_certificate_chain_get_length (chain), ==, 2);
 
-	type = G_MAXUINT;
+	status = G_MAXUINT;
 	length = 0;
-	g_object_get (chain, "type", &type, "length", &length, NULL);
-	g_assert_cmpuint (type, ==, GCR_CERTIFICATE_CHAIN_UNKNOWN);
+	g_object_get (chain, "status", &status, "length", &length, NULL);
+	g_assert_cmpuint (status, ==, GCR_CERTIFICATE_CHAIN_UNKNOWN);
 	g_assert_cmpuint (length, ==, 2);
 
 	check = gcr_certificate_chain_get_certificate (chain, 1);
@@ -283,7 +283,7 @@ TESTING_TEST (certificate_chain_selfsigned)
 		g_assert_not_reached ();
 	g_assert_no_error (error);
 
-	g_assert_cmpuint (gcr_certificate_chain_get_chain_type (chain), ==,
+	g_assert_cmpuint (gcr_certificate_chain_get_status (chain), ==,
 	                  GCR_CERTIFICATE_CHAIN_SELFSIGNED);
 
 	g_object_unref (chain);
@@ -304,7 +304,7 @@ TESTING_TEST (certificate_chain_incomplete)
 		g_assert_not_reached ();
 	g_assert_no_error (error);
 
-	g_assert_cmpuint (gcr_certificate_chain_get_chain_type (chain), ==,
+	g_assert_cmpuint (gcr_certificate_chain_get_status (chain), ==,
 	                  GCR_CERTIFICATE_CHAIN_INCOMPLETE);
 
 	g_object_unref (chain);
@@ -324,7 +324,7 @@ TESTING_TEST (certificate_chain_empty)
 		g_assert_not_reached ();
 	g_assert_no_error (error);
 
-	g_assert_cmpuint (gcr_certificate_chain_get_chain_type (chain), ==,
+	g_assert_cmpuint (gcr_certificate_chain_get_status (chain), ==,
 	                  GCR_CERTIFICATE_CHAIN_UNKNOWN);
 
 	g_object_unref (chain);
@@ -348,7 +348,7 @@ TESTING_TEST (certificate_chain_trim_extras)
 		g_assert_not_reached ();
 	g_assert_no_error (error);
 
-	g_assert_cmpuint (gcr_certificate_chain_get_chain_type (chain), ==,
+	g_assert_cmpuint (gcr_certificate_chain_get_status (chain), ==,
 	                  GCR_CERTIFICATE_CHAIN_SELFSIGNED);
 	g_assert_cmpuint (gcr_certificate_chain_get_length (chain), ==, 1);
 
@@ -384,7 +384,7 @@ TESTING_TEST (certificate_chain_complete_async)
 	g_assert_no_error (error);
 	g_object_unref (result);
 
-	g_assert_cmpuint (gcr_certificate_chain_get_chain_type (chain), ==,
+	g_assert_cmpuint (gcr_certificate_chain_get_status (chain), ==,
 	                  GCR_CERTIFICATE_CHAIN_SELFSIGNED);
 	g_assert_cmpuint (gcr_certificate_chain_get_length (chain), ==, 2);
 
@@ -410,7 +410,7 @@ TESTING_TEST (certificate_chain_with_anchor)
 		g_assert_not_reached ();
 	g_assert_no_error (error);
 
-	g_assert_cmpuint (gcr_certificate_chain_get_chain_type (chain), ==,
+	g_assert_cmpuint (gcr_certificate_chain_get_status (chain), ==,
 	                  GCR_CERTIFICATE_CHAIN_ANCHORED);
 	g_assert_cmpuint (gcr_certificate_chain_get_length (chain), ==, 2);
 	g_assert (gcr_certificate_chain_get_anchor (chain) == cert_ca);
@@ -437,7 +437,7 @@ TESTING_TEST (certificate_chain_with_anchor_and_lookup_ca)
 		g_assert_not_reached ();
 	g_assert_no_error (error);
 
-	g_assert_cmpuint (gcr_certificate_chain_get_chain_type (chain), ==,
+	g_assert_cmpuint (gcr_certificate_chain_get_status (chain), ==,
 	                  GCR_CERTIFICATE_CHAIN_ANCHORED);
 	g_assert_cmpuint (gcr_certificate_chain_get_length (chain), ==, 2);
 	g_assert (gcr_certificate_chain_get_anchor (chain) != NULL);
@@ -465,7 +465,7 @@ TESTING_TEST (certificate_chain_with_pinned)
 		g_assert_not_reached ();
 	g_assert_no_error (error);
 
-	g_assert_cmpuint (gcr_certificate_chain_get_chain_type (chain), ==,
+	g_assert_cmpuint (gcr_certificate_chain_get_status (chain), ==,
 	                  GCR_CERTIFICATE_CHAIN_PINNED);
 	g_assert_cmpuint (gcr_certificate_chain_get_length (chain), ==, 1);
 	g_assert (gcr_certificate_chain_get_anchor (chain) == NULL);
@@ -493,7 +493,7 @@ TESTING_TEST (certificate_chain_without_lookups)
 		g_assert_not_reached ();
 	g_assert_no_error (error);
 
-	g_assert_cmpuint (gcr_certificate_chain_get_chain_type (chain), ==,
+	g_assert_cmpuint (gcr_certificate_chain_get_status (chain), ==,
 	                  GCR_CERTIFICATE_CHAIN_INCOMPLETE);
 	g_assert_cmpuint (gcr_certificate_chain_get_length (chain), ==, 1);
 	g_assert (gcr_certificate_chain_get_anchor (chain) == NULL);
@@ -522,7 +522,7 @@ TESTING_TEST (certificate_chain_with_lookup_error)
 		g_assert_not_reached ();
 	g_assert_error (error, GCK_ERROR, CKR_FUNCTION_FAILED);
 
-	g_assert_cmpuint (gcr_certificate_chain_get_chain_type (chain), ==,
+	g_assert_cmpuint (gcr_certificate_chain_get_status (chain), ==,
 	                  GCR_CERTIFICATE_CHAIN_UNKNOWN);
 
 	g_object_unref (chain);
@@ -547,7 +547,7 @@ TESTING_TEST (certificate_chain_with_anchor_error)
 		g_assert_not_reached ();
 	g_assert_error (error, GCK_ERROR, CKR_FUNCTION_FAILED);
 
-	g_assert_cmpuint (gcr_certificate_chain_get_chain_type (chain), ==,
+	g_assert_cmpuint (gcr_certificate_chain_get_status (chain), ==,
 	                  GCR_CERTIFICATE_CHAIN_UNKNOWN);
 
 	g_object_unref (chain);
@@ -576,7 +576,7 @@ TESTING_TEST (certificate_chain_with_anchor_error_async)
 	g_assert_error (error, GCK_ERROR, CKR_FUNCTION_FAILED);
 	g_object_unref (result);
 
-	g_assert_cmpuint (gcr_certificate_chain_get_chain_type (chain), ==,
+	g_assert_cmpuint (gcr_certificate_chain_get_status (chain), ==,
 	                  GCR_CERTIFICATE_CHAIN_UNKNOWN);
 
 	g_object_unref (chain);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]