mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: First patches to support a keybox storage backend.
* kbx/keybox-defs.h (_keybox_write_header_blob): Move prototype to .. * kbx/keybox.h: here. * kbx/keybox-init.c (keybox_lock): Add dummy function * g10/keydb.c: Include keybox.h. (KeydbResourceType): Add KEYDB_RESOURCE_TYPE_KEYBOX. (struct resource_item): Add field kb. (maybe_create_keyring_or_box): Add error descriptions to diagnostics. Add arg IS_BOX. Write a header for a new keybox file. (keydb_add_resource): No more need for the force flag. Rename the local variable "force" to "create". Add URL scheme "gnupg-kbx". Add magic test to detect a keybox file. Add basic support for keybox. (keydb_new, keydb_get_resource_name, keydb_delete_keyblock) (keydb_locate_writable, keydb_search_reset, keydb_search2): Add support for keybox. (lock_all, unlock_all): Ditto. * g10/Makefile.am (needed_libs): Add libkeybox.a. (gpg2_LDADD, gpgv2_LDADD): Add KSBA_LIBS as a workaround. * g10/keydb.h (KEYDB_RESOURCE_FLAG_PRIMARY) KEYDB_RESOURCE_FLAG_DEFAULT, KEYDB_RESOURCE_FLAG_READONLY): New. * g10/gpg.c, g10/gpgv.c (main): Use new constants. -- I did most of these changes back in 2011 and only cleaned them up now. More to follow soon.
This commit is contained in:
parent
f0b33b6fb8
commit
91e61d5253
8 changed files with 243 additions and 80 deletions
|
@ -182,7 +182,6 @@ void _keybox_destroy_openpgp_info (keybox_openpgp_info_t info);
|
|||
int _keybox_read_blob (KEYBOXBLOB *r_blob, FILE *fp);
|
||||
int _keybox_read_blob2 (KEYBOXBLOB *r_blob, FILE *fp, int *skipped_deleted);
|
||||
int _keybox_write_blob (KEYBOXBLOB blob, FILE *fp);
|
||||
int _keybox_write_header_blob (FILE *fp);
|
||||
|
||||
/*-- keybox-search.c --*/
|
||||
gpg_err_code_t _keybox_get_flag_location (const unsigned char *buffer,
|
||||
|
|
|
@ -200,3 +200,20 @@ _keybox_close_file (KEYBOX_HANDLE hd)
|
|||
}
|
||||
assert (!hd->fp);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Lock the keybox at handle HD, or unlock if YES is false. Note that
|
||||
* we currently ignore the handle and lock all registered keyboxes.
|
||||
*/
|
||||
int
|
||||
keybox_lock (KEYBOX_HANDLE hd, int yes)
|
||||
{
|
||||
/* FIXME: We need to implement it before we can use it with gpg.
|
||||
gpgsm does the locking in its local keydb.c driver; this should
|
||||
be changed as well. */
|
||||
|
||||
(void)hd;
|
||||
(void)yes;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -71,6 +71,12 @@ void keybox_release (KEYBOX_HANDLE hd);
|
|||
const char *keybox_get_resource_name (KEYBOX_HANDLE hd);
|
||||
int keybox_set_ephemeral (KEYBOX_HANDLE hd, int yes);
|
||||
|
||||
int keybox_lock (KEYBOX_HANDLE hd, int yes);
|
||||
|
||||
/*-- keybox-file.c --*/
|
||||
/* Fixme: This function does not belong here: Provide a better
|
||||
interface to create a new keybox file. */
|
||||
int _keybox_write_header_blob (FILE *fp);
|
||||
|
||||
/*-- keybox-search.c --*/
|
||||
#ifdef KEYBOX_WITH_X509
|
||||
|
@ -98,7 +104,6 @@ int keybox_compress (KEYBOX_HANDLE hd);
|
|||
/*-- --*/
|
||||
|
||||
#if 0
|
||||
int keybox_lock (KEYBOX_HANDLE hd, int yes);
|
||||
int keybox_get_keyblock (KEYBOX_HANDLE hd, KBNODE *ret_kb);
|
||||
int keybox_locate_writable (KEYBOX_HANDLE hd);
|
||||
int keybox_search_reset (KEYBOX_HANDLE hd);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue