Commit Graph

136 Commits

Author SHA1 Message Date
Gustavo Sverzut Barbieri d8caade348 emile: API break, rename sha1 to hmac_sha1, introduce real sha1.
emile_binbuf_sha1() was actually doing HMAC version using the given
key. This doesn't work when all you need is just the SHA1 of the input
data.

Then rename emile_binbuf_sha1() to emile_binbuf_hmac_sha1() and
introduce a new version without key/keylen.

This API was marked as BETA and no real users in the codebase, then it
shouldn't cause us problems.
2016-08-30 00:35:17 -03:00
jiin.moon c54bd44790 emile: fix jpeg loader broken with orientation
Summary:
After applying a patch regarding region, side-effect detected.

Fixes T4390

Test Plan: make check

Reviewers: jpeg, cedric, jypark

Maniphest Tasks: T4390

Differential Revision: https://phab.enlightenment.org/D4245
2016-08-19 15:19:08 +09:00
Jean-Philippe Andre 0193e40d8c evas: Fix region test in jpeg load with region + zoom
The previous commit exposed an issue with the region test
does not take into account the scale down factor.

Not a @fix in itself, as it depends on the previous patch.
2016-08-17 17:28:53 +09:00
jiin.moon fecbcf8a90 emile: region_set does not working in jpeg loader if scale_down has set
Summary:
If both region and scale_down has set, ERR would be returned by loader of jpeg.

@fix

Test Plan: sample code

Reviewers: raster, jypark, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4200
2016-08-17 17:28:53 +09:00
Cedric BAIL dd1d3f0d2d autotools: since it has been broken for some times and nobody noticed, let's remove per directory support. 2016-08-01 13:36:47 -07:00
junsu choi 260377a376 emile: fix build warning of Emile_Image.
Summary: initialized structure 'opts_region' for uninitialized build warning

Test Plan: N/A

Reviewers: raster, woohyun, cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3993

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-05-31 14:59:26 -07:00
Cedric BAIL 66bc74bbe6 emile: make it possible to build the library alone. 2016-04-14 15:52:50 -07:00
Jean-Philippe Andre 0d41ad0c83 Emile: Move colorspaces to Efl.Gfx
A small hack to the toolchain allows us to generate enums with eolian
for use by Eet and Emile (internal or otherwise non-eo libraries).

Thanks to how BUILT_SOURCES works, the eo.h files required by Emile
will be generated before they are used.

This adds a partial dependency on eo for eet and emile:
 - package dependency
 - include dependency

There is no library link dependency.
2016-03-28 16:40:01 +09:00
Cedric BAIL bb921aff04 emile: move all eina_str_base64 to emile_base64. 2016-01-07 16:27:57 -08:00
Vincent Torri 93f45eedcf ecore_con: remove last occurence of EMILE_SSLv3
This fixes compilation on Windows

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-11 14:36:23 -08:00
Cedric BAIL 23d8d71e08 emile: deprecate the use of SSLv3 with GNUTLS backend to. 2015-11-09 10:30:00 -08:00
Cedric BAIL ae5e2c8284 emile/ecore_con: drop SSLv3 support due to security issue.
SSLv3 has been compromised a year ago by what is known as POODLE
(https://en.wikipedia.org/wiki/POODLE). Every major browser have now
dropped support for SSLv3 and distribution are starting to do so also.
It is a good timing for us to do so, especially as it breaks build on
some distribution.
2015-11-02 14:22:42 -08:00
Jean-Philippe Andre cc5cccc511 Eet: fix decoding of embedded ETC images
Typos, lack of NULL check, excessive sizeof(type) not matching
the object type, no border set, etc... This all lead to a crash
and then no render (with an error message and then without...).

This also simplifies the implicit loading of ETC1 as ETC2 when
supported by the driver.

@fix
2015-10-29 17:58:34 +09:00
Jean-Philippe Andre e5dbc21119 Emile: Allow load of ETC images if region = whole image
@fix
2015-10-29 17:58:34 +09:00
Cedric BAIL 573438d081 emile: fix typos catched by coverity.
CID1328666
2015-10-22 16:56:39 -07:00
Srivardhan Hebbar 444a0b11bc emile: handling memory leak on realloc.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: cedric

Differential Revision: https://phab.enlightenment.org/D3210

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-22 12:20:55 -07:00
Cedric BAIL 508143efba emile: prevent segv when rotation is asked and there is no opts provided.
Thanks Vivek for pointing the problem.

@fix
2015-10-22 11:31:06 -07:00
Stefan Schmidt 10c8650b1e emile: remove dead code
This seems to come from some intention to fetch dh from openssl somewhow but
it was never implemented. fh always stays 0 since its init and thus we can
remove the code it guards.

CID: 1288930
2015-10-21 14:37:18 +02:00
jiin.moon 95467e5707 emile: fix can not check ifd offset of jpeg in MM(little endian) format
IFD offset is 4 byte.
But just one byte is checked for it in previous patch.

Reviewers: Hermet, jypark, cedric

Reviewed By: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3053

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-09-21 23:44:52 +02:00
ChunEon Park e656dde568 emile jpeg: more descriptive comment. 2015-08-29 00:59:06 +09:00
jiin.moon 1073774d8e emile: fix can not parsing the EXIF info of the jpeg file which has IFD offset
Summary:
IFD offset of jpeg is not fixed.
But emile support only 0x8 on now

Reviewers: jypark, cedric, Hermet

Reviewed By: Hermet

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3000
2015-08-29 00:47:43 +09:00
Stefan Schmidt ef81feff16 emile: Init ptrag as it might get used uninitialized if not
lib/emile/emile_image.c:2099:49: warning: 'ptrag' may be used uninitialized in this function [-Wmaybe-uninitialized]
2015-06-08 17:09:38 +02:00
jiin.moon 63a12d7d26 emile: fix region load for jpeg image with orientation different set.
Summary:
If you try to load the jpeg image with an orientation mode defined
using elm_photocam, you can see the broken image(in canse of 90 degree)
or even segmentation fault can happen (in case of 180,270 degree)

@fix

Test Plan: photocam menu on elementary_test

Reviewers: Hermet, cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2593

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-06-03 13:46:44 +02:00
Cedric BAIL fe6f394dab emile: remove the need to order the header correctly for Windows. 2015-05-07 09:53:10 +02:00
Cedric BAIL 97e24931e3 emile: correctly free buffer allocated for compressed image.
CID 1295688
2015-04-26 09:38:13 +02:00
Cedric BAIL eaf9822094 emile: fix memory leak.
CID 1288918 & 1288919
2015-04-25 20:00:44 +02:00
Cedric BAIL 888057f0bc emile: fix memory leak.
CID 1288924 & 1288923
2015-04-25 19:27:20 +02:00
Cedric BAIL 5d59a403cd emile: fix typo. 2015-04-25 19:08:36 +02:00
Cedric BAIL 5010daa31e emile: opts can be NULL, so checking it before using it.
CID 1288927
2015-04-25 18:58:30 +02:00
Cedric BAIL 1c597b4373 emile: check that we actually do have option before using them.
CID 1288929
2015-04-25 18:52:22 +02:00
Cedric BAIL bb963f274b emile: fix support of AGRY88.
CID 1288931
2015-04-25 18:26:58 +02:00
Chris Michael 820eca333e emile: Fix resource leak
Summary: This fixes Coverity CID1288919 where buffer variable was
being leaked if emile failed to load the image due to corrupt file.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-20 13:13:55 -04:00
Chris Michael 843d4705d8 emile: Fix resource leak
Summary: This fixes Coverity CID1288918 where data_start variable was
being leaked if the rectangles did not intersect.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-20 13:06:41 -04:00
Jean-Philippe Andre 755b290404 Emile: Reduce ERR logs on invalid JPEG images
When reading the head of a file, we may get the error that it is
not a JPEG image (which is normal), so we should not print any ERR.

The JPEG header read function can indeed be called to test whether a
file can be opened by the JPEG loader or not (any file).

Note that JPEG files don't have reliable magic numbers, so we
don't check them, but rely on libjpeg instead.

Fixes T2290
2015-04-15 10:49:43 +09:00
Jean-Philippe Andre ced11e92a8 Emile image: Fix decoding of ETC1+Alpha images
This bug is probably a copy&paste issue when writing emile.
2015-04-14 16:37:12 +09:00
Jean-Philippe Andre 18d5e04bb5 Emile image: Fix TGV (ETC1,2) loader
The error was not reset to NONE even in case of success.
2015-04-07 14:40:00 +09:00
Cedric BAIL 671bd817bf emile: meaningful initialization of some pointers. 2015-03-23 22:04:15 +01:00
jiin.moon 34d92d4d1e emile: Remove unnecessary check in _emile_jpeg_head function
Summary: Already checked it by "else if ((opts->w > 0) && (opts->h > 0))"

Reviewers: cedric, Hermet

Reviewed By: Hermet

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2199
2015-03-20 14:02:58 +09:00
Cedric BAIL f875f759ca emile: fix coding style with ecrustify. 2015-03-17 09:58:21 +01:00
Cedric BAIL aa3b6615ee emile: add a note regarding useless structure member. 2015-03-17 09:58:21 +01:00
Cedric BAIL 5412be48e1 emile: remove use of deprecated eina binbuf function. 2015-03-17 09:58:21 +01:00
Cedric BAIL a446624f5f emile: make sure given boolean are really boolean. 2015-03-17 09:58:20 +01:00
Cedric BAIL 90d8932a03 emile: remove binbuf from emile compression functions. 2015-03-17 09:58:20 +01:00
Cedric BAIL 75cd6d3628 emile: use Eina_Log for Jpeg error message. 2015-03-17 09:58:20 +01:00
Cedric BAIL 0fc4091b8c emile: update to latest GNUTLS/GCRYPT API. 2015-03-17 09:58:20 +01:00
Vincent Torri 987607a3c2 emile: fix some warnings in gnutls component 2015-03-17 09:58:20 +01:00
Vincent Torri ce394fae95 emile: ERROR is a macro already defined on Windows 2015-03-17 09:58:20 +01:00
Vincent Torri e86b314971 emile: fix emile_binbuf_sha1() signature when no cipher is used 2015-03-17 09:58:20 +01:00
Vincent Torri 26708e0818 emile: fix array count 2015-03-17 09:58:20 +01:00
Cedric BAIL 065f87bd15 emile: cleanup comments and internal functions name. 2015-03-17 09:58:20 +01:00
Cedric BAIL 6e59828f74 emile: cleanup private header. 2015-03-17 09:58:20 +01:00
Cedric BAIL 4a84267d86 emile: cleanup header from useless cruft. 2015-03-17 09:58:20 +01:00
Cedric BAIL a2385e2ebc emile: follow convention for Emile_Compressor_Level. 2015-03-17 09:58:20 +01:00
Cedric BAIL bbf7ab1cc4 emile: normalize compression header. 2015-03-17 09:58:20 +01:00
Cedric BAIL 4b4bdd9723 emile: normalize version number to 1.14. 2015-03-17 09:58:20 +01:00
Cedric BAIL df20c9ff8e emile: implement emile_cipher_module_get in a useful way. 2015-03-17 09:58:20 +01:00
Cedric BAIL f4c5b3fd70 emile: document the stable cipher function. 2015-03-17 09:58:20 +01:00
Cedric BAIL d6a2f0cad5 emile: actually this set of function are neat enough to be a public API. 2015-03-17 09:58:20 +01:00
Cedric BAIL 8f3ec959b9 emile: change the API to allow supporting other cipher in the future. 2015-03-17 09:58:19 +01:00
Cedric BAIL d32f310a92 emile: mark ssl layer as a beta API for now. 2015-03-17 09:58:19 +01:00
Cedric BAIL 97e3f55de5 emile: document Emile_Image. 2015-03-17 09:58:19 +01:00
Cedric BAIL 8fd9770d95 emile: reduce code duplication between gnutls and openssl backend.
Add a visible emile_binbuf_sha1 implementation and deduplicate
emile_pbkdf2_sha1 (but does not explicitely expose it).
2015-03-17 09:58:19 +01:00
Cedric BAIL d4d22ca5ea emile: remove ambiguity especially for Windows platform.
Thanks Vincent Torri for the review.
2015-03-17 09:58:19 +01:00
Cedric BAIL 2734fde87f emile: add documentation for compression function. 2015-03-17 09:58:19 +01:00
Cedric BAIL 274be9ac24 emile: use an enum for level instead of just an int. 2015-03-17 09:58:19 +01:00
Cedric BAIL 49f017926a emile: update documentation version. 2015-03-17 09:58:19 +01:00
Cedric BAIL 2cd4e1764d emile: split headers. 2015-03-17 09:58:19 +01:00
Cedric BAIL a88f0074d7 emile: handle AGRY88 for JPEG image. 2015-03-17 09:58:19 +01:00
Cedric BAIL bafe5e9a74 emile: decode GRAY JPEG as GRY8. 2015-03-17 09:58:19 +01:00
Cedric BAIL 1a8384cd3c emile: simplify error handling for jpeg data decoding. 2015-03-17 09:58:18 +01:00
Cedric BAIL 4ca8bfd15c emile: add JPEG support. 2015-03-17 09:58:18 +01:00
Cedric BAIL a865d41181 emile: remove use of custom structure and prefer Eina_Rectangle.
Get rid of warning inside of the jpeg loader that result of it. I do believe
this is not an ABI break on the loader API. If you disagree, please raise your
voice.
2015-03-17 09:58:18 +01:00
Cedric BAIL d40dad8f73 emile: initial addition of emile image support. 2015-03-17 09:58:18 +01:00
Cedric BAIL 3e6858dc2b emile: trying to fix security. 2015-03-17 09:58:18 +01:00
Cedric BAIL a089d8cd7b emile: Add SSL support. 2015-03-17 09:58:18 +01:00
Cedric BAIL ee57de59c2 emile: remove left over #ifdef 2015-03-17 09:58:18 +01:00
Cedric BAIL e649992bff emile: make the initialization part of backend cipher file to. 2015-03-17 09:58:18 +01:00
Cedric BAIL 10184ca860 emile: split OpenSSL, GNUTLS and no cipher into separate file as a first step toward module. 2015-03-17 09:58:18 +01:00
Cedric BAIL c3a1859e59 emile: make it cross platform. 2015-03-17 09:58:18 +01:00
Cedric BAIL 32c5f691c8 emile: make cipher initialization optional. 2015-03-17 09:58:17 +01:00
Cedric BAIL f9dd639a92 eet: use Emile instead of Zlib and LZ4 directly. 2015-03-17 09:58:17 +01:00
Cedric BAIL 0fa50a0804 emile: add compress/uncompress logic. 2015-03-17 09:58:17 +01:00
Cedric BAIL 2e34d835d6 emile: expose cipher/uncipher block logic. 2015-03-17 09:58:17 +01:00
Cedric BAIL cc88832353 ecore_con: depend on emile for initializing crypto library. 2015-03-17 09:58:17 +01:00
Cedric BAIL 2d342c2814 emile: move GNUTLS and OpenSSL initialization logic from Eet to Emile. 2015-03-17 09:58:17 +01:00
Cedric BAIL 0b04186a7f emile: initial introduction of Emile.
The intent of Emile is to be the common layer for serialisation, compression
and ciphering. It will expose the library we currently use internally to an
easier use from the outside (like gcrypt and lz4). It should improve portability.
Instead of pushing JSON, XML and what's not to Eina, I do think that they will
fit better in Emile.

As for the naming of Emile, you will need to be French and say :
"Un quoi ?" "Un serializer !"

Regarding why it is put there in the stack. Right now there is two users of
compression (eet and terminology), two users of cipher library (eet and ecore_con)
and a few handful of user for serialization (eina, eet, efreet, ecore_con, ...).
So the choice was quite simple, it needed to be below Eet. Now it could have been
on top of Eo or integrated into Eina.

One of the use case I am thinking of, is to compress Eo object when a canvas get
hidden/minized. For that it require Eo to use that library and it can't be a higher
level object. And with current implementation of Eo it is perfectly possible to
implement such idea. So not at Eo level.

As for Eina, I am starting to think it is getting to much things in its namespace.
I do believe that infact Eina_Simple_XML and Eina_File should after all have landed
in their own library. That's why I am putting the current logic in a new library.
It is going to expand, I want it to provide an few SAX like parser for JSON,
Eet_Data and protobuf with also an API like Eet_Data to directly feed those value
into a C structure without using a DOM at all. It would also be the right place
to experiment and benchmark for a new Eet_Data format that could be more efficient
to use.

So at the end, and due to how I see things going and being used, I do think it
is better of in its own library.
2015-03-17 09:58:17 +01:00