summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-06-22 01:57:31 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-06-22 01:57:31 +0000
commitc76ce989a22a1e133c2c2d95f9c3bc9f9fdbf5bf (patch)
treee68bc682eba118cd709567b39e8bb89746a9b9fe
parent268ff50413bd6761d80e9ab0223ba4c35315b41b (diff)
Make the `filename' parameter to HASHFile() and HASHFileChunk() const
ok pedro@, millert@
-rw-r--r--include/md4.h6
-rw-r--r--include/md5.h6
-rw-r--r--include/rmd160.h6
-rw-r--r--include/sha1.h6
-rw-r--r--include/sha2.h14
-rw-r--r--lib/libc/hash/helper.c8
-rw-r--r--lib/libc/hash/mdX.36
-rw-r--r--lib/libc/hash/rmd160.36
-rw-r--r--lib/libc/hash/sha1.36
-rw-r--r--lib/libc/hash/sha2.36
10 files changed, 35 insertions, 35 deletions
diff --git a/include/md4.h b/include/md4.h
index 6af186758a2..3459de3d6b7 100644
--- a/include/md4.h
+++ b/include/md4.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md4.h,v 1.14 2004/05/03 17:30:14 millert Exp $ */
+/* $OpenBSD: md4.h,v 1.15 2004/06/22 01:57:30 jfb Exp $ */
/*
* This code implements the MD4 message-digest algorithm.
@@ -40,9 +40,9 @@ void MD4Transform(u_int32_t [4], const u_int8_t [MD4_BLOCK_LENGTH])
__attribute__((__bounded__(__minbytes__,2,MD4_BLOCK_LENGTH)));
char *MD4End(MD4_CTX *, char *)
__attribute__((__bounded__(__minbytes__,2,MD4_DIGEST_STRING_LENGTH)));
-char *MD4File(char *, char *)
+char *MD4File(const char *, char *)
__attribute__((__bounded__(__minbytes__,2,MD4_DIGEST_STRING_LENGTH)));
-char *MD4FileChunk(char *, char *, off_t, off_t)
+char *MD4FileChunk(const char *, char *, off_t, off_t)
__attribute__((__bounded__(__minbytes__,2,MD4_DIGEST_STRING_LENGTH)));
char *MD4Data(const u_int8_t *, size_t, char *)
__attribute__((__bounded__(__string__,1,2)))
diff --git a/include/md5.h b/include/md5.h
index f67172dbf1e..3599640aecb 100644
--- a/include/md5.h
+++ b/include/md5.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md5.h,v 1.15 2004/05/03 17:30:14 millert Exp $ */
+/* $OpenBSD: md5.h,v 1.16 2004/06/22 01:57:30 jfb Exp $ */
/*
* This code implements the MD5 message-digest algorithm.
@@ -39,9 +39,9 @@ void MD5Transform(u_int32_t [4], const u_int8_t [MD5_BLOCK_LENGTH])
__attribute__((__bounded__(__minbytes__,2,MD5_BLOCK_LENGTH)));
char *MD5End(MD5_CTX *, char *)
__attribute__((__bounded__(__minbytes__,2,MD5_DIGEST_STRING_LENGTH)));
-char *MD5File(char *, char *)
+char *MD5File(const char *, char *)
__attribute__((__bounded__(__minbytes__,2,MD5_DIGEST_STRING_LENGTH)));
-char *MD5FileChunk(char *, char *, off_t, off_t)
+char *MD5FileChunk(const char *, char *, off_t, off_t)
__attribute__((__bounded__(__minbytes__,2,MD5_DIGEST_STRING_LENGTH)));
char *MD5Data(const u_int8_t *, size_t, char *)
__attribute__((__bounded__(__string__,1,2)))
diff --git a/include/rmd160.h b/include/rmd160.h
index d2e166077e3..185c54761b1 100644
--- a/include/rmd160.h
+++ b/include/rmd160.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rmd160.h,v 1.15 2004/05/03 17:30:14 millert Exp $ */
+/* $OpenBSD: rmd160.h,v 1.16 2004/06/22 01:57:30 jfb Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
@@ -50,9 +50,9 @@ void RMD160Final(u_int8_t [RMD160_DIGEST_LENGTH], RMD160_CTX *)
__attribute__((__bounded__(__minbytes__,1,RMD160_DIGEST_LENGTH)));
char *RMD160End(RMD160_CTX *, char *)
__attribute__((__bounded__(__minbytes__,2,RMD160_DIGEST_STRING_LENGTH)));
-char *RMD160File(char *, char *)
+char *RMD160File(const char *, char *)
__attribute__((__bounded__(__minbytes__,2,RMD160_DIGEST_STRING_LENGTH)));
-char *RMD160FileChunk(char *, char *, off_t, off_t)
+char *RMD160FileChunk(const char *, char *, off_t, off_t)
__attribute__((__bounded__(__minbytes__,2,RMD160_DIGEST_STRING_LENGTH)));
char *RMD160Data(const u_int8_t *, size_t, char *)
__attribute__((__bounded__(__string__,1,2)))
diff --git a/include/sha1.h b/include/sha1.h
index cb5f6b1ead6..9834cf8706a 100644
--- a/include/sha1.h
+++ b/include/sha1.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sha1.h,v 1.22 2004/05/05 17:09:45 millert Exp $ */
+/* $OpenBSD: sha1.h,v 1.23 2004/06/22 01:57:30 jfb Exp $ */
/*
* SHA-1 in C
@@ -33,9 +33,9 @@ void SHA1Final(u_int8_t [SHA1_DIGEST_LENGTH], SHA1_CTX *)
__attribute__((__bounded__(__minbytes__,1,SHA1_DIGEST_LENGTH)));
char *SHA1End(SHA1_CTX *, char *)
__attribute__((__bounded__(__minbytes__,2,SHA1_DIGEST_STRING_LENGTH)));
-char *SHA1File(char *, char *)
+char *SHA1File(const char *, char *)
__attribute__((__bounded__(__minbytes__,2,SHA1_DIGEST_STRING_LENGTH)));
-char *SHA1FileChunk(char *, char *, off_t, off_t)
+char *SHA1FileChunk(const char *, char *, off_t, off_t)
__attribute__((__bounded__(__minbytes__,2,SHA1_DIGEST_STRING_LENGTH)));
char *SHA1Data(const u_int8_t *, size_t, char *)
__attribute__((__bounded__(__string__,1,2)))
diff --git a/include/sha2.h b/include/sha2.h
index 15b0976eaba..cfb28509ad6 100644
--- a/include/sha2.h
+++ b/include/sha2.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sha2.h,v 1.5 2004/05/05 17:39:47 millert Exp $ */
+/* $OpenBSD: sha2.h,v 1.6 2004/06/22 01:57:30 jfb Exp $ */
/*
* FILE: sha2.h
@@ -76,9 +76,9 @@ void SHA256_Final(u_int8_t [SHA256_DIGEST_LENGTH], SHA256_CTX *)
__attribute__((__bounded__(__minbytes__,1,SHA256_DIGEST_LENGTH)));
char *SHA256_End(SHA256_CTX *, char *)
__attribute__((__bounded__(__minbytes__,2,SHA256_DIGEST_STRING_LENGTH)));
-char *SHA256_File(char *, char *)
+char *SHA256_File(const char *, char *)
__attribute__((__bounded__(__minbytes__,2,SHA256_DIGEST_STRING_LENGTH)));
-char *SHA256_FileChunk(char *, char *, off_t, off_t)
+char *SHA256_FileChunk(const char *, char *, off_t, off_t)
__attribute__((__bounded__(__minbytes__,2,SHA256_DIGEST_STRING_LENGTH)));
char *SHA256_Data(const u_int8_t *, size_t, char *)
__attribute__((__bounded__(__string__,1,2)))
@@ -93,9 +93,9 @@ void SHA384_Final(u_int8_t [SHA384_DIGEST_LENGTH], SHA384_CTX *)
__attribute__((__bounded__(__minbytes__,1,SHA384_DIGEST_LENGTH)));
char *SHA384_End(SHA384_CTX *, char *)
__attribute__((__bounded__(__minbytes__,2,SHA384_DIGEST_STRING_LENGTH)));
-char *SHA384_File(char *, char *)
+char *SHA384_File(const char *, char *)
__attribute__((__bounded__(__minbytes__,2,SHA384_DIGEST_STRING_LENGTH)));
-char *SHA384_FileChunk(char *, char *, off_t, off_t)
+char *SHA384_FileChunk(const char *, char *, off_t, off_t)
__attribute__((__bounded__(__minbytes__,2,SHA384_DIGEST_STRING_LENGTH)));
char *SHA384_Data(const u_int8_t *, size_t, char *)
__attribute__((__bounded__(__string__,1,2)))
@@ -110,9 +110,9 @@ void SHA512_Final(u_int8_t [SHA512_DIGEST_LENGTH], SHA512_CTX *)
__attribute__((__bounded__(__minbytes__,1,SHA512_DIGEST_LENGTH)));
char *SHA512_End(SHA512_CTX *, char *)
__attribute__((__bounded__(__minbytes__,2,SHA512_DIGEST_STRING_LENGTH)));
-char *SHA512_File(char *, char *)
+char *SHA512_File(const char *, char *)
__attribute__((__bounded__(__minbytes__,2,SHA512_DIGEST_STRING_LENGTH)));
-char *SHA512_FileChunk(char *, char *, off_t, off_t)
+char *SHA512_FileChunk(const char *, char *, off_t, off_t)
__attribute__((__bounded__(__minbytes__,2,SHA512_DIGEST_STRING_LENGTH)));
char *SHA512_Data(const u_int8_t *, size_t, char *)
__attribute__((__bounded__(__string__,1,2)))
diff --git a/lib/libc/hash/helper.c b/lib/libc/hash/helper.c
index 5735e851813..016a31ecd4e 100644
--- a/lib/libc/hash/helper.c
+++ b/lib/libc/hash/helper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: helper.c,v 1.5 2004/05/03 17:30:14 millert Exp $ */
+/* $OpenBSD: helper.c,v 1.6 2004/06/22 01:57:29 jfb Exp $ */
/*
* ----------------------------------------------------------------------------
@@ -10,7 +10,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$OpenBSD: helper.c,v 1.5 2004/05/03 17:30:14 millert Exp $";
+static const char rcsid[] = "$OpenBSD: helper.c,v 1.6 2004/06/22 01:57:29 jfb Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -46,7 +46,7 @@ HASHEnd(HASH_CTX *ctx, char *buf)
}
char *
-HASHFileChunk(char *filename, char *buf, off_t off, off_t len)
+HASHFileChunk(const char *filename, char *buf, off_t off, off_t len)
{
u_char buffer[BUFSIZ];
HASH_CTX ctx;
@@ -73,7 +73,7 @@ HASHFileChunk(char *filename, char *buf, off_t off, off_t len)
}
char *
-HASHFile(char *filename, char *buf)
+HASHFile(const char *filename, char *buf)
{
return (HASHFileChunk(filename, buf, (off_t)0, (off_t)0));
}
diff --git a/lib/libc/hash/mdX.3 b/lib/libc/hash/mdX.3
index 2a9c9996c44..d43aeeb6943 100644
--- a/lib/libc/hash/mdX.3
+++ b/lib/libc/hash/mdX.3
@@ -6,7 +6,7 @@
.\" this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
.\" ----------------------------------------------------------------------------
.\"
-.\" $OpenBSD: mdX.3,v 1.6 2004/05/16 18:29:09 otto Exp $
+.\" $OpenBSD: mdX.3,v 1.7 2004/06/22 01:57:29 jfb Exp $
.\"
.Dd April 29, 2004
.Dt MDX 3
@@ -38,9 +38,9 @@
.Ft "char *"
.Fn MDXEnd "MDX_CTX *context" "char *buf"
.Ft "char *"
-.Fn MDXFile "char *filename" "char *buf"
+.Fn MDXFile "const char *filename" "char *buf"
.Ft "char *"
-.Fn MDXFileChunk "char *filename" "char *buf" "off_t offset" "off_t length"
+.Fn MDXFileChunk "const char *filename" "char *buf" "off_t offset" "off_t length"
.Ft "char *"
.Fn MDXData "const u_int8_t *data" "size_t len" "char *buf"
.Sh DESCRIPTION
diff --git a/lib/libc/hash/rmd160.3 b/lib/libc/hash/rmd160.3
index 112c68a1658..fad7ba6f18b 100644
--- a/lib/libc/hash/rmd160.3
+++ b/lib/libc/hash/rmd160.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rmd160.3,v 1.25 2004/05/16 18:29:09 otto Exp $
+.\" $OpenBSD: rmd160.3,v 1.26 2004/06/22 01:57:29 jfb Exp $
.\"
.\" Copyright (c) 1997, 2004 Todd C. Miller <Todd.Miller@courtesan.com>
.\"
@@ -47,9 +47,9 @@
.Ft "char *"
.Fn RMD160End "RMD160_CTX *context" "char *buf"
.Ft "char *"
-.Fn RMD160File "char *filename" "char *buf"
+.Fn RMD160File "const char *filename" "char *buf"
.Ft "char *"
-.Fn RMD160FileChunk "char *filename" "char *buf" "off_t offset" "off_t length"
+.Fn RMD160FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length"
.Ft "char *"
.Fn RMD160Data "const u_int8_t *data" "size_t len" "char *buf"
.Sh DESCRIPTION
diff --git a/lib/libc/hash/sha1.3 b/lib/libc/hash/sha1.3
index d4ddb42c543..ea7d547961a 100644
--- a/lib/libc/hash/sha1.3
+++ b/lib/libc/hash/sha1.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sha1.3,v 1.33 2004/05/16 18:29:09 otto Exp $
+.\" $OpenBSD: sha1.3,v 1.34 2004/06/22 01:57:29 jfb Exp $
.\"
.\" Copyright (c) 1997, 2004 Todd C. Miller <Todd.Miller@courtesan.com>
.\"
@@ -47,9 +47,9 @@
.Ft "char *"
.Fn SHA1End "SHA1_CTX *context" "char *buf"
.Ft "char *"
-.Fn SHA1File "char *filename" "char *buf"
+.Fn SHA1File "const char *filename" "char *buf"
.Ft "char *"
-.Fn SHA1FileChunk "char *filename" "char *buf" "off_t offset" "off_t length"
+.Fn SHA1FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length"
.Ft "char *"
.Fn SHA1Data "const u_int8_t *data" "size_t len" "char *buf"
.Sh DESCRIPTION
diff --git a/lib/libc/hash/sha2.3 b/lib/libc/hash/sha2.3
index 3cf2400da86..77c8abb5eb7 100644
--- a/lib/libc/hash/sha2.3
+++ b/lib/libc/hash/sha2.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sha2.3,v 1.10 2004/05/16 18:29:09 otto Exp $
+.\" $OpenBSD: sha2.3,v 1.11 2004/06/22 01:57:29 jfb Exp $
.\"
.\" Copyright (c) 2003, 2004 Todd C. Miller <Todd.Miller@courtesan.com>
.\"
@@ -50,9 +50,9 @@
.Ft "char *"
.Fn SHA256_End "SHA256_CTX *context" "char *buf"
.Ft "char *"
-.Fn SHA256_File "char *filename" "char *buf"
+.Fn SHA256_File "const char *filename" "char *buf"
.Ft "char *"
-.Fn SHA256_FileChunk "char *filename" "char *buf" "off_t offset" "off_t length"
+.Fn SHA256_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length"
.Ft "char *"
.Fn SHA256_Data "u_int8_t *data" "size_t len" "char *buf"
.Ft void