1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

kbx: Unify blob reading functions.

* kbx/keybox-file.c (_keybox_read_blob): Remove.
(_keybox_read_blob2): Rename to ....
(_keybox_read_blob): this.  Make arg options.  Change all callers.
* kbx/keybox-search.c (keybox_search): Factor fopen call out to ...
(open_file): new.
(keybox_seek): Als use open_file.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2017-04-01 11:10:47 +02:00
parent 5556eca5ac
commit 0039d7107b
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
5 changed files with 54 additions and 37 deletions

View file

@ -581,7 +581,7 @@ _keybox_dump_file (const char *filename, int stats_only, FILE *outfp)
for (;;)
{
rc = _keybox_read_blob (&blob, fp);
rc = _keybox_read_blob (&blob, fp, NULL);
if (gpg_err_code (rc) == GPG_ERR_TOO_LARGE
&& gpg_err_source (rc) == GPG_ERR_SOURCE_KEYBOX)
{
@ -704,7 +704,7 @@ _keybox_dump_find_dups (const char *filename, int print_them, FILE *outfp)
}
dupitems_count = 0;
while ( !(rc = _keybox_read_blob (&blob, fp)) )
while ( !(rc = _keybox_read_blob (&blob, fp, NULL)) )
{
unsigned char digest[20];
@ -778,7 +778,7 @@ _keybox_dump_cut_records (const char *filename, unsigned long from,
if (!(fp = open_file (&filename, stderr)))
return gpg_error_from_syserror ();
while ( !(rc = _keybox_read_blob (&blob, fp)) )
while ( !(rc = _keybox_read_blob (&blob, fp, NULL)) )
{
if (recno > to)
break; /* Ready. */