History log of /openbsd-current/lib/libc/hash/sha1.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.27 07-Jun-2019 dtucker

Cast bitcount to u_in64_t before bit shifting to prevent integer overflow
on 32bit platforms which cause incorrect results when adding a block
>=512M in size. sha1 patch from ante84 at gmail.com via openssh github,
sha2 with djm@, ok tedu@


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.26 11-Sep-2015 guenther

Wrap blowfish, sha*, md5, and rmd160 so that internal calls go direct

ok deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.25 16-Jan-2015 deraadt

Move to the <limits.h> universe.
review by millert, binary checking process with doug, concept with guenther


# 1.24 15-Jan-2015 millert

Use explicit_bzero instead of memset in hash Final and End functions.
OK deraadt@ djm@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.23 08-Jan-2014 tedu

calling HashFinal with a null digest should crash, not be silently ignored


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.22 27-Aug-2012 miod

Remove landisk gcc 3 compiler workaround. Reminded by martynas@ and brad


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.21 29-Jul-2008 miod

Split SHA1Transform() back into smaller pieces when compiling on landisk,
to defeat gcc optimization bugs. Similar to what had been done on sparc64
in the past.
ok millert@ deraadt@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.20 08-Aug-2005 espie

zap remaining rcsid.

Kill old files that are no longer compiled.

okay theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.19 28-May-2004 millert

In the Final function, move the context zeroing into the digest != NULL
scope so that passing a NULL digest is equivalent to the Pad function
(like it used to be). Fixes skey w/ sha1 as noticed by David Krause.


# 1.18 05-May-2004 millert

Make the 2nd arg to SHA1Transform const again and unifdef SHA1HANDSOFF.
It was defined before and there is no need to for this knob...


# 1.17 03-May-2004 millert

Use KNF indentation style and do some u_char -> u_int8_t conversion
I missed earlier.


# 1.16 03-May-2004 millert

Add Pad and FileChunk functions for each family of hash functions.
The Pad function does padding like in Final but does not finish processing.
The FileChunk function creates a digest from a portion of a file.
Also made the length parameters consistent (and size_t).


# 1.15 27-Apr-2004 millert

Make the bit count u_int64_t instead of two u_int32_t. Adapted from
changes Niklas made to the md5 code long ago. OK hshoexer@


# 1.14 26-Apr-2004 millert

Use a common source file for all the hash helper functions that
previously lived in foohl.c. The foohl.c files are now generated
via sed, though perhaps cpp could be used in the future.

Use u_int8_t instead of unsigned char for the buffers struct fooContext.
Add constants for buffer lengths and use them in function prototypes
and the man pages.

This is basically cosmetic surgery; there should be no functional changes.

OK deraadt@


# 1.13 31-Mar-2004 brad

remove sparc64/gcc2 workaround.

ok millert@ deraadt@ jason@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.12 21-Jul-2003 millert

Remove bogus static; from Hiroki Sato


Revision tags: OPENBSD_3_3_BASE
# 1.11 08-Jan-2003 millert

Move the rounds into separate functions on sparc64 so gcc's optimizer
doesn't blow up. This is a hack but is better than compiling sha1.c
with -O0 on sparc64. From NetBSD (mrg).
deraadt@ OK


# 1.10 23-Dec-2002 millert

o Ansi function headers
o Add __BEGIN_DECLS/__END_DECLS to include files
o Safe macros
o Remove useless variable assignment in the End function of *hl.c
o Some minor KNF, needs more
From Dan Weeks


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE OPENBSD_3_2_BASE
# 1.9 23-Jul-1997 kstailey

tabify + trailing blanks


# 1.8 15-Jul-1997 millert

Add a missing const


# 1.7 12-Jul-1997 millert

Minor style points.


# 1.6 11-Jul-1997 millert

#include <sha1.h> not #include "sha1.h"


# 1.5 10-Jul-1997 millert

Different sha1 functions (taken from netinet's if_sha1.c) that
are more consistent with md4/md5 functions.


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.4 30-Sep-1996 millert

export byte swapping routine.


# 1.3 30-Sep-1996 millert

Moved definitions of BYTE and LONG in from header file.


# 1.2 29-Sep-1996 millert

Fixed standalone test mode for NEW_SHA1.


# 1.1 29-Sep-1996 millert

added sha1 (secure hash function).


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.26 11-Sep-2015 guenther

Wrap blowfish, sha*, md5, and rmd160 so that internal calls go direct

ok deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE
# 1.25 16-Jan-2015 deraadt

Move to the <limits.h> universe.
review by millert, binary checking process with doug, concept with guenther


# 1.24 15-Jan-2015 millert

Use explicit_bzero instead of memset in hash Final and End functions.
OK deraadt@ djm@


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.23 08-Jan-2014 tedu

calling HashFinal with a null digest should crash, not be silently ignored


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.22 27-Aug-2012 miod

Remove landisk gcc 3 compiler workaround. Reminded by martynas@ and brad


Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.21 29-Jul-2008 miod

Split SHA1Transform() back into smaller pieces when compiling on landisk,
to defeat gcc optimization bugs. Similar to what had been done on sparc64
in the past.
ok millert@ deraadt@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE
# 1.20 08-Aug-2005 espie

zap remaining rcsid.

Kill old files that are no longer compiled.

okay theo


Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE
# 1.19 28-May-2004 millert

In the Final function, move the context zeroing into the digest != NULL
scope so that passing a NULL digest is equivalent to the Pad function
(like it used to be). Fixes skey w/ sha1 as noticed by David Krause.


# 1.18 05-May-2004 millert

Make the 2nd arg to SHA1Transform const again and unifdef SHA1HANDSOFF.
It was defined before and there is no need to for this knob...


# 1.17 03-May-2004 millert

Use KNF indentation style and do some u_char -> u_int8_t conversion
I missed earlier.


# 1.16 03-May-2004 millert

Add Pad and FileChunk functions for each family of hash functions.
The Pad function does padding like in Final but does not finish processing.
The FileChunk function creates a digest from a portion of a file.
Also made the length parameters consistent (and size_t).


# 1.15 27-Apr-2004 millert

Make the bit count u_int64_t instead of two u_int32_t. Adapted from
changes Niklas made to the md5 code long ago. OK hshoexer@


# 1.14 26-Apr-2004 millert

Use a common source file for all the hash helper functions that
previously lived in foohl.c. The foohl.c files are now generated
via sed, though perhaps cpp could be used in the future.

Use u_int8_t instead of unsigned char for the buffers struct fooContext.
Add constants for buffer lengths and use them in function prototypes
and the man pages.

This is basically cosmetic surgery; there should be no functional changes.

OK deraadt@


# 1.13 31-Mar-2004 brad

remove sparc64/gcc2 workaround.

ok millert@ deraadt@ jason@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
# 1.12 21-Jul-2003 millert

Remove bogus static; from Hiroki Sato


Revision tags: OPENBSD_3_3_BASE
# 1.11 08-Jan-2003 millert

Move the rounds into separate functions on sparc64 so gcc's optimizer
doesn't blow up. This is a hack but is better than compiling sha1.c
with -O0 on sparc64. From NetBSD (mrg).
deraadt@ OK


# 1.10 23-Dec-2002 millert

o Ansi function headers
o Add __BEGIN_DECLS/__END_DECLS to include files
o Safe macros
o Remove useless variable assignment in the End function of *hl.c
o Some minor KNF, needs more
From Dan Weeks


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE OPENBSD_3_2_BASE
# 1.9 23-Jul-1997 kstailey

tabify + trailing blanks


# 1.8 15-Jul-1997 millert

Add a missing const


# 1.7 12-Jul-1997 millert

Minor style points.


# 1.6 11-Jul-1997 millert

#include <sha1.h> not #include "sha1.h"


# 1.5 10-Jul-1997 millert

Different sha1 functions (taken from netinet's if_sha1.c) that
are more consistent with md4/md5 functions.


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.4 30-Sep-1996 millert

export byte swapping routine.


# 1.3 30-Sep-1996 millert

Moved definitions of BYTE and LONG in from header file.


# 1.2 29-Sep-1996 millert

Fixed standalone test mode for NEW_SHA1.


# 1.1 29-Sep-1996 millert

added sha1 (secure hash function).