diff --git a/ChangeLog b/ChangeLog index 0cfd515511..86f91a91d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,16 @@ +2012-09-27 Patryk Kaczmarek + + * Add eet file handle null checks to eet_data_write_cipher(), + eet_data_descriptor_decode_cipher(), + eet_data_descriptor_encode_cipher(), eet_data_xattr_cipher_get(), + eet_data_xattr_cipher_set(). + 2012-09-27 Carsten Haitzler (The Rasterman) * Fix return value of eina_mmap_safety_enabled_set() and ensure future eina_mmap_safety_enabled_get() return right value on success. - + 2012-09-21 Carsten Haitzler (The Rasterman) * Fix big endian bug with eet image handling and endianess swapping. diff --git a/src/lib/eet/Eet.h b/src/lib/eet/Eet.h index 05f80e959f..fccfc1842b 100644 --- a/src/lib/eet/Eet.h +++ b/src/lib/eet/Eet.h @@ -1821,6 +1821,7 @@ typedef int (*Eet_Key_Password_Callback)(char *buffer, int size, int rwflag, voi * * @see eet_identity_close() * + * @warning You need to compile signature support in EET. * @since 1.2.0 * @ingroup Eet_Cipher_Group */ @@ -1863,6 +1864,7 @@ eet_identity_set(Eet_File *ef, * @param key the handle to print. * @param out where to print. * + * @warning You need to compile signature support in EET. * @since 1.2.0 * @ingroup Eet_Cipher_Group */ @@ -1922,6 +1924,7 @@ eet_identity_sha1(Eet_File *ef, * @param der_length The length the certificate. * @param out where to print. * + * @warning You need to compile signature support in EET. * @since 1.2.0 * @ingroup Eet_Cipher_Group */ diff --git a/src/lib/eet/eet_data.c b/src/lib/eet/eet_data.c index d06d3eaceb..9c9dc8ceec 100644 --- a/src/lib/eet/eet_data.c +++ b/src/lib/eet/eet_data.c @@ -2149,6 +2149,8 @@ eet_data_write_cipher(Eet_File *ef, int size; int val; + EINA_SAFETY_ON_NULL_RETURN_VAL(edd, 0); + ed = eet_dictionary_get(ef); data_enc = _eet_data_descriptor_encode(ed, edd, data, &size); @@ -4737,6 +4739,8 @@ eet_data_descriptor_decode_cipher(Eet_Data_Descriptor *edd, Eet_Free_Context context; unsigned int deciphered_len = size_in; + EINA_SAFETY_ON_NULL_RETURN_VAL(edd, NULL); + if (cipher_key && data_in) if (eet_decipher(data_in, size_in, cipher_key, strlen(cipher_key), &deciphered, &deciphered_len)) @@ -4938,6 +4942,8 @@ eet_data_descriptor_encode_cipher(Eet_Data_Descriptor *edd, unsigned int ciphered_len = 0; int size; + EINA_SAFETY_ON_NULL_RETURN_VAL(edd, NULL); + ret = _eet_data_descriptor_encode(NULL, edd, data_in, &size); if (cipher_key && ret) { @@ -4983,6 +4989,8 @@ eet_data_xattr_cipher_get(const char *filename, void *ret; ssize_t size; + EINA_SAFETY_ON_NULL_RETURN_VAL(edd, NULL); + blob = eina_xattr_get(filename, attribute, &size); if (!blob) return NULL; @@ -5004,6 +5012,8 @@ eet_data_xattr_cipher_set(const char *filename, int size; Eina_Bool ret; + EINA_SAFETY_ON_NULL_RETURN_VAL(edd, EINA_FALSE); + blob = eet_data_descriptor_encode_cipher(edd, data, cipher_key, &size); if (!blob) return EINA_FALSE;