aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/hmac
Commit message (Collapse)AuthorAgeFilesLines
* #4342: few missing malloc return checks and free in error pathsJ Mohan Rao Arisankala2016-05-231-6/+18
| | | | | | | | | | | | | ossl_hmac_cleanup, pkey_hmac_cleanup: - allow to invoke with NULL data - using EVP_PKEY_CTX_[get|set]_data EVP_DigestInit_ex: - remove additional check for ‘type’ and doing clear free instead of free Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Copyright consolidation 07/10Rich Salz2016-05-174-216/+23
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* const correctness: make HMAC_size() take a const *Steffan Karger2016-05-161-1/+1
| | | | | | | | | CLA: none; trivial Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1070
* Remove --classic build entirelyRichard Levitte2016-04-201-43/+0
| | | | | | | | 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>
* Remove the remainder of util/mk1mf.pl and companion scriptsRichard Levitte2016-03-211-3/+0
| | | | | | | This removes all scripts that deal with MINFO as well, since that's only used by mk1mf. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Use utility functions for HMAC and CMAC.Dr. Stephen Henson2016-03-021-15/+4
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Always build library object files with shared library cflagsRichard Levitte2016-02-201-1/+1
| | | | | | | | | | | | | | | | This takes us away from the idea that we know exactly how our static libraries are going to get used. Instead, we make them available to build shareable things with, be it other shared libraries or DSOs. On the other hand, we also have greater control of when the shared library cflags. They will never be used with object files meant got binaries, such as apps/openssl or test/test*. With unified, we take this a bit further and prepare for having to deal with extra cflags specifically to be used with DSOs (dynamic engines), libraries and binaries (applications). Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove all special make depend flags, as well as OPENSSL_DOING_MAKEDEPENDRichard Levitte2016-02-181-1/+1
| | | | | | | | | | All those flags existed because we had all the dependencies versioned in the repository, and wanted to have it be consistent, no matter what the local configuration was. Now that the dependencies are gone from the versioned Makefile.ins, it makes much more sense to use the exact same flags as when compiling the object files. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix mismatched curly braceDmitry-Me2016-02-171-0/+4
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* GH641: Don't care openssl_zmallocRich Salz2016-02-081-3/+5
| | | | | | | | Don't cast malloc-family return values. Also found some places where (a) blank line was missing; and (b) the *wrong* return value was checked. Reviewed-by: Richard Levitte <levitte@openssl.org>
* RT3095: allow NULL key for single-shot HMACEmilia Kasper2016-02-041-0/+7
| | | | | | | In HMAC_Init_ex, NULL key signals reuse, but in single-shot HMAC, we can allow it to signal an empty key for convenience. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* unified build scheme: add build.info filesRichard Levitte2016-02-011-0/+3
| | | | | | | | | Now that we have the foundation for the "unified" build scheme in place, we add build.info files. They have been generated from the Makefiles in the same directories. Things that are platform specific will appear in later commits. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Templatize util/domdRich Salz2016-01-291-2/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove /* foo.c */ commentsRich Salz2016-01-262-2/+0
| | | | | | | | | | | | This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Remove update tagsRich Salz2016-01-201-2/+0
| | | | | Also remove depend/local_depend. Reviewed-by: Richard Levitte <levitte@openssl.org>
* make EVP_PKEY opaqueDr. Stephen Henson2016-01-201-2/+2
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove some old makefile targetsRich Salz2016-01-171-12/+0
| | | | | | | | Remove lint, tags, dclean, tests. This is prep for a new makedepend scheme. This is temporary pending unified makefile, and might help it. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Move Makefiles to Makefile.inRich Salz2016-01-122-99/+61
| | | | | | | | | | Create Makefile's from Makefile.in Rename Makefile.org to Makefile.in Rename Makefiles to Makefile.in Address review feedback from Viktor and Richard Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* make updateRichard Levitte2016-01-121-27/+29
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Backwards-compatibility subject to OPENSSL_API_COMPATViktor Dukhovni2016-01-071-1/+2
| | | | | | | | | Provide backwards-compatiblity for functions, macros and include files if OPENSSL_API_COMPAT is either not defined or defined less than the version number of the release in which the feature was deprecated. Reviewed-by: Richard Levitte <levitte@openssl.org>
* make updateDr. Stephen Henson2015-12-091-1/+0
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove typedef of HMAC_CTX from crypto/hmac/hmac_lcl.hRichard Levitte2015-12-071-2/+2
| | | | | | This is already defined in include/openssl/ossl_typ.h. Reviewed-by: Matt Caswell <matt@openssl.org>
* make updateRichard Levitte2015-12-071-0/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Cleanup: fix all sources that used HMAC_CTX_initRichard Levitte2015-12-071-2/+2
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Cleanup: rename HMAC_CTX_init to HMAC_CTX_resetRichard Levitte2015-12-071-2/+2
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Cleanup: fix all sources that used EVP_MD_CTX_(create|init|destroy)Richard Levitte2015-12-071-9/+9
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove HMAC_CTX_cleanup and combine its functionality into EVP_MD_CTX_initRichard Levitte2015-12-071-17/+17
| | | | | | | This follows the same idea as the combination of EVP_MD_CTX_cleanup and EVP_MD_CTX_init into one function. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Make the definition of HMAC_CTX opaqueRichard Levitte2015-12-073-15/+118
| | | | | | | This moves the definition to crypto/hmac/hmac_lcl.h. Constructor and destructor added, and the typedef moved to include/openssl/ossl_typ.h. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Adapt HMAC to the EVP_MD_CTX changesRichard Levitte2015-12-072-36/+60
| | | | | | | | | | | | | This change required some special treatment, as HMAC is intertwined with EVP_MD. For now, all local HMAC_CTX variables MUST be initialised with HMAC_CTX_EMPTY, or whatever happens to be on the stack will be mistaken for actual pointers to EVP_MD_CTX. This will change as soon as HMAC_CTX becomes opaque. Also, since HMAC_CTX_init() can fail now, its return type changes from void to int, and it will return 0 on failure, 1 on success. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Continue standardising malloc style for libcryptoMatt Caswell2015-11-092-2/+2
| | | | | | | Continuing from previous commit ensure our style is consistent for malloc return checks. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* Fix memory leaks and other mistakes on errorsAlessandro Ghedini2015-10-231-2/+7
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* remove 0 assignments.Rich Salz2015-09-031-5/+2
| | | | | | | After openssl_zalloc, cleanup more "set to 0/NULL" assignments. Many are from github feedback. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Fix ABI break with HMACMatt Caswell2015-06-121-12/+8
| | | | | | | | | Recent HMAC changes broke ABI compatibility due to a new field in HMAC_CTX. This backs that change out, and does it a different way. Thanks to Timo Teras for the concept. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix leak in HMAC error pathMatt Caswell2015-06-101-0/+1
| | | | | | | | | In the event of an error in the HMAC function, leaks can occur because the HMAC_CTX does not get cleaned up. Thanks to the BoringSSL project for reporting this issue. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix the update target and remove duplicate file updatesRichard Levitte2015-05-221-0/+2
| | | | | | | | | | | | | | | We had updates of certain header files in both Makefile.org and the Makefile in the directory the header file lived in. This is error prone and also sometimes generates slightly different results (usually just a comment that differs) depending on which way the update was done. This removes the file update targets from the top level Makefile, adds an update: target in all Makefiles and has it depend on the depend: or local_depend: targets, whichever is appropriate, so we don't get a double run through the whole file tree. Reviewed-by: Rich Salz <rsalz@openssl.org>
* make dependRichard Levitte2015-05-141-4/+5
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Identify and move common internal libcrypto header filesRichard Levitte2015-05-143-3/+3
| | | | | | | | | | | | | There are header files in crypto/ that are used by a number of crypto/ submodules. Move those to crypto/include/internal and adapt the affected source code and Makefiles. The header files that got moved are: crypto/cryptolib.h crypto/md32_common.h Reviewed-by: Rich Salz <rsalz@openssl.org>
* Use "==0" instead of "!strcmp" etcRich Salz2015-05-061-2/+2
| | | | | | | For the various string-compare routines (strcmp, strcasecmp, str.*cmp) use "strcmp()==0" instead of "!strcmp()" Reviewed-by: Tim Hudson <tjh@openssl.org>
* Use safer sizeof variant in mallocRich Salz2015-05-042-2/+2
| | | | | | | | | | | | | For a local variable: TYPE *p; Allocations like this are "risky": p = OPENSSL_malloc(sizeof(TYPE)); if the type of p changes, and the malloc call isn't updated, you could get memory corruption. Instead do this: p = OPENSSL_malloc(sizeof(*p)); Also fixed a few memset() calls that I noticed while doing this. Reviewed-by: Richard Levitte <levitte@openssl.org>
* free cleanup almost the finaleRich Salz2015-04-301-6/+2
| | | | | | | | | | Add OPENSSL_clear_free which merges cleanse and free. (Names was picked to be similar to BN_clear_free, etc.) Removed OPENSSL_freeFunc macro. Fixed the small simple ones that are left: CRYPTO_free CRYPTO_free_locked OPENSSL_free_locked Reviewed-by: Richard Levitte <levitte@openssl.org>
* Code style: space after 'if'Viktor Dukhovni2015-04-161-6/+6
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Remove EXHEADER, TEST, APPS, links:, install: and uninstall: where relevantRichard Levitte2015-03-311-17/+1
| | | | | | | | | | | | With no more symlinks, there's no need for those variables, or the links target. This also goes for all install: and uninstall: targets that do nothing but copy $(EXHEADER) files, since that's now taken care of by the top Makefile. Also, removed METHTEST from test/Makefile. It looks like an old test that's forgotten... Reviewed-by: Rich Salz <rsalz@openssl.org>
* Stop symlinking, move files to intended directoryRichard Levitte2015-03-312-430/+0
| | | | | | | | | | | | | Rather than making include/openssl/foo.h a symlink to crypto/foo/foo.h, this change moves the file to include/openssl/foo.h once and for all. Likewise, move crypto/foo/footest.c to test/footest.c, instead of symlinking it there. Originally-by: Geoff Thorpe <geoff@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix HMAC to pass invalid key len testMatt Caswell2015-03-251-1/+2
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add HMAC test for invalid key lenMatt Caswell2015-03-251-0/+5
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Ensure that both the MD and key have been initialised before attempting toMatt Caswell2015-03-252-3/+21
| | | | | | | | create an HMAC Inspired by BoringSSL commit 2fe7f2d0d9a6fcc75b4e594eeec306cc55acd594 Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add more HMAC testsMatt Caswell2015-03-251-7/+162
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* make dependDr. Stephen Henson2015-03-241-3/+3
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Move some EVP internals to evp_int.hDr. Stephen Henson2015-03-241-1/+1
| | | | | | Move EVP internals to evp_int.h, remove -Ievp hack from crypto/Makefile Reviewed-by: Matt Caswell <matt@openssl.org>
* Move some ASN.1 internals to asn1_int.hDr. Stephen Henson2015-03-241-1/+1
| | | | | | | | Move ASN.1 internals used across multiple directories into new internal header file asn1_int.h remove crypto/Makefile hack which allowed other directories to include "asn1_locl.h" Reviewed-by: Matt Caswell <matt@openssl.org>