diff options
author | Werner Koch <wk@gnupg.org> | 2006-09-18 11:28:58 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2006-09-18 11:28:58 +0200 |
commit | e6f8654d03bcf3831c46393875709910ff645530 (patch) | |
tree | 7437fd9112870211493a140f8a46a109a893a251 /sm/keydb.c | |
parent | Allow for a global trustlist. (diff) | |
download | gnupg2-e6f8654d03bcf3831c46393875709910ff645530.tar.xz gnupg2-e6f8654d03bcf3831c46393875709910ff645530.zip |
Added common certificates.
Diffstat (limited to 'sm/keydb.c')
-rw-r--r-- | sm/keydb.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sm/keydb.c b/sm/keydb.c index 3fc7d31b9..8ba1287fc 100644 --- a/sm/keydb.c +++ b/sm/keydb.c @@ -71,13 +71,12 @@ static void unlock_all (KEYDB_HANDLE hd); /* * Register a resource (which currently may only be a keybox file). - * The first keybox which is added by this function is - * created if it does not exist. - * Note: this function may be called before secure memory is - * available. + * The first keybox which is added by this function is created if it + * does not exist. If AUTO_CREATED is not NULL it will be set to true + * if the function has created a a new keybox. */ int -keydb_add_resource (const char *url, int force, int secret) +keydb_add_resource (const char *url, int force, int secret, int *auto_created) { static int any_secret, any_public; const char *resname = url; @@ -87,6 +86,9 @@ keydb_add_resource (const char *url, int force, int secret) KeydbResourceType rt = KEYDB_RESOURCE_TYPE_NONE; const char *created_fname = NULL; + if (auto_created) + *auto_created = 0; + /* Do we have an URL? gnupg-kbx:filename := this is a plain keybox filename := See what is is, but create as plain keybox. @@ -195,6 +197,8 @@ keydb_add_resource (const char *url, int force, int secret) if (!opt.quiet) log_info (_("keybox `%s' created\n"), filename); created_fname = filename; + if (auto_created) + *auto_created = 1; } fclose (fp); fp = NULL; |