aboutsummaryrefslogtreecommitdiffstats
path: root/smime
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-08-16 23:25:56 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-09-04 19:34:32 +0800
commitfcbbdfbd18e15b4ee8322a0217cf03a689a5e033 (patch)
treee16cd2a2279558c6a2bfb6ca39fcbaac4c85ba59 /smime
parentf78417c48861759d7b0c4535ecd3febe4638a7d3 (diff)
downloadgsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar
gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.gz
gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.bz2
gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.lz
gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.xz
gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.zst
gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'smime')
-rw-r--r--smime/gui/ca-trust-dialog.c19
-rw-r--r--smime/gui/ca-trust-dialog.h2
-rw-r--r--smime/gui/cert-trust-dialog.c8
-rw-r--r--smime/gui/cert-trust-dialog.h2
-rw-r--r--smime/gui/certificate-manager.c34
-rw-r--r--smime/gui/certificate-viewer.c23
-rw-r--r--smime/gui/certificate-viewer.h2
-rw-r--r--smime/gui/component.c22
-rw-r--r--smime/gui/e-cert-selector.c37
-rw-r--r--smime/lib/e-asn1-object.c88
-rw-r--r--smime/lib/e-cert-db.c194
-rw-r--r--smime/lib/e-cert-db.h14
-rw-r--r--smime/lib/e-cert-trust.c8
-rw-r--r--smime/lib/e-cert.c161
-rw-r--r--smime/lib/e-cert.h10
-rw-r--r--smime/lib/e-pkcs12.c81
-rw-r--r--smime/lib/e-pkcs12.h6
-rw-r--r--smime/tests/import-cert.c3
18 files changed, 399 insertions, 315 deletions
diff --git a/smime/gui/ca-trust-dialog.c b/smime/gui/ca-trust-dialog.c
index 887af30277..df2a1f825a 100644
--- a/smime/gui/ca-trust-dialog.c
+++ b/smime/gui/ca-trust-dialog.c
@@ -54,7 +54,9 @@ free_data (gpointer data)
}
static void
-catd_response (GtkWidget *w, guint id, CATrustDialogData *data)
+catd_response (GtkWidget *w,
+ guint id,
+ CATrustDialogData *data)
{
switch (id) {
case GTK_RESPONSE_ACCEPT: {
@@ -68,8 +70,9 @@ catd_response (GtkWidget *w, guint id, CATrustDialogData *data)
}
}
-GtkWidget*
-ca_trust_dialog_show (ECert *cert, gboolean importing)
+GtkWidget *
+ca_trust_dialog_show (ECert *cert,
+ gboolean importing)
{
CATrustDialogData *ctd_data;
GtkDialog *dialog;
@@ -113,7 +116,10 @@ ca_trust_dialog_show (ECert *cert, gboolean importing)
}
void
-ca_trust_dialog_set_trust (GtkWidget *widget, gboolean ssl, gboolean email, gboolean objsign)
+ca_trust_dialog_set_trust (GtkWidget *widget,
+ gboolean ssl,
+ gboolean email,
+ gboolean objsign)
{
CATrustDialogData *ctd_data;
@@ -127,7 +133,10 @@ ca_trust_dialog_set_trust (GtkWidget *widget, gboolean ssl, gboolean email, gboo
}
void
-ca_trust_dialog_get_trust (GtkWidget *widget, gboolean *ssl, gboolean *email, gboolean *objsign)
+ca_trust_dialog_get_trust (GtkWidget *widget,
+ gboolean *ssl,
+ gboolean *email,
+ gboolean *objsign)
{
CATrustDialogData *ctd_data;
diff --git a/smime/gui/ca-trust-dialog.h b/smime/gui/ca-trust-dialog.h
index ec7979d818..8b7d945c00 100644
--- a/smime/gui/ca-trust-dialog.h
+++ b/smime/gui/ca-trust-dialog.h
@@ -27,7 +27,7 @@
#include <gtk/gtk.h>
#include "e-cert.h"
-GtkWidget* ca_trust_dialog_show (ECert *cert, gboolean importing);
+GtkWidget * ca_trust_dialog_show (ECert *cert, gboolean importing);
void ca_trust_dialog_set_trust (GtkWidget *widget, gboolean ssl, gboolean email, gboolean objsign);
void ca_trust_dialog_get_trust (GtkWidget *widget, gboolean *ssl, gboolean *email, gboolean *objsign);
diff --git a/smime/gui/cert-trust-dialog.c b/smime/gui/cert-trust-dialog.c
index 7c76b01b88..d4d6648b32 100644
--- a/smime/gui/cert-trust-dialog.c
+++ b/smime/gui/cert-trust-dialog.c
@@ -60,7 +60,9 @@ free_data (gpointer data)
}
static void
-ctd_response (GtkWidget *w, guint id, CertTrustDialogData *data)
+ctd_response (GtkWidget *w,
+ guint id,
+ CertTrustDialogData *data)
{
CERTCertTrust trust;
CERTCertificate *icert;
@@ -109,7 +111,7 @@ ctd_response (GtkWidget *w, guint id, CertTrustDialogData *data)
}
}
-GtkWidget*
+GtkWidget *
cert_trust_dialog_show (ECert *cert)
{
CertTrustDialogData *ctd_data;
@@ -128,7 +130,7 @@ cert_trust_dialog_show (ECert *cert)
ctd_data->label = e_builder_get_widget(ctd_data->builder, "trust-label");
- g_signal_connect(ctd_data->dialog, "response", G_CALLBACK(ctd_response), ctd_data);
+ g_signal_connect (ctd_data->dialog, "response", G_CALLBACK(ctd_response), ctd_data);
g_object_set_data_full (G_OBJECT (ctd_data->dialog), "CertTrustDialogData", ctd_data, free_data);
diff --git a/smime/gui/cert-trust-dialog.h b/smime/gui/cert-trust-dialog.h
index c4852aac66..20a076b7e9 100644
--- a/smime/gui/cert-trust-dialog.h
+++ b/smime/gui/cert-trust-dialog.h
@@ -28,7 +28,7 @@
G_BEGIN_DECLS
-GtkWidget* cert_trust_dialog_show (ECert *cert);
+GtkWidget * cert_trust_dialog_show (ECert *cert);
G_END_DECLS
diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c
index 3795c20923..5e23e1d865 100644
--- a/smime/gui/certificate-manager.c
+++ b/smime/gui/certificate-manager.c
@@ -64,7 +64,7 @@ enum {
typedef struct {
GType type;
const gchar *column_title;
- const gchar * (*get_cert_data_func) (ECert *cert); /* Prototype to e_cert_get_* functions */
+ const gchar * (*get_cert_data_func) (ECert *cert); /* Prototype to e_cert_get_ * functions */
gboolean visible; /* Default visibility of column */
} CertTreeColumn;
@@ -82,7 +82,7 @@ static CertTreeColumn yourcerts_columns[] = {
{ G_TYPE_STRING, N_("Expires"), e_cert_get_expires_on, TRUE },
{ G_TYPE_STRING, N_("SHA1 Fingerprint"), e_cert_get_sha1_fingerprint, FALSE },
{ G_TYPE_STRING, N_("MD5 Fingerprint"), e_cert_get_md5_fingerprint, FALSE },
- { G_TYPE_OBJECT, NULL, NULL, FALSE } /* Hidden column for ECert* object */
+ { G_TYPE_OBJECT, NULL, NULL, FALSE } /* Hidden column for ECert * object */
};
static const gchar* yourcerts_mime_types[] = { "application/x-x509-user-cert", "application/x-pkcs12", NULL };
@@ -189,7 +189,7 @@ save_treeview_state (GtkTreeView *treeview)
tree_name = gtk_widget_get_name (GTK_WIDGET (treeview));
sortable = GTK_TREE_SORTABLE (model);
- columns_count = gtk_tree_model_get_n_columns (model) - 1; /* Ignore the last column - the ECert* holder */
+ columns_count = gtk_tree_model_get_n_columns (model) - 1; /* Ignore the last column - the ECert * holder */
list = g_new0 (gint, columns_count);
for (i = 0; i < columns_count; i++) {
@@ -304,7 +304,9 @@ load_treeview_state (GtkTreeView *treeview)
}
static void
-report_and_free_error (CertPage *cp, const gchar *where, GError *error)
+report_and_free_error (CertPage *cp,
+ const gchar *where,
+ GError *error)
{
g_return_if_fail (cp != NULL);
@@ -409,7 +411,7 @@ treeview_add_column (CertPage *cp,
G_CALLBACK (treeview_header_clicked), cp->popup_menu);
/* The first column should not be concealable so there's no point in displaying
- it in the popup menu */
+ * it in the popup menu */
if (column_index == 0)
return;
@@ -430,7 +432,10 @@ struct find_cert_data {
};
static gboolean
-find_cert_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
+find_cert_cb (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ gpointer data)
{
struct find_cert_data *fcd = data;
ECert *cert = NULL;
@@ -645,9 +650,9 @@ delete_cert (GtkWidget *button,
gtk_tree_store_remove (cp->treemodel, &child_iter);
/* we need two unrefs here, one to unref the
- gtk_tree_model_get above, and one to unref
- the initial ref when we created the cert
- and added it to the tree */
+ * gtk_tree_model_get above, and one to unref
+ * the initial ref when we created the cert
+ * and added it to the tree */
g_object_unref (cert);
g_object_unref (cert);
}
@@ -656,7 +661,8 @@ delete_cert (GtkWidget *button,
}
static void
-add_cert (CertPage *cp, ECert *cert)
+add_cert (CertPage *cp,
+ ECert *cert)
{
GtkTreeIter iter;
GtkTreeIter *parent_iter = NULL;
@@ -674,7 +680,7 @@ add_cert (CertPage *cp, ECert *cert)
0, organization, -1);
/* now copy it off into parent_iter and insert it into
- the hashtable */
+ * the hashtable */
parent_iter = gtk_tree_iter_copy (&iter);
g_hash_table_insert (cp->root_hash, g_strdup (organization), parent_iter);
}
@@ -746,7 +752,7 @@ load_certs (CertPage *cp)
for (node = CERT_LIST_HEAD (certList);
!CERT_LIST_END (node, certList);
node = CERT_LIST_NEXT (node)) {
- ECert *cert = e_cert_new (CERT_DupCertificate ((CERTCertificate*) node->cert));
+ ECert *cert = e_cert_new (CERT_DupCertificate ((CERTCertificate *) node->cert));
ECertType ct = e_cert_get_cert_type (cert);
/* show everything else in a contact tab */
@@ -920,7 +926,7 @@ cert_manager_config_set_property (GObject *object,
case PROP_PREFERENCES_WINDOW:
ecmc->priv->pref_window = g_value_get_object (value);
/* When the preferences window is "closed" (= hidden), save
- state of all treeviews. */
+ * state of all treeviews. */
g_signal_connect_swapped (ecmc->priv->pref_window, "hide",
G_CALLBACK (cert_manager_config_window_hide), ecmc);
return;
@@ -1029,7 +1035,7 @@ e_cert_manager_config_init (ECertManagerConfig *ecmc)
g_idle_add ((GSourceFunc) populate_ui, ecmc);
/* Disconnect cert-manager-notebook from it's window and attach it
- to this ECertManagerConfig */
+ * to this ECertManagerConfig */
widget = e_builder_get_widget (priv->builder, "cert-manager-notebook");
parent = gtk_widget_get_parent (widget);
gtk_container_remove (GTK_CONTAINER (parent), widget);
diff --git a/smime/gui/certificate-viewer.c b/smime/gui/certificate-viewer.c
index 78a160b707..89f7d1fd8d 100644
--- a/smime/gui/certificate-viewer.c
+++ b/smime/gui/certificate-viewer.c
@@ -45,7 +45,8 @@ typedef struct {
} CertificateViewerData;
static void
-free_data (gpointer data, GObject *where_the_object_was)
+free_data (gpointer data,
+ GObject *where_the_object_was)
{
CertificateViewerData *cvm = data;
@@ -59,7 +60,8 @@ free_data (gpointer data, GObject *where_the_object_was)
#define NOT_PART_OF_CERT_MARKUP "<i>&lt;Not part of certificate&gt;</i>"
static void
-fill_in_general (CertificateViewerData *cvm_data, ECert *cert)
+fill_in_general (CertificateViewerData *cvm_data,
+ ECert *cert)
{
GtkWidget *label;
const gchar *text;
@@ -149,7 +151,9 @@ fill_in_general (CertificateViewerData *cvm_data, ECert *cert)
}
static void
-populate_fields_tree (CertificateViewerData *cvm_data, EASN1Object *asn1, GtkTreeIter *root)
+populate_fields_tree (CertificateViewerData *cvm_data,
+ EASN1Object *asn1,
+ GtkTreeIter *root)
{
GtkTreeIter new_iter;
@@ -175,7 +179,8 @@ populate_fields_tree (CertificateViewerData *cvm_data, EASN1Object *asn1, GtkTre
}
static void
-hierarchy_selection_changed (GtkTreeSelection *selection, CertificateViewerData *cvm_data)
+hierarchy_selection_changed (GtkTreeSelection *selection,
+ CertificateViewerData *cvm_data)
{
GtkTreeIter iter;
GtkTreeModel *model;
@@ -214,7 +219,8 @@ hierarchy_selection_changed (GtkTreeSelection *selection, CertificateViewerData
}
static void
-fields_selection_changed (GtkTreeSelection *selection, CertificateViewerData *cvm_data)
+fields_selection_changed (GtkTreeSelection *selection,
+ CertificateViewerData *cvm_data)
{
GtkTreeIter iter;
GtkTreeModel *model;
@@ -250,7 +256,8 @@ fields_selection_changed (GtkTreeSelection *selection, CertificateViewerData *cv
}
static void
-fill_in_details (CertificateViewerData *cvm_data, ECert *cert)
+fill_in_details (CertificateViewerData *cvm_data,
+ ECert *cert)
{
GList *l;
GtkTreeIter *root = NULL;
@@ -283,7 +290,7 @@ fill_in_details (CertificateViewerData *cvm_data, ECert *cert)
cvm_data->field_text = e_builder_get_widget (cvm_data->builder, "cert-field-value-textview");
/* set the font of the field value viewer to be some fixed
- width font to the hex display doesn't look like ass. */
+ * width font to the hex display doesn't look like ass. */
cvm_data->text_tag = gtk_text_buffer_create_tag (gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)),
"mono",
"font", "Mono",
@@ -313,7 +320,7 @@ fill_in_details (CertificateViewerData *cvm_data, ECert *cert)
gtk_tree_view_expand_all (GTK_TREE_VIEW (cvm_data->hierarchy_tree));
}
-GtkWidget*
+GtkWidget *
certificate_viewer_show (ECert *cert)
{
CertificateViewerData *cvm_data;
diff --git a/smime/gui/certificate-viewer.h b/smime/gui/certificate-viewer.h
index 6cfa7f63ab..d452b76c2c 100644
--- a/smime/gui/certificate-viewer.h
+++ b/smime/gui/certificate-viewer.h
@@ -26,6 +26,6 @@
#include <gtk/gtk.h>
#include "e-cert.h"
-GtkWidget* certificate_viewer_show (ECert *cert);
+GtkWidget * certificate_viewer_show (ECert *cert);
#endif /* _CERTIFICATE_VIEWER_H_ */
diff --git a/smime/gui/component.c b/smime/gui/component.c
index fbd6d75a78..091ebeefe8 100644
--- a/smime/gui/component.c
+++ b/smime/gui/component.c
@@ -36,7 +36,11 @@
#include "pk11func.h"
static gboolean
-smime_pk11_passwd (ECertDB *db, PK11SlotInfo* slot, gboolean retry, gchar **passwd, gpointer arg)
+smime_pk11_passwd (ECertDB *db,
+ PK11SlotInfo *slot,
+ gboolean retry,
+ gchar **passwd,
+ gpointer arg)
{
gchar *prompt;
gchar *slot_name = g_strdup (PK11_GetSlotName (slot));
@@ -48,7 +52,7 @@ smime_pk11_passwd (ECertDB *db, PK11SlotInfo* slot, gboolean retry, gchar **pass
*passwd = e_passwords_ask_password (_("Enter password"), NULL, "",
prompt,
- E_PASSWORDS_REMEMBER_NEVER|E_PASSWORDS_SECRET, NULL,
+ E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, NULL,
NULL);
g_free (prompt);
@@ -58,7 +62,10 @@ smime_pk11_passwd (ECertDB *db, PK11SlotInfo* slot, gboolean retry, gchar **pass
}
static gboolean
-smime_pk11_change_passwd (ECertDB *db, gchar **old_passwd, gchar **passwd, gpointer arg)
+smime_pk11_change_passwd (ECertDB *db,
+ gchar **old_passwd,
+ gchar **passwd,
+ gpointer arg)
{
gchar *prompt;
@@ -70,7 +77,7 @@ smime_pk11_change_passwd (ECertDB *db, gchar **old_passwd, gchar **passwd, gpoin
*passwd = e_passwords_ask_password (_("Enter new password"), NULL, "",
prompt,
- E_PASSWORDS_REMEMBER_NEVER|E_PASSWORDS_SECRET, NULL,
+ E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, NULL,
NULL);
}
else {
@@ -83,7 +90,12 @@ smime_pk11_change_passwd (ECertDB *db, gchar **old_passwd, gchar **passwd, gpoin
}
static gboolean
-smime_confirm_ca_cert_import (ECertDB *db, ECert *cert, gboolean *trust_ssl, gboolean *trust_email, gboolean *trust_objsign, gpointer arg)
+smime_confirm_ca_cert_import (ECertDB *db,
+ ECert *cert,
+ gboolean *trust_ssl,
+ gboolean *trust_email,
+ gboolean *trust_objsign,
+ gpointer arg)
{
GtkWidget *dialog = ca_trust_dialog_show (cert, TRUE);
gint response;
diff --git a/smime/gui/e-cert-selector.c b/smime/gui/e-cert-selector.c
index c88f044e9b..24cc9b374a 100644
--- a/smime/gui/e-cert-selector.c
+++ b/smime/gui/e-cert-selector.c
@@ -53,14 +53,14 @@ static guint ecs_signals[ECS_LAST_SIGNAL];
G_DEFINE_TYPE (ECertSelector, e_cert_selector, GTK_TYPE_DIALOG)
/* (this is what mozilla shows)
-Issued to:
- Subject: E=notzed@ximian.com, CN=notzed@ximian.com, O=My Company Ltd, L=Adelaide, ST=SA, C=AU
- Serial Number: 03
- Valid from 23/10/03 06:35:29 to 22/10/04 06:35:29
- Purposes: Sign,Encrypt
-Issued by:
- Subject: E=notzed@ximian.com, O=company, L=there, ST=Here, C=AU
-*/
+ * Issued to:
+ * Subject: E=notzed@ximian.com, CN=notzed@ximian.com, O=My Company Ltd, L=Adelaide, ST=SA, C=AU
+ * Serial Number: 03
+ * Valid from 23/10/03 06:35:29 to 22/10/04 06:35:29
+ * Purposes: Sign,Encrypt
+ * Issued by:
+ * Subject: E=notzed@ximian.com, O=company, L=there, ST=Here, C=AU
+ */
static CERTCertListNode *
ecs_find_current (ECertSelector *ecs)
@@ -74,7 +74,7 @@ ecs_find_current (ECertSelector *ecs)
n = gtk_combo_box_get_active (GTK_COMBO_BOX (p->combobox));
node = CERT_LIST_HEAD (p->certlist);
- while (n>0 && !CERT_LIST_END (node, p->certlist)) {
+ while (n > 0 && !CERT_LIST_END (node, p->certlist)) {
n--;
node = CERT_LIST_NEXT (node);
}
@@ -85,7 +85,8 @@ ecs_find_current (ECertSelector *ecs)
}
static void
-e_cert_selector_response (GtkDialog *dialog, gint button)
+e_cert_selector_response (GtkDialog *dialog,
+ gint button)
{
CERTCertListNode *node;
@@ -98,11 +99,12 @@ e_cert_selector_response (GtkDialog *dialog, gint button)
break;
}
- g_signal_emit (dialog, ecs_signals[ECS_SELECTED], 0, node?node->cert->nickname:NULL);
+ g_signal_emit (dialog, ecs_signals[ECS_SELECTED], 0, node ? node->cert->nickname : NULL);
}
static void
-ecs_cert_changed (GtkWidget *w, ECertSelector *ecs)
+ecs_cert_changed (GtkWidget *w,
+ ECertSelector *ecs)
{
struct _ECertSelectorPrivate *p = ecs->priv;
CERTCertListNode *node;
@@ -140,7 +142,8 @@ ecs_cert_changed (GtkWidget *w, ECertSelector *ecs)
* Return value: A dialogue to be shown.
**/
GtkWidget *
-e_cert_selector_new (gint type, const gchar *currentid)
+e_cert_selector_new (gint type,
+ const gchar *currentid)
{
ECertSelector *ecs;
struct _ECertSelectorPrivate *p;
@@ -152,7 +155,7 @@ e_cert_selector_new (gint type, const gchar *currentid)
GtkWidget *w;
GtkListStore *store;
GtkTreeIter iter;
- gint n=0, active=0;
+ gint n = 0, active = 0;
ecs = g_object_new (e_cert_selector_get_type (), NULL);
p = ecs->priv;
@@ -189,7 +192,7 @@ e_cert_selector_new (gint type, const gchar *currentid)
if (node->cert->nickname || node->cert->emailAddr) {
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
- 0, node->cert->nickname?node->cert->nickname:node->cert->emailAddr,
+ 0, node->cert->nickname ? node->cert->nickname : node->cert->emailAddr,
-1);
if (currentid != NULL
@@ -226,7 +229,7 @@ e_cert_selector_init (ECertSelector *ecs)
}
static void
-e_cert_selector_finalise (GObject *o)
+e_cert_selector_finalize (GObject *o)
{
ECertSelector *ecs = (ECertSelector *) o;
@@ -241,7 +244,7 @@ e_cert_selector_finalise (GObject *o)
static void
e_cert_selector_class_init (ECertSelectorClass *klass)
{
- ((GObjectClass *) klass)->finalize = e_cert_selector_finalise;
+ ((GObjectClass *) klass)->finalize = e_cert_selector_finalize;
((GtkDialogClass *) klass)->response = e_cert_selector_response;
ecs_signals[ECS_SELECTED] =
diff --git a/smime/lib/e-asn1-object.c b/smime/lib/e-asn1-object.c
index a717a6942a..28c3aa7c85 100644
--- a/smime/lib/e-asn1-object.c
+++ b/smime/lib/e-asn1-object.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* The following is the mozilla license blurb, as the bodies some of
- these functions were derived from the mozilla source. */
+ * these functions were derived from the mozilla source. */
/*
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@@ -131,14 +131,15 @@ e_asn1_object_get_type (void)
/* This function is used to interpret an integer that
- was encoded in a DER buffer. This function is used
- when converting a DER buffer into a nsIASN1Object
- structure. This interprets the buffer in data
- as defined by the DER (Distinguised Encoding Rules) of
- ASN1.
+ * was encoded in a DER buffer. This function is used
+ * when converting a DER buffer into a nsIASN1Object
+ * structure. This interprets the buffer in data
+ * as defined by the DER (Distinguised Encoding Rules) of
+ * ASN1.
*/
static gint
-get_integer_256 (guchar *data, guint nb)
+get_integer_256 (guchar *data,
+ guint nb)
{
gint val;
@@ -163,17 +164,19 @@ get_integer_256 (guchar *data, guint nb)
}
/* This function is used to retrieve the lenght of a DER encoded
- item. It looks to see if this a multibyte length and then
- interprets the buffer accordingly to get the actual length value.
- This funciton is used mostly while parsing the DER headers.
-
- A DER encoded item has the following structure:
-
- <tag><length<data consisting of lenght bytes>
-*/
+ * item. It looks to see if this a multibyte length and then
+ * interprets the buffer accordingly to get the actual length value.
+ * This funciton is used mostly while parsing the DER headers.
+ *
+ * A DER encoded item has the following structure:
+ *
+ * <tag><length<data consisting of lenght bytes>
+ */
static guint32
-get_der_item_length (guchar *data, guchar *end,
- unsigned long *bytesUsed, gboolean *indefinite)
+get_der_item_length (guchar *data,
+ guchar *end,
+ gulong *bytesUsed,
+ gboolean *indefinite)
{
guchar lbyte = *data++;
PRInt32 length = -1;
@@ -181,13 +184,13 @@ get_der_item_length (guchar *data, guchar *end,
*indefinite = FALSE;
if (lbyte >= 0x80) {
/* Multibyte length */
- unsigned nb = (unsigned) (lbyte & 0x7f);
+ guint nb = (guint) (lbyte & 0x7f);
if (nb > 4) {
return -1;
}
if (nb > 0) {
- if ((data+nb) > end) {
+ if ((data + nb) > end) {
return -1;
}
length = get_integer_256 (data, nb);
@@ -206,9 +209,11 @@ get_der_item_length (guchar *data, guchar *end,
}
static gboolean
-build_from_der (EASN1Object *parent, gchar *data, gchar *end)
+build_from_der (EASN1Object *parent,
+ gchar *data,
+ gchar *end)
{
- unsigned long bytesUsed;
+ gulong bytesUsed;
gboolean indefinite;
PRInt32 len;
PRUint32 type;
@@ -219,13 +224,13 @@ build_from_der (EASN1Object *parent, gchar *data, gchar *end)
return TRUE;
/*
- A DER item has the form of |tag|len|data
- tag is one byte and describes the type of elment
- we are dealing with.
- len is a DER encoded gint telling us how long the data is
- data is a buffer that is len bytes long and has to be
- interpreted according to its type.
- */
+ * A DER item has the form of |tag|len|data
+ * tag is one byte and describes the type of elment
+ * we are dealing with.
+ * len is a DER encoded gint telling us how long the data is
+ * data is a buffer that is len bytes long and has to be
+ * interpreted according to its type.
+ */
while (data < end) {
code = *data;
@@ -242,7 +247,7 @@ build_from_der (EASN1Object *parent, gchar *data, gchar *end)
(guchar *) data, (guchar *) end,
&bytesUsed, &indefinite);
data += bytesUsed;
- if ((len < 0) || ((data+len) > end))
+ if ((len < 0) || ((data + len) > end))
return FALSE;
if (code & SEC_ASN1_CONSTRUCTED) {
@@ -292,8 +297,9 @@ build_from_der (EASN1Object *parent, gchar *data, gchar *end)
return TRUE;
}
-EASN1Object*
-e_asn1_object_new_from_der (gchar *data, guint32 len)
+EASN1Object *
+e_asn1_object_new_from_der (gchar *data,
+ guint32 len)
{
EASN1Object *obj = g_object_new (E_TYPE_ASN1_OBJECT, NULL);
@@ -305,14 +311,15 @@ e_asn1_object_new_from_der (gchar *data, guint32 len)
return obj;
}
-EASN1Object*
+EASN1Object *
e_asn1_object_new (void)
{
return E_ASN1_OBJECT (g_object_new (E_TYPE_ASN1_OBJECT, NULL));
}
void
-e_asn1_object_set_valid_container (EASN1Object *obj, gboolean flag)
+e_asn1_object_set_valid_container (EASN1Object *obj,
+ gboolean flag)
{
obj->priv->valid_container = flag;
}
@@ -335,7 +342,7 @@ e_asn1_object_get_asn1_tag (EASN1Object *obj)
return obj->priv->tag;
}
-GList*
+GList *
e_asn1_object_get_children (EASN1Object *obj)
{
GList *children = g_list_copy (obj->priv->children);
@@ -346,14 +353,16 @@ e_asn1_object_get_children (EASN1Object *obj)
}
void
-e_asn1_object_append_child (EASN1Object *parent, EASN1Object *child)
+e_asn1_object_append_child (EASN1Object *parent,
+ EASN1Object *child)
{
parent->priv->children = g_list_append (
parent->priv->children, g_object_ref (child));
}
void
-e_asn1_object_set_display_name (EASN1Object *obj, const gchar *name)
+e_asn1_object_set_display_name (EASN1Object *obj,
+ const gchar *name)
{
g_free (obj->priv->display_name);
obj->priv->display_name = g_strdup (name);
@@ -366,7 +375,8 @@ e_asn1_object_get_display_name (EASN1Object *obj)
}
void
-e_asn1_object_set_display_value (EASN1Object *obj, const gchar *value)
+e_asn1_object_set_display_value (EASN1Object *obj,
+ const gchar *value)
{
g_free (obj->priv->value);
obj->priv->value = g_strdup (value);
@@ -379,7 +389,9 @@ e_asn1_object_get_display_value (EASN1Object *obj)
}
void
-e_asn1_object_get_data (EASN1Object *obj, gchar **data, guint32 *len)
+e_asn1_object_get_data (EASN1Object *obj,
+ gchar **data,
+ guint32 *len)
{
*data = obj->priv->data;
*len = obj->priv->data_len;
diff --git a/smime/lib/e-cert-db.c b/smime/lib/e-cert-db.c
index a5fbbbed23..7fdd20f6e7 100644
--- a/smime/lib/e-cert-db.c
+++ b/smime/lib/e-cert-db.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* The following is the mozilla license blurb, as the bodies some of
- these functions were derived from the mozilla source. */
+ * these functions were derived from the mozilla source. */
/* e-cert-db.c
*
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
@@ -315,7 +315,9 @@ set_nss_error (GError **error)
}
static SECStatus PR_CALLBACK
-collect_certs (gpointer arg, SECItem **certs, gint numcerts)
+collect_certs (gpointer arg,
+ SECItem **certs,
+ gint numcerts)
{
CERTDERCerts *collectArgs;
SECItem *cert;
@@ -342,10 +344,10 @@ collect_certs (gpointer arg, SECItem **certs, gint numcerts)
return (SECSuccess);
}
-static CERTDERCerts*
+static CERTDERCerts *
e_cert_db_get_certs_from_package (PRArenaPool *arena,
- gchar *data,
- guint32 length)
+ gchar *data,
+ guint32 length)
{
/*nsNSSShutDownPreventionLock locker;*/
CERTDERCerts *collectArgs =
@@ -386,19 +388,21 @@ e_cert_db_dispose (GObject *object)
#ifdef notyet
PRBool
ucs2_ascii_conversion_fn (PRBool toUnicode,
- guchar *inBuf,
- guint inBufLen,
- guchar *outBuf,
- guint maxOutBufLen,
- guint *outBufLen,
- PRBool swapBytes)
+ guchar *inBuf,
+ guint inBufLen,
+ guchar *outBuf,
+ guint maxOutBufLen,
+ guint *outBufLen,
+ PRBool swapBytes)
{
printf ("in ucs2_ascii_conversion_fn\n");
}
#endif
static gchar * PR_CALLBACK
-pk11_password (PK11SlotInfo* slot, PRBool retry, gpointer arg)
+pk11_password (PK11SlotInfo *slot,
+ PRBool retry,
+ gpointer arg)
{
gchar *pwd;
gchar *nsspwd;
@@ -497,9 +501,9 @@ install_loadable_roots (void)
if (!RootsModule) {
#ifndef G_OS_WIN32
/* grovel in various places for mozilla's built-in
- cert module.
-
- XXX yes this is gross. *sigh*
+ * cert module.
+ *
+ * XXX yes this is gross. *sigh *
*/
const gchar *paths_to_check[] = {
#ifdef MOZILLA_NSS_LIB_DIR
@@ -617,7 +621,7 @@ e_cert_db_get_type (void)
GStaticMutex init_mutex = G_STATIC_MUTEX_INIT;
static ECertDB *cert_db = NULL;
-ECertDB*
+ECertDB *
e_cert_db_peek (void)
{
g_static_mutex_lock (&init_mutex);
@@ -635,10 +639,10 @@ e_cert_db_shutdown (void)
}
/* searching for certificates */
-ECert*
+ECert *
e_cert_db_find_cert_by_nickname (ECertDB *certdb,
- const gchar *nickname,
- GError **error)
+ const gchar *nickname,
+ GError **error)
{
/* nsNSSShutDownPreventionLock locker;*/
CERTCertificate *cert = NULL;
@@ -661,16 +665,16 @@ e_cert_db_find_cert_by_nickname (ECertDB *certdb,
}
#ifdef notyet
-ECert*
+ECert *
e_cert_db_find_cert_by_key (ECertDB *certdb,
- const gchar *db_key,
- GError **error)
+ const gchar *db_key,
+ GError **error)
{
/* nsNSSShutDownPreventionLock locker;*/
SECItem keyItem = {siBuffer, NULL, 0};
SECItem *dummy;
CERTIssuerAndSN issuerSN;
- unsigned long moduleID,slotID;
+ gulong moduleID,slotID;
CERTCertificate *cert;
if (!db_key) {
@@ -686,10 +690,10 @@ e_cert_db_find_cert_by_key (ECertDB *certdb,
slotID = NS_NSS_GET_LONG (&keyItem.data[NS_NSS_LONG]);
/* build the issuer/SN structure*/
- issuerSN.serialNumber.len = NS_NSS_GET_LONG (&keyItem.data[NS_NSS_LONG*2]);
- issuerSN.derIssuer.len = NS_NSS_GET_LONG (&keyItem.data[NS_NSS_LONG*3]);
- issuerSN.serialNumber.data= &keyItem.data[NS_NSS_LONG*4];
- issuerSN.derIssuer.data= &keyItem.data[NS_NSS_LONG*4+
+ issuerSN.serialNumber.len = NS_NSS_GET_LONG (&keyItem.data[NS_NSS_LONG *2]);
+ issuerSN.derIssuer.len = NS_NSS_GET_LONG (&keyItem.data[NS_NSS_LONG *3]);
+ issuerSN.serialNumber.data= &keyItem.data[NS_NSS_LONG *4];
+ issuerSN.derIssuer.data= &keyItem.data[NS_NSS_LONG *4+
issuerSN.serialNumber.len];
cert = CERT_FindCertByIssuerAndSN (CERT_GetDefaultCertDB (), &issuerSN);
@@ -703,32 +707,32 @@ e_cert_db_find_cert_by_key (ECertDB *certdb,
return NULL;
}
-GList*
-e_cert_db_get_cert_nicknames (ECertDB *certdb,
- ECertType cert_type,
- GError **error)
+GList *
+e_cert_db_get_cert_nicknames (ECertDB *certdb,
+ ECertType cert_type,
+ GError **error)
{
}
-ECert*
+ECert *
e_cert_db_find_email_encryption_cert (ECertDB *certdb,
- const gchar *nickname,
- GError **error)
+ const gchar *nickname,
+ GError **error)
{
}
-ECert*
+ECert *
e_cert_db_find_email_signing_cert (ECertDB *certdb,
- const gchar *nickname,
- GError **error)
+ const gchar *nickname,
+ GError **error)
{
}
#endif
-ECert*
+ECert *
e_cert_db_find_cert_by_email_address (ECertDB *certdb,
- const gchar *email,
- GError **error)
+ const gchar *email,
+ GError **error)
{
/* nsNSSShutDownPreventionLock locker; */
ECert *cert;
@@ -803,7 +807,9 @@ confirm_download_ca_cert (ECertDB *cert_db,
}
static gboolean
-handle_ca_cert_download (ECertDB *cert_db, GList *certs, GError **error)
+handle_ca_cert_download (ECertDB *cert_db,
+ GList *certs,
+ GError **error)
{
ECert *certToShow;
SECItem der;
@@ -811,18 +817,18 @@ handle_ca_cert_download (ECertDB *cert_db, GList *certs, GError **error)
CERTCertificate *tmpCert;
/* First thing we have to do is figure out which certificate
- we're gonna present to the user. The CA may have sent down
- a list of certs which may or may not be a chained list of
- certs. Until the day we can design some solid UI for the
- general case, we'll code to the > 90% case. That case is
- where a CA sends down a list that is a chain up to its root
- in either ascending or descending order. What we're gonna
- do is compare the first 2 entries, if the first was signed
- by the second, we assume the leaf cert is the first cert
- and display it. If the second cert was signed by the first
- cert, then we assume the first cert is the root and the
- last cert in the array is the leaf. In this case we
- display the last cert.
+ * we're gonna present to the user. The CA may have sent down
+ * a list of certs which may or may not be a chained list of
+ * certs. Until the day we can design some solid UI for the
+ * general case, we'll code to the > 90% case. That case is
+ * where a CA sends down a list that is a chain up to its root
+ * in either ascending or descending order. What we're gonna
+ * do is compare the first 2 entries, if the first was signed
+ * by the second, we assume the leaf cert is the first cert
+ * and display it. If the second cert was signed by the first
+ * cert, then we assume the first cert is the root and the
+ * last cert in the array is the leaf. In this case we
+ * display the last cert.
*/
/* nsNSSShutDownPreventionLock locker;*/
@@ -855,17 +861,17 @@ handle_ca_cert_download (ECertDB *cert_db, GList *certs, GError **error)
if (!strcmp (cert1IssuerName, cert0SubjectName)) {
/* In this case, the first cert in the list signed the second,
- so the first cert is the root. Let's display the last cert
- in the list. */
+ * so the first cert is the root. Let's display the last cert
+ * in the list. */
certToShow = E_CERT (g_list_last (certs)->data);
}
else if (!strcmp (cert0IssuerName, cert1SubjectName)) {
/* In this case the second cert has signed the first cert. The
- first cert is the leaf, so let's display it. */
+ * first cert is the leaf, so let's display it. */
certToShow = cert0;
} else {
/* It's not a chain, so let's just show the first one in the
- downloaded list. */
+ * downloaded list. */
certToShow = cert0;
}
}
@@ -967,17 +973,17 @@ handle_ca_cert_download (ECertDB *cert_db, GList *certs, GError **error)
#if 0
/* Now it's time to add the rest of the certs we just downloaded.
- Since we didn't prompt the user about any of these certs, we
- won't set any trust bits for them. */
+ * Since we didn't prompt the user about any of these certs, we
+ * won't set any trust bits for them. */
e_cert_trust_init (&trust);
e_cert_trust_set_valid_ca (&trust);
e_cert_trusts_add_ca_trust (&trust, 0, 0, 0);
- for (PRUint32 i=0; i<numCerts; i++) {
+ for (PRUint32 i = 0; i < numCerts; i++) {
if (i == selCertIndex)
continue;
certToShow = do_QueryElementAt (x509Certs, i);
- certToShow->GetRawDER (&der.len, (PRUint8 **)&der.data);
+ certToShow->GetRawDER (&der.len, (PRUint8 **) &der.data);
CERTCertificate *tmpCert2 =
CERT_NewTempCertificate (certdb, &der, nsnull, PR_FALSE, PR_TRUE);
@@ -1019,10 +1025,10 @@ gboolean e_cert_db_change_cert_trust (CERTCertificate *cert, CERTCertTrust *trus
/* deleting certificates */
gboolean
e_cert_db_delete_cert (ECertDB *certdb,
- ECert *ecert)
+ ECert *ecert)
{
/* nsNSSShutDownPreventionLock locker;
- nsNSSCertificate *nssCert = NS_STATIC_CAST (nsNSSCertificate*, aCert); */
+ * nsNSSCertificate *nssCert = NS_STATIC_CAST (nsNSSCertificate *, aCert); */
CERTCertificate *cert;
@@ -1051,10 +1057,11 @@ e_cert_db_delete_cert (ECertDB *certdb,
/* importing certificates */
gboolean
e_cert_db_import_certs (ECertDB *certdb,
- gchar *data, guint32 length,
- ECertType cert_type,
- GSList **imported_certs,
- GError **error)
+ gchar *data,
+ guint32 length,
+ ECertType cert_type,
+ GSList **imported_certs,
+ GError **error)
{
/*nsNSSShutDownPreventionLock locker;*/
PRArenaPool *arena = PORT_NewArena (DER_DEFAULT_CHUNKSIZE);
@@ -1070,7 +1077,7 @@ e_cert_db_import_certs (ECertDB *certdb,
}
/* Now let's create some certs to work with */
- for (i=0; i<certCollection->numcerts; i++) {
+ for (i = 0; i < certCollection->numcerts; i++) {
SECItem *currItem = &certCollection->rawCerts[i];
ECert *cert;
@@ -1117,9 +1124,10 @@ e_cert_db_import_certs (ECertDB *certdb,
gboolean
e_cert_db_import_email_cert (ECertDB *certdb,
- gchar *data, guint32 length,
- GSList **imported_certs,
- GError **error)
+ gchar *data,
+ guint32 length,
+ GSList **imported_certs,
+ GError **error)
{
/*nsNSSShutDownPreventionLock locker;*/
SECStatus srv = SECFailure;
@@ -1198,9 +1206,9 @@ default_nickname (CERTCertificate *cert)
gchar *nickname = NULL;
gchar *tmp = NULL;
gint count;
- const gchar *nickFmt=NULL;
+ const gchar *nickFmt = NULL;
CERTCertificate *dummycert;
- PK11SlotInfo *slot=NULL;
+ PK11SlotInfo *slot = NULL;
CK_OBJECT_HANDLE keyHandle;
CERTCertDBHandle *defaultcertdb = CERT_GetDefaultCertDB ();
@@ -1316,8 +1324,9 @@ default_nickname (CERTCertificate *cert)
gboolean
e_cert_db_import_user_cert (ECertDB *certdb,
- gchar *data, guint32 length,
- GError **error)
+ gchar *data,
+ guint32 length,
+ GError **error)
{
/* nsNSSShutDownPreventionLock locker;*/
PK11SlotInfo *slot;
@@ -1327,7 +1336,7 @@ e_cert_db_import_user_cert (ECertDB *certdb,
SECItem *CACerts;
CERTDERCerts * collectArgs;
PRArenaPool *arena;
- CERTCertificate * cert=NULL;
+ CERTCertificate * cert = NULL;
arena = PORT_NewArena (DER_DEFAULT_CHUNKSIZE);
if (arena == NULL) {
@@ -1376,7 +1385,7 @@ e_cert_db_import_user_cert (ECertDB *certdb,
numCACerts = collectArgs->numcerts - 1;
if (numCACerts) {
- CACerts = collectArgs->rawCerts+1;
+ CACerts = collectArgs->rawCerts + 1;
if (!CERT_ImportCAChain (CACerts, numCACerts, certUsageUserCertImport)) {
rv = TRUE;
}
@@ -1394,21 +1403,22 @@ e_cert_db_import_user_cert (ECertDB *certdb,
gboolean
e_cert_db_import_server_cert (ECertDB *certdb,
- gchar *data, guint32 length,
- GSList **imported_certs,
- GError **error)
+ gchar *data,
+ guint32 length,
+ GSList **imported_certs,
+ GError **error)
{
/* not c&p'ing this over at the moment, as we don't have a UI
- for server certs anyway */
+ * for server certs anyway */
return FALSE;
}
gboolean
e_cert_db_import_certs_from_file (ECertDB *cert_db,
- const gchar *file_path,
- ECertType cert_type,
- GSList **imported_certs,
- GError **error)
+ const gchar *file_path,
+ ECertType cert_type,
+ GSList **imported_certs,
+ GError **error)
{
gboolean rv;
gint fd;
@@ -1429,7 +1439,7 @@ e_cert_db_import_certs_from_file (ECertDB *cert_db,
return FALSE;
}
- fd = g_open (file_path, O_RDONLY|O_BINARY, 0);
+ fd = g_open (file_path, O_RDONLY | O_BINARY, 0);
if (fd == -1) {
set_nss_error (error);
return FALSE;
@@ -1484,8 +1494,8 @@ e_cert_db_import_certs_from_file (ECertDB *cert_db,
gboolean
e_cert_db_import_pkcs12_file (ECertDB *cert_db,
- const gchar *file_path,
- GError **error)
+ const gchar *file_path,
+ GError **error)
{
EPKCS12 *pkcs12 = e_pkcs12_new ();
GError *e = NULL;
@@ -1501,16 +1511,16 @@ e_cert_db_import_pkcs12_file (ECertDB *cert_db,
#ifdef notyet
gboolean
e_cert_db_export_pkcs12_file (ECertDB *cert_db,
- const gchar *file_path,
- GList *certs,
- GError **error)
+ const gchar *file_path,
+ GList *certs,
+ GError **error)
{
}
#endif
gboolean
e_cert_db_login_to_slot (ECertDB *cert_db,
- PK11SlotInfo *slot)
+ PK11SlotInfo *slot)
{
if (PK11_NeedLogin (slot)) {
PK11_Logout (slot);
diff --git a/smime/lib/e-cert-db.h b/smime/lib/e-cert-db.h
index 6e1bc5a7c5..26d0a25c2a 100644
--- a/smime/lib/e-cert-db.h
+++ b/smime/lib/e-cert-db.h
@@ -66,34 +66,34 @@ struct _ECertDBClass {
GType e_cert_db_get_type (void);
/* single instance */
-ECertDB* e_cert_db_peek (void);
+ECertDB * e_cert_db_peek (void);
void e_cert_db_shutdown (void);
/* searching for certificates */
-ECert* e_cert_db_find_cert_by_nickname (ECertDB *certdb,
+ECert * e_cert_db_find_cert_by_nickname (ECertDB *certdb,
const gchar *nickname,
GError **error);
#ifdef notyet
-ECert* e_cert_db_find_cert_by_key (ECertDB *certdb,
+ECert * e_cert_db_find_cert_by_key (ECertDB *certdb,
const gchar *db_key,
GError **error);
-GList* e_cert_db_get_cert_nicknames (ECertDB *certdb,
+GList * e_cert_db_get_cert_nicknames (ECertDB *certdb,
ECertType cert_type,
GError **error);
-ECert* e_cert_db_find_email_encryption_cert (ECertDB *certdb,
+ECert * e_cert_db_find_email_encryption_cert (ECertDB *certdb,
const gchar *nickname,
GError **error);
-ECert* e_cert_db_find_email_signing_cert (ECertDB *certdb,
+ECert * e_cert_db_find_email_signing_cert (ECertDB *certdb,
const gchar *nickname,
GError **error);
#endif
-ECert* e_cert_db_find_cert_by_email_address (ECertDB *certdb,
+ECert * e_cert_db_find_cert_by_email_address (ECertDB *certdb,
const gchar *nickname,
GError **error);
diff --git a/smime/lib/e-cert-trust.c b/smime/lib/e-cert-trust.c
index 5bb13318a8..e1c7124e41 100644
--- a/smime/lib/e-cert-trust.c
+++ b/smime/lib/e-cert-trust.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* The following is the mozilla license blurb, as the bodies some of
- these functions were derived from the mozilla source. */
+ * these functions were derived from the mozilla source. */
/*
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@@ -442,13 +442,15 @@ e_cert_trust_has_trusted_peer (CERTCertTrust *trust,
}
void
-e_cert_trust_add_trust (guint *t, guint v)
+e_cert_trust_add_trust (guint *t,
+ guint v)
{
*t |= v;
}
PRBool
-e_cert_trust_has_trust (guint t, guint v)
+e_cert_trust_has_trust (guint t,
+ guint v)
{
return (t & v);
}
diff --git a/smime/lib/e-cert.c b/smime/lib/e-cert.c
index 6d00ffb20c..e7aecc10c8 100644
--- a/smime/lib/e-cert.c
+++ b/smime/lib/e-cert.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* The following is the mozilla license blurb, as the bodies some of
- these functions were derived from the mozilla source. */
+ * these functions were derived from the mozilla source. */
/*
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@@ -59,7 +59,7 @@ struct _ECertPrivate {
CERTCertificate *cert;
/* pointers we cache since the nss implementation allocs the
- string */
+ * string */
gchar *org_name;
gchar *org_unit_name;
gchar *cn;
@@ -134,8 +134,8 @@ e_cert_dispose (GObject *object)
PK11_DeleteTokenCertAndKey (ec->priv->cert, NULL);
} else if (!PK11_IsReadOnly (ec->priv->cert->slot)) {
/* If the list of built-ins does contain a non-removable
- copy of this certificate, our call will not remove
- the certificate permanently, but rather remove all trust. */
+ * copy of this certificate, our call will not remove
+ * the certificate permanently, but rather remove all trust. */
SEC_DeletePermCertificate (ec->priv->cert);
}
}
@@ -258,7 +258,7 @@ e_cert_populate (ECert *cert)
cert->priv->md5_fingerprint = CERT_Hexify (&fpItem, TRUE);
}
-ECert*
+ECert *
e_cert_new (CERTCertificate *cert)
{
ECert *ecert = E_CERT (g_object_new (E_TYPE_CERT, NULL));
@@ -271,8 +271,9 @@ e_cert_new (CERTCertificate *cert)
return ecert;
}
-ECert*
-e_cert_new_from_der (gchar *data, guint32 len)
+ECert *
+e_cert_new_from_der (gchar *data,
+ guint32 len)
{
CERTCertificate *cert = CERT_DecodeCertFromPackage (data, len);
@@ -287,7 +288,7 @@ e_cert_new_from_der (gchar *data, guint32 len)
-CERTCertificate*
+CERTCertificate *
e_cert_get_internal_cert (ECert *cert)
{
/* XXX should this refcnt it? */
@@ -295,11 +296,13 @@ e_cert_get_internal_cert (ECert *cert)
}
gboolean
-e_cert_get_raw_der (ECert *cert, gchar **data, guint32 *len)
+e_cert_get_raw_der (ECert *cert,
+ gchar **data,
+ guint32 *len)
{
/* XXX do we really need to check if cert->priv->cert is NULL
- here? it should always be non-null if we have the
- ECert.. */
+ * here? it should always be non - null if we have the
+ * ECert.. */
if (cert->priv->cert) {
*data = (gchar *)cert->priv->cert->derCert.data;
*len = (guint32)cert->priv->cert->derCert.len;
@@ -312,7 +315,7 @@ e_cert_get_raw_der (ECert *cert, gchar **data, guint32 *len)
}
const gchar *
-e_cert_get_window_title (ECert *cert)
+e_cert_get_window_title (ECert *cert)
{
if (cert->priv->cert->nickname)
return cert->priv->cert->nickname;
@@ -329,13 +332,13 @@ e_cert_get_nickname (ECert *cert)
}
const gchar *
-e_cert_get_email (ECert *cert)
+e_cert_get_email (ECert *cert)
{
return cert->priv->cert->emailAddr;
}
const gchar *
-e_cert_get_org (ECert *cert)
+e_cert_get_org (ECert *cert)
{
return cert->priv->org_name;
}
@@ -347,7 +350,7 @@ e_cert_get_org_unit (ECert *cert)
}
const gchar *
-e_cert_get_cn (ECert *cert)
+e_cert_get_cn (ECert *cert)
{
return cert->priv->cn;
}
@@ -383,7 +386,7 @@ e_cert_get_subject_name (ECert *cert)
}
PRTime
-e_cert_get_issued_on_time (ECert *cert)
+e_cert_get_issued_on_time (ECert *cert)
{
return cert->priv->issued_on;
}
@@ -395,7 +398,7 @@ e_cert_get_issued_on (ECert *cert)
}
PRTime
-e_cert_get_expires_on_time (ECert *cert)
+e_cert_get_expires_on_time (ECert *cert)
{
return cert->priv->expires_on;
}
@@ -451,12 +454,12 @@ e_cert_get_sha1_fingerprint (ECert *cert)
}
const gchar *
-e_cert_get_md5_fingerprint (ECert *cert)
+e_cert_get_md5_fingerprint (ECert *cert)
{
return cert->priv->md5_fingerprint;
}
-GList*
+GList *
e_cert_get_chain (ECert *ecert)
{
GList *l = NULL;
@@ -506,7 +509,7 @@ e_cert_get_ca_cert (ECert *ecert)
static gboolean
get_int_value (SECItem *versionItem,
- unsigned long *version)
+ gulong *version)
{
SECStatus srv;
srv = SEC_ASN1DecodeInteger (versionItem,version);
@@ -518,11 +521,11 @@ get_int_value (SECItem *versionItem,
}
static gboolean
-process_version (SECItem *versionItem,
- EASN1Object **retItem)
+process_version (SECItem *versionItem,
+ EASN1Object **retItem)
{
EASN1Object *item = e_asn1_object_new ();
- unsigned long version;
+ gulong version;
e_asn1_object_set_display_name (item, _("Version"));
@@ -533,7 +536,7 @@ process_version (SECItem *versionItem,
return FALSE;
} else {
/* If there is no version present in the cert, then rfc2459
- says we default to v1 (0) */
+ * says we default to v1 (0) */
version = 0;
}
@@ -557,8 +560,8 @@ process_version (SECItem *versionItem,
}
static gboolean
-process_serial_number_der (SECItem *serialItem,
- EASN1Object **retItem)
+process_serial_number_der (SECItem *serialItem,
+ EASN1Object **retItem)
{
gchar *serialNumber;
EASN1Object *item = e_asn1_object_new ();
@@ -576,13 +579,13 @@ process_serial_number_der (SECItem *serialItem,
static gboolean
get_default_oid_format (SECItem *oid,
- gchar **text)
+ gchar **text)
{
gchar buf[300];
guint len;
gint written;
- unsigned long val = oid->data[0];
+ gulong val = oid->data[0];
guint i = val % 40;
val /= 40;
written = PR_snprintf(buf, 300, "%lu %u ", val, i);
@@ -593,13 +596,13 @@ get_default_oid_format (SECItem *oid,
val = 0;
for (i = 1; i < oid->len; ++i) {
/* In this loop, we have to parse a DER formatted
- If the first bit is a 1, then the integer is
- represented by more than one byte. If the
- first bit is set then we continue on and add
- the values of the later bytes until we get
- a byte without the first bit set.
+ * If the first bit is a 1, then the integer is
+ * represented by more than one byte. If the
+ * first bit is set then we continue on and add
+ * the values of the later bytes until we get
+ * a byte without the first bit set.
*/
- unsigned long j;
+ gulong j;
j = oid->data[i];
val = (val << 7) | (j & 0x7f);
@@ -620,7 +623,8 @@ get_default_oid_format (SECItem *oid,
}
static gboolean
-get_oid_text (SECItem *oid, gchar **text)
+get_oid_text (SECItem *oid,
+ gchar **text)
{
SECOidTag oidTag = SECOID_FindOIDTag (oid);
gchar *temp;
@@ -699,22 +703,23 @@ get_oid_text (SECItem *oid, gchar **text)
}
static gboolean
-process_raw_bytes (SECItem *data, gchar **text)
+process_raw_bytes (SECItem *data,
+ gchar **text)
{
/* This function is used to display some DER bytes
- that we have not added support for decoding.
- It prints the value of the byte out into a
- string that can later be displayed as a byte
- string. We place a new line after 24 bytes
- to break up extermaly long sequence of bytes.
+ * that we have not added support for decoding.
+ * It prints the value of the byte out into a
+ * string that can later be displayed as a byte
+ * string. We place a new line after 24 bytes
+ * to break up extermaly long sequence of bytes.
*/
GString *str = g_string_new ("");
PRUint32 i;
gchar buffer[5];
- for (i=0; i<data->len; i++) {
+ for (i = 0; i < data->len; i++) {
PR_snprintf(buffer, 5, "%02x ", data->data[i]);
g_string_append (str, buffer);
- if ((i+1)%16 == 0) {
+ if ((i + 1) % 16 == 0) {
g_string_append (str, "\n");
}
}
@@ -723,8 +728,8 @@ process_raw_bytes (SECItem *data, gchar **text)
}
static gboolean
-process_sec_algorithm_id (SECAlgorithmID *algID,
- EASN1Object **retSequence)
+process_sec_algorithm_id (SECAlgorithmID *algID,
+ EASN1Object **retSequence)
{
EASN1Object *sequence = e_asn1_object_new ();
gchar *text;
@@ -763,7 +768,7 @@ process_sec_algorithm_id (SECAlgorithmID *algID,
static gboolean
process_subject_public_key_info (CERTSubjectPublicKeyInfo *spki,
- EASN1Object *parentSequence)
+ EASN1Object *parentSequence)
{
EASN1Object *spkiSequence = e_asn1_object_new ();
EASN1Object *sequenceItem;
@@ -781,8 +786,8 @@ process_subject_public_key_info (CERTSubjectPublicKeyInfo *spki,
e_asn1_object_append_child (spkiSequence, sequenceItem);
/* The subjectPublicKey field is encoded as a bit string.
- ProcessRawBytes expects the lenght to be in bytes, so
- let's convert the lenght into a temporary SECItem.
+ * ProcessRawBytes expects the lenght to be in bytes, so
+ * let's convert the lenght into a temporary SECItem.
*/
data.data = spki->subjectPublicKey.data;
data.len = spki->subjectPublicKey.len / 8;
@@ -802,8 +807,8 @@ process_subject_public_key_info (CERTSubjectPublicKeyInfo *spki,
}
static gboolean
-process_ns_cert_type_extensions (SECItem *extData,
- GString *text)
+process_ns_cert_type_extensions (SECItem *extData,
+ GString *text)
{
SECItem decoded;
guchar nsCertType;
@@ -852,7 +857,8 @@ process_ns_cert_type_extensions (SECItem *extData,
}
static gboolean
-process_key_usage_extensions (SECItem *extData, GString *text)
+process_key_usage_extensions (SECItem *extData,
+ GString *text)
{
SECItem decoded;
guchar keyUsage;
@@ -901,8 +907,9 @@ process_key_usage_extensions (SECItem *extData, GString *text)
}
static gboolean
-process_extension_data (SECOidTag oidTag, SECItem *extData,
- GString *str)
+process_extension_data (SECOidTag oidTag,
+ SECItem *extData,
+ GString *str)
{
gboolean rv;
switch (oidTag) {
@@ -925,7 +932,7 @@ process_extension_data (SECOidTag oidTag, SECItem *extData,
static gboolean
process_single_extension (CERTCertExtension *extension,
- EASN1Object **retExtension)
+ EASN1Object **retExtension)
{
GString *str = g_string_new ("");
gchar *text;
@@ -962,14 +969,14 @@ process_single_extension (CERTCertExtension *extension,
static gboolean
process_extensions (CERTCertExtension **extensions,
- EASN1Object *parentSequence)
+ EASN1Object *parentSequence)
{
EASN1Object *extensionSequence = e_asn1_object_new ();
PRInt32 i;
e_asn1_object_set_display_name (extensionSequence, _("Extensions"));
- for (i=0; extensions[i] != NULL; i++) {
+ for (i = 0; extensions[i] != NULL; i++) {
EASN1Object *newExtension;
if (!process_single_extension (extensions[i],
@@ -983,12 +990,13 @@ process_extensions (CERTCertExtension **extensions,
}
static gboolean
-process_name (CERTName *name, gchar **value)
+process_name (CERTName *name,
+ gchar **value)
{
- CERTRDN** rdns;
- CERTRDN** rdn;
- CERTAVA** avas;
- CERTAVA* ava;
+ CERTRDN ** rdns;
+ CERTRDN ** rdn;
+ CERTAVA ** avas;
+ CERTAVA * ava;
SECItem *decodeItem = NULL;
GString *final_string = g_string_new ("");
@@ -1057,7 +1065,8 @@ process_name (CERTName *name, gchar **value)
}
static gboolean
-create_tbs_certificate_asn1_struct (ECert *cert, EASN1Object **seq)
+create_tbs_certificate_asn1_struct (ECert *cert,
+ EASN1Object **seq)
{
/*
** TBSCertificate ::= SEQUENCE {
@@ -1113,14 +1122,14 @@ create_tbs_certificate_asn1_struct (ECert *cert, EASN1Object **seq)
g_object_unref (subitem);
#ifdef notyet
- nsCOMPtr<nsIASN1Sequence> validitySequence = new nsNSSASN1Sequence ();
+ nsCOMPtr < nsIASN1Sequence> validitySequence = new nsNSSASN1Sequence ();
nssComponent->GetPIPNSSBundleString(NS_LITERAL_STRING("CertDumpValidity").get(),
text);
validitySequence->SetDisplayName (text);
asn1Objects->AppendElement (validitySequence, PR_FALSE);
nssComponent->GetPIPNSSBundleString(NS_LITERAL_STRING("CertDumpNotBefore").get(),
text);
- nsCOMPtr<nsIX509CertValidity> validityData;
+ nsCOMPtr < nsIX509CertValidity> validityData;
GetValidity (getter_AddRefs (validityData));
PRTime notBefore, notAfter;
@@ -1154,9 +1163,9 @@ create_tbs_certificate_asn1_struct (ECert *cert, EASN1Object **seq)
/* Is there an issuerUniqueID? */
if (cert->priv->cert->issuerID.data) {
/* The issuerID is encoded as a bit string.
- The function ProcessRawBytes expects the
- length to be in bytes, so let's convert the
- length in a temporary SECItem
+ * The function ProcessRawBytes expects the
+ * length to be in bytes, so let's convert the
+ * length in a temporary SECItem
*/
data.data = cert->priv->cert->issuerID.data;
data.len = cert->priv->cert->issuerID.len / 8;
@@ -1173,9 +1182,9 @@ create_tbs_certificate_asn1_struct (ECert *cert, EASN1Object **seq)
if (cert->priv->cert->subjectID.data) {
/* The subjectID is encoded as a bit string.
- The function ProcessRawBytes expects the
- length to be in bytes, so let's convert the
- length in a temporary SECItem
+ * The function ProcessRawBytes expects the
+ * length to be in bytes, so let's convert the
+ * length in a temporary SECItem
*/
data.data = cert->priv->cert->issuerID.data;
data.len = cert->priv->cert->issuerID.len / 8;
@@ -1211,7 +1220,7 @@ create_asn1_struct (ECert *cert)
e_asn1_object_set_display_name (cert->priv->asn1, e_cert_get_window_title (cert));
/* This sequence will be contain the tbsCertificate, signatureAlgorithm,
- and signatureValue. */
+ * and signatureValue. */
if (!create_tbs_certificate_asn1_struct (cert, &sequence))
return FALSE;
@@ -1231,9 +1240,9 @@ create_asn1_struct (ECert *cert)
sequence, _("Certificate Signature Value"));
/* The signatureWrap is encoded as a bit string.
- The function ProcessRawBytes expects the
- length to be in bytes, so let's convert the
- length in a temporary SECItem */
+ * The function ProcessRawBytes expects the
+ * length to be in bytes, so let's convert the
+ * length in a temporary SECItem */
temp.data = cert->priv->cert->signatureWrap.signature.data;
temp.len = cert->priv->cert->signatureWrap.signature.len / 8;
process_raw_bytes (&temp, &text);
@@ -1244,7 +1253,7 @@ create_asn1_struct (ECert *cert)
return TRUE;
}
-EASN1Object*
+EASN1Object *
e_cert_get_asn1_struct (ECert *cert)
{
if (!cert->priv->asn1)
@@ -1260,7 +1269,7 @@ e_cert_mark_for_deletion (ECert *cert)
#if 0
/* make sure user is logged in to the token */
- nsCOMPtr<nsIInterfaceRequestor> ctx = new PipUIContext ();
+ nsCOMPtr < nsIInterfaceRequestor> ctx = new PipUIContext ();
#endif
if (PK11_NeedLogin (cert->priv->cert->slot)
diff --git a/smime/lib/e-cert.h b/smime/lib/e-cert.h
index 3a092a71d4..4159c40cb9 100644
--- a/smime/lib/e-cert.h
+++ b/smime/lib/e-cert.h
@@ -66,10 +66,10 @@ struct _ECertClass {
GType e_cert_get_type (void);
-ECert* e_cert_new (CERTCertificate *cert);
-ECert* e_cert_new_from_der (gchar *data, guint32 len);
+ECert * e_cert_new (CERTCertificate *cert);
+ECert * e_cert_new_from_der (gchar *data, guint32 len);
-CERTCertificate* e_cert_get_internal_cert (ECert *cert);
+CERTCertificate * e_cert_get_internal_cert (ECert *cert);
gboolean e_cert_get_raw_der (ECert *cert, gchar **data, guint32 *len);
const gchar * e_cert_get_window_title (ECert *cert);
@@ -95,9 +95,9 @@ const gchar * e_cert_get_serial_number (ECert *cert);
const gchar * e_cert_get_sha1_fingerprint (ECert *cert);
const gchar * e_cert_get_md5_fingerprint (ECert *cert);
-GList* e_cert_get_chain (ECert *cert);
+GList * e_cert_get_chain (ECert *cert);
ECert * e_cert_get_ca_cert (ECert *ecert);
-EASN1Object* e_cert_get_asn1_struct (ECert *cert);
+EASN1Object * e_cert_get_asn1_struct (ECert *cert);
gboolean e_cert_mark_for_deletion (ECert *cert);
diff --git a/smime/lib/e-pkcs12.c b/smime/lib/e-pkcs12.c
index f4fa995207..959924e69d 100644
--- a/smime/lib/e-pkcs12.c
+++ b/smime/lib/e-pkcs12.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* The following is the mozilla license blurb, as the bodies some of
- these functions were derived from the mozilla source. */
+ * these functions were derived from the mozilla source. */
/*
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@@ -145,7 +145,7 @@ e_pkcs12_get_type (void)
-EPKCS12*
+EPKCS12 *
e_pkcs12_new (void)
{
EPKCS12 *pk = E_PKCS12 (g_object_new (E_TYPE_PKCS12, NULL));
@@ -154,7 +154,9 @@ e_pkcs12_new (void)
}
static gboolean
-input_to_decoder (SEC_PKCS12DecoderContext *dcx, const gchar *path, GError **error)
+input_to_decoder (SEC_PKCS12DecoderContext *dcx,
+ const gchar *path,
+ GError **error)
{
/* nsNSSShutDownPreventionLock locker; */
SECStatus srv;
@@ -194,15 +196,17 @@ input_to_decoder (SEC_PKCS12DecoderContext *dcx, const gchar *path, GError **err
}
/* XXX toshok - this needs to be done using a signal as in the
- e_cert_db_login_to_slot stuff, instead of a direct gui dep here..
- for now, though, it stays. */
+ * e_cert_db_login_to_slot stuff, instead of a direct gui dep here..
+ * for now, though, it stays. */
static gboolean
-prompt_for_password (gchar *title, gchar *prompt, SECItem *pwd)
+prompt_for_password (gchar *title,
+ gchar *prompt,
+ SECItem *pwd)
{
gchar *passwd;
passwd = e_passwords_ask_password (title, NULL, "", prompt,
- E_PASSWORDS_REMEMBER_NEVER|E_PASSWORDS_SECRET, NULL,
+ E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, NULL,
NULL);
if (passwd) {
@@ -232,8 +236,11 @@ prompt_for_password (gchar *title, gchar *prompt, SECItem *pwd)
}
static gboolean
-import_from_file_helper (EPKCS12 *pkcs12, PK11SlotInfo *slot,
- const gchar *path, gboolean *aWantRetry, GError **error)
+import_from_file_helper (EPKCS12 *pkcs12,
+ PK11SlotInfo *slot,
+ const gchar *path,
+ gboolean *aWantRetry,
+ GError **error)
{
/*nsNSSShutDownPreventionLock locker; */
gboolean rv;
@@ -294,8 +301,8 @@ import_from_file_helper (EPKCS12 *pkcs12, PK11SlotInfo *slot,
handle_error (PKCS12_RESTORE_OK);
finish:
/* If srv != SECSuccess, NSS probably set a specific error code.
- We should use that error code instead of inventing a new one
- for every error possible. */
+ * We should use that error code instead of inventing a new one
+ * for every error possible. */
if (srv != SECSuccess) {
if (SEC_ERROR_BAD_PASSWORD == PORT_GetError ()) {
*aWantRetry = TRUE;
@@ -311,7 +318,9 @@ import_from_file_helper (EPKCS12 *pkcs12, PK11SlotInfo *slot,
}
gboolean
-e_pkcs12_import_from_file (EPKCS12 *pkcs12, const gchar *path, GError **error)
+e_pkcs12_import_from_file (EPKCS12 *pkcs12,
+ const gchar *path,
+ GError **error)
{
/*nsNSSShutDownPreventionLock locker;*/
gboolean rv = TRUE;
@@ -342,9 +351,11 @@ e_pkcs12_export_to_file (EPKCS12 *pkcs12,
}
/* what to do when the nickname collides with one already in the db.
- TODO: not handled, throw a dialog allowing the nick to be changed? */
+ * TODO: not handled, throw a dialog allowing the nick to be changed? */
static SECItem * PR_CALLBACK
-nickname_collision (SECItem *oldNick, PRBool *cancel, gpointer wincx)
+nickname_collision (SECItem *oldNick,
+ PRBool *cancel,
+ gpointer wincx)
{
/* nsNSSShutDownPreventionLock locker; */
gint count = 1;
@@ -356,32 +367,32 @@ nickname_collision (SECItem *oldNick, PRBool *cancel, gpointer wincx)
printf ("nickname_collision\n");
/* The user is trying to import a PKCS#12 file that doesn't have the
- attribute we use to set the nickname. So in order to reduce the
- number of interactions we require with the user, we'll build a nickname
- for the user. The nickname isn't prominently displayed in the UI,
- so it's OK if we generate one on our own here.
- XXX If the NSS API were smarter and actually passed a pointer to
- the CERTCertificate* we're importing we could actually just
- call default_nickname (which is what the issuance code path
- does) and come up with a reasonable nickname. Alas, the NSS
- API limits our ability to produce a useful nickname without
- bugging the user. :(
+ * attribute we use to set the nickname. So in order to reduce the
+ * number of interactions we require with the user, we'll build a nickname
+ * for the user. The nickname isn't prominently displayed in the UI,
+ * so it's OK if we generate one on our own here.
+ * XXX If the NSS API were smarter and actually passed a pointer to
+ * the CERTCertificate * we're importing we could actually just
+ * call default_nickname (which is what the issuance code path
+ * does) and come up with a reasonable nickname. Alas, the NSS
+ * API limits our ability to produce a useful nickname without
+ * bugging the user. :(
*/
while (1) {
CERTCertificate *cert;
/* If we've gotten this far, that means there isn't a certificate
- in the database that has the same subject name as the cert we're
- trying to import. So we need to come up with a "nickname" to
- satisfy the NSS requirement or fail in trying to import.
- Basically we use a default nickname from a properties file and
- see if a certificate exists with that nickname. If there isn't, then
- create update the count by one and append the string '#1' Or
- whatever the count currently is, and look for a cert with
- that nickname. Keep updating the count until we find a nickname
- without a corresponding cert.
- XXX If a user imports *many* certs without the 'friendly name'
- attribute, then this may take a long time. :(
+ * in the database that has the same subject name as the cert we're
+ * trying to import. So we need to come up with a "nickname" to
+ * satisfy the NSS requirement or fail in trying to import.
+ * Basically we use a default nickname from a properties file and
+ * see if a certificate exists with that nickname. If there isn't, then
+ * create update the count by one and append the string '#1' Or
+ * whatever the count currently is, and look for a cert with
+ * that nickname. Keep updating the count until we find a nickname
+ * without a corresponding cert.
+ * XXX If a user imports *many * certs without the 'friendly name'
+ * attribute, then this may take a long time. :(
*/
if (count > 1) {
g_free (nickname);
diff --git a/smime/lib/e-pkcs12.h b/smime/lib/e-pkcs12.h
index 6e98fdb0cb..940187bc18 100644
--- a/smime/lib/e-pkcs12.h
+++ b/smime/lib/e-pkcs12.h
@@ -53,12 +53,12 @@ struct _EPKCS12Class {
GType e_pkcs12_get_type (void);
-EPKCS12* e_pkcs12_new (void);
+EPKCS12 * e_pkcs12_new (void);
#if 0
/* XXX we're not going to support additional slots in the initial ssl
- stuff, so we just always default to the internal token (and thus
- don't need this function yet. */
+ * stuff, so we just always default to the internal token (and thus
+ * don't need this function yet. */
gboolean e_pkcs12_set_token (void);
#endif
diff --git a/smime/tests/import-cert.c b/smime/tests/import-cert.c
index 850590789a..dfd368da46 100644
--- a/smime/tests/import-cert.c
+++ b/smime/tests/import-cert.c
@@ -24,7 +24,8 @@
#include "e-pkcs12.h"
gint
-main (gint argc, gchar **argv)
+main (gint argc,
+ gchar **argv)
{
ECertDB *db;
EPKCS12 *pkcs12;