summaryrefslogtreecommitdiffstats
path: root/engines/afalg
AgeCommit message (Collapse)Author
2018-03-27Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2018-02-07Make all private functions in e_afalg.c staticRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5273)
2017-10-31afalg: Fix kernel version checkBaptiste Jonglez
The check should reject kernel versions < 4.1.0, not <= 4.1.0. The issue was spotted on OpenSUSE 42.1 Leap, since its linux/version.h header advertises 4.1.0. CLA: trivial Fixes: 7f458a48 ("ALG: Add AFALG engine") Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4618)
2017-10-31afalg: Use eventfd2 syscall instead of eventfdBaptiste Jonglez
The eventfd syscall is deprecated and is not available on aarch64, causing build to fail: engines/e_afalg.c: In function 'eventfd': engines/e_afalg.c:108:20: error: '__NR_eventfd' undeclared (first use in this function) return syscall(__NR_eventfd, n); ^ Instead, switch to the newer eventfd2 syscall, which is supposed to be supported by all architectures. This kind of issues would be avoided by simply using the eventfd(2) wrapper from the libc, but there must be subtle reasons not to... Tested on a aarch64 system running OpenSUSE Leap 42.1 (gcc118 from https://cfarm.tetaneutral.net/machines/list/ ) and also cross-compiling for aarch64 with LEDE (kernel 4.9). This properly fixes #1685. CLA: trivial Fixes: 7f458a48 ("ALG: Add AFALG engine") Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4618)
2017-04-01e_afalg.[ch]: fix --strict-warnings with gcc 4.x and 32-bit build.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit c27778d8adf7fca3128ece0b7efca09f628008b9)
2016-12-16e_afalg: Don't warn about kernel version when pedanticRichard Levitte
When built with --strict-warnings and the Linux kernel headers don't match the kernel version, the preprocessor warnings in engines/afalg/e_afalg.c cause compilation errors. Use the macro PEDANTIC to avoid those warnings in that case. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2095) (cherry picked from commit 97043e46aa7083c787a1efd72ac31ca97ed41610)
2016-11-24Fix a missing function prototype in AFALG engineMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit a1fd1fb241069cc987d0d2cf13880bd16cada3c9)
2016-10-14Engine afalg: properly set operation type also on big endian.Tomas Mraz
Copy the whole ALG_OP_TYPE to CMSG_DATA. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 574cffd5d5b8f57f811c8d36d930205041deedee)
2016-09-08engines/afalg: make it compile with backward compatibility headers.Andy Polyakov
Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 4e3997293b3825ed19de20d5484f8c0f66fce534)
2016-08-15Avoid truncating the pointer on x32 platform.Tomas Mraz
The 64 bit pointer must not be cast to 32bit unsigned long on x32 platform. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-08-15Add a comment for the added cast with explanation.Tomas Mraz
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-08-15Fix af_alg engine failure on 32 bit architectures.Tomas Mraz
Add extra cast to unsigned long to avoid sign extension when converting pointer to 64 bit data. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-07-01Simplify INCLUDE statements in build.info filesRichard Levitte
Now that INCLUDE considers both the source and build trees, no need for the rel2abs perl fragment hacks any more. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-13Handle inability to create AFALG socketMatt Caswell
Some Linux platforms have a suitably recent kernel to support AFALG, but apparently you still can't actually create an afalg socket. This extends the afalg_chk_platform() function to additionally check whether we can create an AFALG socket. We also amend the afalgtest to not report a failure to load the engine as a test failure. A failure to load is almost certainly due to platform environmental issues, and not an OpenSSL problem. RT 4434 Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-06-08Fixes to get -ansi workingJeffrey Walton
Various fixes to get the following to compile: ./config no-asm -ansi -D_DEFAULT_SOURCE RT4479 RT4480 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-05-25build.info files: add quotes around any spec that may contain spacesRichard Levitte
RT#4492 Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-05-24GH919: Fix wrappers for two headersRich Salz
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-05-17Manual fixes after copyright consolidationRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-17Copyright consolidation 02/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-11typoDr. Stephen Henson
RT#4442 Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-04-20Remove --classic build entirelyRichard Levitte
The Unix build was the last to retain the classic build scheme. The new unified scheme has matured enough, even though some details may need polishing. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-04-14Fix AFALG kernel and headers mismatch problemMatt Caswell
During Configure we attempt to check the kernel version of this platform to see whether we can compile the AFALG engine. If the kernel version looks recent enough then we enable AFALG. However when we compile e_afalg.c we check the version of the linux headers. If there is a mismatch between the linux headers and the currently running kernel then we don't compile the AFLAG engine and continue. This was causing a link error. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-13Rename int_*() functions to *_int()Matt Caswell
There is a preference for suffixes to indicate that a function is internal rather than prefixes. Note: the suffix is only required to disambiguate internal functions and public symbols with the same name (but different case) Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-13Rename lots of *_intern or *_internal function to int_*Matt Caswell
There was a lot of naming inconsistency, so we try and standardise on one form. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-21Remove the remainder of util/mk1mf.pl and companion scriptsRichard Levitte
This removes all scripts that deal with MINFO as well, since that's only used by mk1mf. Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-03-18Fix no-deprecatedMatt Caswell
The no-deprecated build was failing because afalg was relying on a transitive include that does not exist in a no-deprecated build. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-10Fix a memory leak in the afalg engineMatt Caswell
The AFALG engine created a global EVP_CIPHER instance but was not freeing it up when the engine was destroyed. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-09Don't add afalg engine if configured "no-engine"Richard Levitte
Also, indent a little deeper, for clarity. Reviewed-by: Matt Caswell <matt@openssl.org>
2016-03-07Rename EVP_CIPHER_CTX_cipher_data to EVP_CIPHER_CTX_get_cipher_dataMatt Caswell
We had the function EVP_CIPHER_CTX_cipher_data which is newly added for 1.1.0. As we now also need an EVP_CIPHER_CTX_set_cipher_data it makes more sense for the former to be called EVP_CIPHER_CTX_get_cipher_data. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Fix the build tree include directory for afalg engineRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Fix some clang warningsMatt Caswell
The af_alg engine and associated test were creating warnings when compiled with clang. This fixes it. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-07Adding afalg testclucey
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-03-07Misc afalg build fixesMatt Caswell
Misc afalg build fixes as suggested by Richard Levitte for the latest Configure changes. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-07Rework based on feedback:clucey
1. Cleaned up eventfd handling 2. Reworked socket setup code to allow other algorithms to be added in future 3. Fixed compile errors for static build 4. Added error to error stack in all cases of ALG_PERR/ALG_ERR 5. Called afalg_aes_128_cbc() from bind() to avoid race conditions 6. Used MAX_INFLIGHT define in io_getevents system call 7. Coding style fixes Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-03-07ALG: Add AFALG engineclucey
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>