*/
EAPI const void *eet_identity_x509(Eet_File *ef, int *der_length);
+ /**
+ * Get the raw signature associated with an Eet_File. Will return NULL
+ * if the file is not signed.
+ */
+ EAPI const void *eet_identity_signature(Eet_File *ef, int *signature_length);
+
/**
* Display the x509 der certificate to out.
*
const void* eet_identity_check(const void *data_base, unsigned int data_length,
const void *signature_base, unsigned int signature_length,
+ const void **raw_signature_base, unsigned int *raw_signature_length,
int *x509_length);
Eet_Error eet_cipher(const void *data, unsigned int size, const char *key, unsigned int length, void **result, unsigned int *result_length);
Eet_Error eet_decipher(const void *data, unsigned int size, const char *key, unsigned int length, void **result, unsigned int *result_length);
const void*
eet_identity_check(const void *data_base, unsigned int data_length,
const void *signature_base, unsigned int signature_length,
+ const void **raw_signature_base, unsigned int *raw_signature_length,
int *x509_length)
{
#ifdef HAVE_SIGNATURE
return NULL;
# endif
if (x509_length) *x509_length = cert_len;
+ if (raw_signature_base) *raw_signature_base = sign;
+ if (raw_signature_length) *raw_signature_length = sign_len;
return cert_der;
#else
return NULL;
Eet_Key *key;
const unsigned char *data;
const void *x509_der;
+ const void *signature;
+
+ Eet_File_Mode mode;
int magic;
int references;
- Eet_File_Mode mode;
int data_size;
int x509_length;
+ unsigned int signature_length;
+
time_t mtime;
unsigned char writes_pending : 1;
/* Check if the file is signed */
ef->x509_der = NULL;
ef->x509_length = 0;
+ ef->signature = NULL;
+ ef->signature_length = 0;
+
if (signature_base_offset < ef->data_size)
{
#ifdef HAVE_SIGNATURE
const unsigned char *buffer = ((const unsigned char*) ef->data) + signature_base_offset;
ef->x509_der = eet_identity_check(ef->data, signature_base_offset,
buffer, ef->data_size - signature_base_offset,
+ &ef->signature, &ef->signature_length,
&ef->x509_length);
if (eet_test_close(ef->x509_der == NULL, ef)) return NULL;
return ef->x509_der;
}
+EAPI const void *
+eet_identity_signature(Eet_File *ef, int *signature_length)
+{
+ if (!ef->signature) return NULL;
+
+ if (signature_length) *signature_length = ef->signature_length;
+ return ef->signature;
+}
+
EAPI Eet_Error
eet_identity_set(Eet_File *ef, Eet_Key *key)
{