diff options
author | Chris Toshok <toshok@ximian.com> | 2004-03-20 01:01:22 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2004-03-20 01:01:22 +0800 |
commit | 9ae0f1424515b21f952125b130cf4c841dac29f2 (patch) | |
tree | 78ff81ace4c6af2209f26560d5aa3164675dac95 /smime/lib | |
parent | f53bd65b2e5816e409144186bf397c526819efdb (diff) | |
download | gsoc2013-evolution-9ae0f1424515b21f952125b130cf4c841dac29f2.tar gsoc2013-evolution-9ae0f1424515b21f952125b130cf4c841dac29f2.tar.gz gsoc2013-evolution-9ae0f1424515b21f952125b130cf4c841dac29f2.tar.bz2 gsoc2013-evolution-9ae0f1424515b21f952125b130cf4c841dac29f2.tar.lz gsoc2013-evolution-9ae0f1424515b21f952125b130cf4c841dac29f2.tar.xz gsoc2013-evolution-9ae0f1424515b21f952125b130cf4c841dac29f2.tar.zst gsoc2013-evolution-9ae0f1424515b21f952125b130cf4c841dac29f2.zip |
[ fixes bug #52829 ]
2004-03-19 Chris Toshok <toshok@ximian.com>
[ fixes bug #52829 ]
* lib/smime-marshal.list: add BOOL:POINTER,POINTER for
pk11_change_passwd.
* lib/e-cert-db.c (e_cert_db_class_init): initialize the
pk11_change_passwd signal.
(e_cert_db_login_to_slot): emit "pk11_change_passwd" with
old_passwd == NULL to initialize the database.
* lib/e-cert-db.h: add pk11_change_passwd signal slot.
* gui/component.c (smime_pk11_change_passwd): implement the
portion of this that gets called with old_passwd == NULL (the only
part that needs implementing yet, since we don't have a UI for
changing the password.)
(smime_component_init): hook up to the pk11_change_passwd signal
on ECertDB.
svn path=/trunk/; revision=25131
Diffstat (limited to 'smime/lib')
-rw-r--r-- | smime/lib/e-cert-db.c | 29 | ||||
-rw-r--r-- | smime/lib/e-cert-db.h | 2 | ||||
-rw-r--r-- | smime/lib/smime-marshal.list | 1 |
3 files changed, 28 insertions, 4 deletions
diff --git a/smime/lib/e-cert-db.c b/smime/lib/e-cert-db.c index be45f88883..8de335e04a 100644 --- a/smime/lib/e-cert-db.c +++ b/smime/lib/e-cert-db.c @@ -94,6 +94,7 @@ enum { PK11_PASSWD, + PK11_CHANGE_PASSWD, LAST_SIGNAL }; @@ -271,6 +272,16 @@ e_cert_db_class_init (ECertDBClass *klass) smime_marshal_BOOLEAN__POINTER_BOOLEAN_POINTER, G_TYPE_BOOLEAN, 3, G_TYPE_POINTER, G_TYPE_BOOLEAN, G_TYPE_POINTER); + + e_cert_db_signals[PK11_CHANGE_PASSWD] = + g_signal_new ("pk11_change_passwd", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECertDBClass, pk11_change_passwd), + NULL, NULL, + smime_marshal_BOOLEAN__POINTER_POINTER, + G_TYPE_BOOLEAN, 2, + G_TYPE_POINTER, G_TYPE_POINTER); } static void @@ -1117,12 +1128,22 @@ e_cert_db_login_to_slot (ECertDB *cert_db, PK11_Logout (slot); if (PK11_NeedUserInit (slot)) { + char *pwd; + gboolean rv = FALSE; + printf ("initializing slot password\n"); + + g_signal_emit (e_cert_db_peek (), + e_cert_db_signals[PK11_CHANGE_PASSWD], 0, + NULL, + &pwd, + &rv); + + if (!rv) + return FALSE; + /* the user needs to specify the initial password */ - /* XXX toshok - this should use a signal to - pop up a password dialog ala the - pk11_passwd prompt. for now we do it - here. */ + PK11_InitPin (slot, "", pwd); } if (PK11_Authenticate (slot, PR_TRUE, NULL) != SECSuccess) { diff --git a/smime/lib/e-cert-db.h b/smime/lib/e-cert-db.h index d31fc02186..3fb6c62c71 100644 --- a/smime/lib/e-cert-db.h +++ b/smime/lib/e-cert-db.h @@ -50,6 +50,8 @@ struct _ECertDBClass { /* signals */ gboolean (*pk11_passwd) (ECertDB *db, PK11SlotInfo *slot, gboolean retry, char **passwd); + gboolean (*pk11_change_passwd) (ECertDB *db, char **orig_passwd, char **passwd); + /* Padding for future expansion */ void (*_ecert_reserved0) (void); void (*_ecert_reserved1) (void); diff --git a/smime/lib/smime-marshal.list b/smime/lib/smime-marshal.list index 97c7a93233..dbdd3c3159 100644 --- a/smime/lib/smime-marshal.list +++ b/smime/lib/smime-marshal.list @@ -1 +1,2 @@ BOOL:POINTER,BOOL,POINTER +BOOL:POINTER,POINTER |