summaryrefslogtreecommitdiffstats
path: root/kbx/keybox-blob.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2002-07-22 12:21:04 +0200
committerWerner Koch <wk@gnupg.org>2002-07-22 12:21:04 +0200
commit508ce100c975692648325cdd839d9b49496659d6 (patch)
treefd5ed7741a7c880902be499be71a4fcbb9c295cf /kbx/keybox-blob.c
parent* fseeko.c, ftello.c: New. (diff)
downloadgnupg2-508ce100c975692648325cdd839d9b49496659d6.tar.xz
gnupg2-508ce100c975692648325cdd839d9b49496659d6.zip
* keybox-defs.h: New BLOBTYPTE_EMPTY.
* keybox-dump.c (_keybox_dump_blob): Handle new type. * keybox-file.c (_keybox_read_blob): Skip over empty blobs. Store the file offset. * keybox-blob.c (_keybox_new_blob): Add new arg OFF. (_keybox_get_blob_fileoffset): New. * keybox-update.c (keybox_delete): Implemented.
Diffstat (limited to 'kbx/keybox-blob.c')
-rw-r--r--kbx/keybox-blob.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/kbx/keybox-blob.c b/kbx/keybox-blob.c
index 34e2c9712..48e2b5b87 100644
--- a/kbx/keybox-blob.c
+++ b/kbx/keybox-blob.c
@@ -171,6 +171,7 @@ struct fixup_list {
struct keyboxblob {
byte *blob;
size_t bloblen;
+ off_t fileoffset;
/* stuff used only by keybox_create_blob */
unsigned char *serialbuf;
@@ -956,7 +957,7 @@ _keybox_create_x509_blob (KEYBOXBLOB *r_blob, KsbaCert cert,
int
-_keybox_new_blob (KEYBOXBLOB *r_blob, char *image, size_t imagelen)
+_keybox_new_blob (KEYBOXBLOB *r_blob, char *image, size_t imagelen, off_t off)
{
KEYBOXBLOB blob;
@@ -967,6 +968,7 @@ _keybox_new_blob (KEYBOXBLOB *r_blob, char *image, size_t imagelen)
blob->blob = image;
blob->bloblen = imagelen;
+ blob->fileoffset = off;
*r_blob = blob;
return 0;
}
@@ -993,6 +995,13 @@ _keybox_release_blob (KEYBOXBLOB blob)
const char *
_keybox_get_blob_image ( KEYBOXBLOB blob, size_t *n )
{
- *n = blob->bloblen;
- return blob->blob;
+ *n = blob->bloblen;
+ return blob->blob;
}
+
+off_t
+_keybox_get_blob_fileoffset (KEYBOXBLOB blob)
+{
+ return blob->fileoffset;
+}
+