diff options
author | avsm <> | 2014-06-14 10:28:31 +0000 |
---|---|---|
committer | avsm <> | 2014-06-14 10:28:31 +0000 |
commit | 49d9bfe1c1e2d2b68738838188970b60c82b7cfd (patch) | |
tree | 5f7634247ad913bd0f5da399c9c160b9d343dae7 /src | |
parent | d70ac8aa3aff0d5162f505665af4d31896b6bcde (diff) | |
download | openbsd-49d9bfe1c1e2d2b68738838188970b60c82b7cfd.tar.gz openbsd-49d9bfe1c1e2d2b68738838188970b60c82b7cfd.tar.bz2 openbsd-49d9bfe1c1e2d2b68738838188970b60c82b7cfd.zip |
Add more bounded attributes to the buffer and md5/sha headers in libssl
ok miod@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/buffer/buffer.h | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/md5/md5.h | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/sha/sha.h | 38 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/buffer/buffer.h | 8 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/md5/md5.h | 8 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/sha/sha.h | 38 |
6 files changed, 70 insertions, 38 deletions
diff --git a/src/lib/libcrypto/buffer/buffer.h b/src/lib/libcrypto/buffer/buffer.h index 888dabf373..bdffc346b9 100644 --- a/src/lib/libcrypto/buffer/buffer.h +++ b/src/lib/libcrypto/buffer/buffer.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: buffer.h,v 1.9 2014/06/12 15:49:28 deraadt Exp $ */ | 1 | /* $OpenBSD: buffer.h,v 1.10 2014/06/14 10:28:31 avsm Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -90,8 +90,10 @@ void * BUF_memdup(const void *data, size_t siz); | |||
90 | void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); | 90 | void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); |
91 | 91 | ||
92 | /* safe string functions */ | 92 | /* safe string functions */ |
93 | size_t BUF_strlcpy(char *dst, const char *src, size_t siz); | 93 | size_t BUF_strlcpy(char *dst, const char *src, size_t siz) |
94 | size_t BUF_strlcat(char *dst, const char *src, size_t siz); | 94 | __attribute__ ((__bounded__(__string__,1,3))); |
95 | size_t BUF_strlcat(char *dst, const char *src, size_t siz) | ||
96 | __attribute__ ((__bounded__(__string__,1,3))); | ||
95 | 97 | ||
96 | 98 | ||
97 | /* BEGIN ERROR CODES */ | 99 | /* BEGIN ERROR CODES */ |
diff --git a/src/lib/libcrypto/md5/md5.h b/src/lib/libcrypto/md5/md5.h index 7cc703ac11..66e52ce227 100644 --- a/src/lib/libcrypto/md5/md5.h +++ b/src/lib/libcrypto/md5/md5.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: md5.h,v 1.14 2014/06/12 15:49:29 deraadt Exp $ */ | 1 | /* $OpenBSD: md5.h,v 1.15 2014/06/14 10:28:31 avsm Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -100,9 +100,11 @@ typedef struct MD5state_st | |||
100 | } MD5_CTX; | 100 | } MD5_CTX; |
101 | 101 | ||
102 | int MD5_Init(MD5_CTX *c); | 102 | int MD5_Init(MD5_CTX *c); |
103 | int MD5_Update(MD5_CTX *c, const void *data, size_t len); | 103 | int MD5_Update(MD5_CTX *c, const void *data, size_t len) |
104 | __attribute__ ((__bounded__(__buffer__,2,3))); | ||
104 | int MD5_Final(unsigned char *md, MD5_CTX *c); | 105 | int MD5_Final(unsigned char *md, MD5_CTX *c); |
105 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); | 106 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md) |
107 | __attribute__ ((__bounded__(__buffer__,1,2))); | ||
106 | void MD5_Transform(MD5_CTX *c, const unsigned char *b); | 108 | void MD5_Transform(MD5_CTX *c, const unsigned char *b); |
107 | #ifdef __cplusplus | 109 | #ifdef __cplusplus |
108 | } | 110 | } |
diff --git a/src/lib/libcrypto/sha/sha.h b/src/lib/libcrypto/sha/sha.h index 4cb434ba99..a03694cd28 100644 --- a/src/lib/libcrypto/sha/sha.h +++ b/src/lib/libcrypto/sha/sha.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sha.h,v 1.14 2014/06/12 15:49:30 deraadt Exp $ */ | 1 | /* $OpenBSD: sha.h,v 1.15 2014/06/14 10:28:31 avsm Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -104,16 +104,20 @@ typedef struct SHAstate_st | |||
104 | 104 | ||
105 | #ifndef OPENSSL_NO_SHA0 | 105 | #ifndef OPENSSL_NO_SHA0 |
106 | int SHA_Init(SHA_CTX *c); | 106 | int SHA_Init(SHA_CTX *c); |
107 | int SHA_Update(SHA_CTX *c, const void *data, size_t len); | 107 | int SHA_Update(SHA_CTX *c, const void *data, size_t len) |
108 | __attribute__ ((__bounded__(__buffer__,2,3))); | ||
108 | int SHA_Final(unsigned char *md, SHA_CTX *c); | 109 | int SHA_Final(unsigned char *md, SHA_CTX *c); |
109 | unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md); | 110 | unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md) |
111 | __attribute__ ((__bounded__(__buffer__,1,2))); | ||
110 | void SHA_Transform(SHA_CTX *c, const unsigned char *data); | 112 | void SHA_Transform(SHA_CTX *c, const unsigned char *data); |
111 | #endif | 113 | #endif |
112 | #ifndef OPENSSL_NO_SHA1 | 114 | #ifndef OPENSSL_NO_SHA1 |
113 | int SHA1_Init(SHA_CTX *c); | 115 | int SHA1_Init(SHA_CTX *c); |
114 | int SHA1_Update(SHA_CTX *c, const void *data, size_t len); | 116 | int SHA1_Update(SHA_CTX *c, const void *data, size_t len) |
117 | __attribute__ ((__bounded__(__buffer__,2,3))); | ||
115 | int SHA1_Final(unsigned char *md, SHA_CTX *c); | 118 | int SHA1_Final(unsigned char *md, SHA_CTX *c); |
116 | unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md); | 119 | unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md) |
120 | __attribute__ ((__bounded__(__buffer__,1,2))); | ||
117 | void SHA1_Transform(SHA_CTX *c, const unsigned char *data); | 121 | void SHA1_Transform(SHA_CTX *c, const unsigned char *data); |
118 | #endif | 122 | #endif |
119 | 123 | ||
@@ -133,13 +137,17 @@ typedef struct SHA256state_st | |||
133 | 137 | ||
134 | #ifndef OPENSSL_NO_SHA256 | 138 | #ifndef OPENSSL_NO_SHA256 |
135 | int SHA224_Init(SHA256_CTX *c); | 139 | int SHA224_Init(SHA256_CTX *c); |
136 | int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); | 140 | int SHA224_Update(SHA256_CTX *c, const void *data, size_t len) |
141 | __attribute__ ((__bounded__(__buffer__,2,3))); | ||
137 | int SHA224_Final(unsigned char *md, SHA256_CTX *c); | 142 | int SHA224_Final(unsigned char *md, SHA256_CTX *c); |
138 | unsigned char *SHA224(const unsigned char *d, size_t n,unsigned char *md); | 143 | unsigned char *SHA224(const unsigned char *d, size_t n,unsigned char *md) |
144 | __attribute__ ((__bounded__(__buffer__,1,2))); | ||
139 | int SHA256_Init(SHA256_CTX *c); | 145 | int SHA256_Init(SHA256_CTX *c); |
140 | int SHA256_Update(SHA256_CTX *c, const void *data, size_t len); | 146 | int SHA256_Update(SHA256_CTX *c, const void *data, size_t len) |
147 | __attribute__ ((__bounded__(__buffer__,2,3))); | ||
141 | int SHA256_Final(unsigned char *md, SHA256_CTX *c); | 148 | int SHA256_Final(unsigned char *md, SHA256_CTX *c); |
142 | unsigned char *SHA256(const unsigned char *d, size_t n,unsigned char *md); | 149 | unsigned char *SHA256(const unsigned char *d, size_t n,unsigned char *md) |
150 | __attribute__ ((__bounded__(__buffer__,1,2))); | ||
143 | void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); | 151 | void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); |
144 | #endif | 152 | #endif |
145 | 153 | ||
@@ -177,13 +185,17 @@ typedef struct SHA512state_st | |||
177 | 185 | ||
178 | #ifndef OPENSSL_NO_SHA512 | 186 | #ifndef OPENSSL_NO_SHA512 |
179 | int SHA384_Init(SHA512_CTX *c); | 187 | int SHA384_Init(SHA512_CTX *c); |
180 | int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); | 188 | int SHA384_Update(SHA512_CTX *c, const void *data, size_t len) |
189 | __attribute__ ((__bounded__(__buffer__,2,3))); | ||
181 | int SHA384_Final(unsigned char *md, SHA512_CTX *c); | 190 | int SHA384_Final(unsigned char *md, SHA512_CTX *c); |
182 | unsigned char *SHA384(const unsigned char *d, size_t n,unsigned char *md); | 191 | unsigned char *SHA384(const unsigned char *d, size_t n,unsigned char *md) |
192 | __attribute__ ((__bounded__(__buffer__,1,2))); | ||
183 | int SHA512_Init(SHA512_CTX *c); | 193 | int SHA512_Init(SHA512_CTX *c); |
184 | int SHA512_Update(SHA512_CTX *c, const void *data, size_t len); | 194 | int SHA512_Update(SHA512_CTX *c, const void *data, size_t len) |
195 | __attribute__ ((__bounded__(__buffer__,2,3))); | ||
185 | int SHA512_Final(unsigned char *md, SHA512_CTX *c); | 196 | int SHA512_Final(unsigned char *md, SHA512_CTX *c); |
186 | unsigned char *SHA512(const unsigned char *d, size_t n,unsigned char *md); | 197 | unsigned char *SHA512(const unsigned char *d, size_t n,unsigned char *md) |
198 | __attribute__ ((__bounded__(__buffer__,1,2))); | ||
187 | void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); | 199 | void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); |
188 | #endif | 200 | #endif |
189 | 201 | ||
diff --git a/src/lib/libssl/src/crypto/buffer/buffer.h b/src/lib/libssl/src/crypto/buffer/buffer.h index 888dabf373..bdffc346b9 100644 --- a/src/lib/libssl/src/crypto/buffer/buffer.h +++ b/src/lib/libssl/src/crypto/buffer/buffer.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: buffer.h,v 1.9 2014/06/12 15:49:28 deraadt Exp $ */ | 1 | /* $OpenBSD: buffer.h,v 1.10 2014/06/14 10:28:31 avsm Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -90,8 +90,10 @@ void * BUF_memdup(const void *data, size_t siz); | |||
90 | void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); | 90 | void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); |
91 | 91 | ||
92 | /* safe string functions */ | 92 | /* safe string functions */ |
93 | size_t BUF_strlcpy(char *dst, const char *src, size_t siz); | 93 | size_t BUF_strlcpy(char *dst, const char *src, size_t siz) |
94 | size_t BUF_strlcat(char *dst, const char *src, size_t siz); | 94 | __attribute__ ((__bounded__(__string__,1,3))); |
95 | size_t BUF_strlcat(char *dst, const char *src, size_t siz) | ||
96 | __attribute__ ((__bounded__(__string__,1,3))); | ||
95 | 97 | ||
96 | 98 | ||
97 | /* BEGIN ERROR CODES */ | 99 | /* BEGIN ERROR CODES */ |
diff --git a/src/lib/libssl/src/crypto/md5/md5.h b/src/lib/libssl/src/crypto/md5/md5.h index 7cc703ac11..66e52ce227 100644 --- a/src/lib/libssl/src/crypto/md5/md5.h +++ b/src/lib/libssl/src/crypto/md5/md5.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: md5.h,v 1.14 2014/06/12 15:49:29 deraadt Exp $ */ | 1 | /* $OpenBSD: md5.h,v 1.15 2014/06/14 10:28:31 avsm Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -100,9 +100,11 @@ typedef struct MD5state_st | |||
100 | } MD5_CTX; | 100 | } MD5_CTX; |
101 | 101 | ||
102 | int MD5_Init(MD5_CTX *c); | 102 | int MD5_Init(MD5_CTX *c); |
103 | int MD5_Update(MD5_CTX *c, const void *data, size_t len); | 103 | int MD5_Update(MD5_CTX *c, const void *data, size_t len) |
104 | __attribute__ ((__bounded__(__buffer__,2,3))); | ||
104 | int MD5_Final(unsigned char *md, MD5_CTX *c); | 105 | int MD5_Final(unsigned char *md, MD5_CTX *c); |
105 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); | 106 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md) |
107 | __attribute__ ((__bounded__(__buffer__,1,2))); | ||
106 | void MD5_Transform(MD5_CTX *c, const unsigned char *b); | 108 | void MD5_Transform(MD5_CTX *c, const unsigned char *b); |
107 | #ifdef __cplusplus | 109 | #ifdef __cplusplus |
108 | } | 110 | } |
diff --git a/src/lib/libssl/src/crypto/sha/sha.h b/src/lib/libssl/src/crypto/sha/sha.h index 4cb434ba99..a03694cd28 100644 --- a/src/lib/libssl/src/crypto/sha/sha.h +++ b/src/lib/libssl/src/crypto/sha/sha.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sha.h,v 1.14 2014/06/12 15:49:30 deraadt Exp $ */ | 1 | /* $OpenBSD: sha.h,v 1.15 2014/06/14 10:28:31 avsm Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -104,16 +104,20 @@ typedef struct SHAstate_st | |||
104 | 104 | ||
105 | #ifndef OPENSSL_NO_SHA0 | 105 | #ifndef OPENSSL_NO_SHA0 |
106 | int SHA_Init(SHA_CTX *c); | 106 | int SHA_Init(SHA_CTX *c); |
107 | int SHA_Update(SHA_CTX *c, const void *data, size_t len); | 107 | int SHA_Update(SHA_CTX *c, const void *data, size_t len) |
108 | __attribute__ ((__bounded__(__buffer__,2,3))); | ||
108 | int SHA_Final(unsigned char *md, SHA_CTX *c); | 109 | int SHA_Final(unsigned char *md, SHA_CTX *c); |
109 | unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md); | 110 | unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md) |
111 | __attribute__ ((__bounded__(__buffer__,1,2))); | ||
110 | void SHA_Transform(SHA_CTX *c, const unsigned char *data); | 112 | void SHA_Transform(SHA_CTX *c, const unsigned char *data); |
111 | #endif | 113 | #endif |
112 | #ifndef OPENSSL_NO_SHA1 | 114 | #ifndef OPENSSL_NO_SHA1 |
113 | int SHA1_Init(SHA_CTX *c); | 115 | int SHA1_Init(SHA_CTX *c); |
114 | int SHA1_Update(SHA_CTX *c, const void *data, size_t len); | 116 | int SHA1_Update(SHA_CTX *c, const void *data, size_t len) |
117 | __attribute__ ((__bounded__(__buffer__,2,3))); | ||
115 | int SHA1_Final(unsigned char *md, SHA_CTX *c); | 118 | int SHA1_Final(unsigned char *md, SHA_CTX *c); |
116 | unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md); | 119 | unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md) |
120 | __attribute__ ((__bounded__(__buffer__,1,2))); | ||
117 | void SHA1_Transform(SHA_CTX *c, const unsigned char *data); | 121 | void SHA1_Transform(SHA_CTX *c, const unsigned char *data); |
118 | #endif | 122 | #endif |
119 | 123 | ||
@@ -133,13 +137,17 @@ typedef struct SHA256state_st | |||
133 | 137 | ||
134 | #ifndef OPENSSL_NO_SHA256 | 138 | #ifndef OPENSSL_NO_SHA256 |
135 | int SHA224_Init(SHA256_CTX *c); | 139 | int SHA224_Init(SHA256_CTX *c); |
136 | int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); | 140 | int SHA224_Update(SHA256_CTX *c, const void *data, size_t len) |
141 | __attribute__ ((__bounded__(__buffer__,2,3))); | ||
137 | int SHA224_Final(unsigned char *md, SHA256_CTX *c); | 142 | int SHA224_Final(unsigned char *md, SHA256_CTX *c); |
138 | unsigned char *SHA224(const unsigned char *d, size_t n,unsigned char *md); | 143 | unsigned char *SHA224(const unsigned char *d, size_t n,unsigned char *md) |
144 | __attribute__ ((__bounded__(__buffer__,1,2))); | ||
139 | int SHA256_Init(SHA256_CTX *c); | 145 | int SHA256_Init(SHA256_CTX *c); |
140 | int SHA256_Update(SHA256_CTX *c, const void *data, size_t len); | 146 | int SHA256_Update(SHA256_CTX *c, const void *data, size_t len) |
147 | __attribute__ ((__bounded__(__buffer__,2,3))); | ||
141 | int SHA256_Final(unsigned char *md, SHA256_CTX *c); | 148 | int SHA256_Final(unsigned char *md, SHA256_CTX *c); |
142 | unsigned char *SHA256(const unsigned char *d, size_t n,unsigned char *md); | 149 | unsigned char *SHA256(const unsigned char *d, size_t n,unsigned char *md) |
150 | __attribute__ ((__bounded__(__buffer__,1,2))); | ||
143 | void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); | 151 | void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); |
144 | #endif | 152 | #endif |
145 | 153 | ||
@@ -177,13 +185,17 @@ typedef struct SHA512state_st | |||
177 | 185 | ||
178 | #ifndef OPENSSL_NO_SHA512 | 186 | #ifndef OPENSSL_NO_SHA512 |
179 | int SHA384_Init(SHA512_CTX *c); | 187 | int SHA384_Init(SHA512_CTX *c); |
180 | int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); | 188 | int SHA384_Update(SHA512_CTX *c, const void *data, size_t len) |
189 | __attribute__ ((__bounded__(__buffer__,2,3))); | ||
181 | int SHA384_Final(unsigned char *md, SHA512_CTX *c); | 190 | int SHA384_Final(unsigned char *md, SHA512_CTX *c); |
182 | unsigned char *SHA384(const unsigned char *d, size_t n,unsigned char *md); | 191 | unsigned char *SHA384(const unsigned char *d, size_t n,unsigned char *md) |
192 | __attribute__ ((__bounded__(__buffer__,1,2))); | ||
183 | int SHA512_Init(SHA512_CTX *c); | 193 | int SHA512_Init(SHA512_CTX *c); |
184 | int SHA512_Update(SHA512_CTX *c, const void *data, size_t len); | 194 | int SHA512_Update(SHA512_CTX *c, const void *data, size_t len) |
195 | __attribute__ ((__bounded__(__buffer__,2,3))); | ||
185 | int SHA512_Final(unsigned char *md, SHA512_CTX *c); | 196 | int SHA512_Final(unsigned char *md, SHA512_CTX *c); |
186 | unsigned char *SHA512(const unsigned char *d, size_t n,unsigned char *md); | 197 | unsigned char *SHA512(const unsigned char *d, size_t n,unsigned char *md) |
198 | __attribute__ ((__bounded__(__buffer__,1,2))); | ||
187 | void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); | 199 | void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); |
188 | #endif | 200 | #endif |
189 | 201 | ||