Commit Graph

10 Commits

Author SHA1 Message Date
Simon Wilkinson
2d84fc65bb hcrypto: Make more buffers persist across HMAC operations
If we don't change MD algorithm across two calls to HMAC_Init_ex
using the same context, don't bother reallocating all of our buffers.
2018-05-23 09:54:27 -04:00
Simon Wilkinson
c1eb9828f4 hcrypto: Add HMAC_CTX_new and HMAC_CTX_free
Add a pair of functions which can be used to allocate and free
an HMAC_CTX structure on the heap. This means that the caller doesn't
need to know the size of the underlying structure.
2018-05-23 09:54:27 -04:00
Jeffrey Altman
0f97855826 hcrypto: config/roken cleanup
All source files in lib/hcrypto should be built the same way.
Since this source directory is dependent on libroken then all source
files must be built using the roken.h declarations and included headers.

Also, there is no config.h in the local directory so angle brackets
include of quotes should be used.

Finally, because roken.h includes stdio.h, stdlib.h, stdarg.h, limits.h,
strings.h, sys/types.h, etc., do not include them separately.

Start all source files with

  #include <config.h>
  #include <roken.h>

Change-Id: I09ab47f8a5472018efe6c8b59a0e51fde8f24724
2016-04-10 17:05:07 -05:00
Andrew Tridge
6bff49a89d memset the right length of the {i,o}pad data, memset opad not ipad in the opad case (typo)
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-03-18 10:59:51 -07:00
Love Hornquist Astrand
2ac04069b6 If the context already have a EVP_MD_CTX allocated, don't make a new
Patch from Derrick Pallas of Riverbed Techology
2009-10-16 16:40:49 -07:00
Love Hörnquist Åstrand
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand
84b1e01eea add missing (c)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22658 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-02-26 13:13:07 +00:00
Love Hörnquist Åstrand
e8950bc2ae (HMAC_Init_ex): also zero out key material on re-init.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21391 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-30 08:04:00 +00:00
Love Hörnquist Åstrand
7ba2b2006c rename des to hcrypto
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20466 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-20 08:29:05 +00:00