summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-05-30 03:31:29 +0000
committertedu <tedu@openbsd.org>2014-05-30 03:31:29 +0000
commit66bc4c20f71861d81cddbc2cae5d5664ae96216d (patch)
treeff7174383cef13778ce902126c8e79caeabd6fc0 /lib
parentno need for null check before free. from Brendan MacDonell (diff)
downloadwireguard-openbsd-66bc4c20f71861d81cddbc2cae5d5664ae96216d.tar.xz
wireguard-openbsd-66bc4c20f71861d81cddbc2cae5d5664ae96216d.zip
remove CONST_STRICT. ok beck deraadt
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/asn1/a_object.c2
-rw-r--r--lib/libcrypto/bio/bio.h7
-rw-r--r--lib/libcrypto/evp/evp.h6
-rw-r--r--lib/libssl/src/crypto/asn1/a_object.c2
-rw-r--r--lib/libssl/src/crypto/bio/bio.h7
-rw-r--r--lib/libssl/src/crypto/evp/evp.h6
6 files changed, 2 insertions, 28 deletions
diff --git a/lib/libcrypto/asn1/a_object.c b/lib/libcrypto/asn1/a_object.c
index f86d54f5271..b3a7e672eeb 100644
--- a/lib/libcrypto/asn1/a_object.c
+++ b/lib/libcrypto/asn1/a_object.c
@@ -365,12 +365,10 @@ ASN1_OBJECT_free(ASN1_OBJECT *a)
if (a == NULL)
return;
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) {
-#ifndef CONST_STRICT /* disable purely for compile-time strict const checking. Doing this on a "real" compile will cause memory leaks */
if (a->sn != NULL)
free((void *)a->sn);
if (a->ln != NULL)
free((void *)a->ln);
-#endif
a->sn = a->ln = NULL;
}
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) {
diff --git a/lib/libcrypto/bio/bio.h b/lib/libcrypto/bio/bio.h
index 6809b70e9da..43562d4872d 100644
--- a/lib/libcrypto/bio/bio.h
+++ b/lib/libcrypto/bio/bio.h
@@ -499,15 +499,8 @@ struct bio_dgram_sctp_prinfo {
/* name is cast to lose const, but might be better to route through a function
so we can do it safely */
-#ifdef CONST_STRICT
-/* If you are wondering why this isn't defined, its because CONST_STRICT is
- * purely a compile-time kludge to allow const to be checked.
- */
-int BIO_read_filename(BIO *b, const char *name);
-#else
#define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
BIO_CLOSE|BIO_FP_READ,(char *)name)
-#endif
#define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
BIO_CLOSE|BIO_FP_WRITE,name)
#define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
diff --git a/lib/libcrypto/evp/evp.h b/lib/libcrypto/evp/evp.h
index 3bd36e92661..c32e49dd620 100644
--- a/lib/libcrypto/evp/evp.h
+++ b/lib/libcrypto/evp/evp.h
@@ -510,11 +510,7 @@ unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx);
#define EVP_DigestSignUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
#define EVP_DigestVerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
-#ifdef CONST_STRICT
-void BIO_set_md(BIO *, const EVP_MD *md);
-#else
-# define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md)
-#endif
+#define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md)
#define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp)
#define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp)
#define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0,(char *)mdcp)
diff --git a/lib/libssl/src/crypto/asn1/a_object.c b/lib/libssl/src/crypto/asn1/a_object.c
index f86d54f5271..b3a7e672eeb 100644
--- a/lib/libssl/src/crypto/asn1/a_object.c
+++ b/lib/libssl/src/crypto/asn1/a_object.c
@@ -365,12 +365,10 @@ ASN1_OBJECT_free(ASN1_OBJECT *a)
if (a == NULL)
return;
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) {
-#ifndef CONST_STRICT /* disable purely for compile-time strict const checking. Doing this on a "real" compile will cause memory leaks */
if (a->sn != NULL)
free((void *)a->sn);
if (a->ln != NULL)
free((void *)a->ln);
-#endif
a->sn = a->ln = NULL;
}
if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) {
diff --git a/lib/libssl/src/crypto/bio/bio.h b/lib/libssl/src/crypto/bio/bio.h
index 6809b70e9da..43562d4872d 100644
--- a/lib/libssl/src/crypto/bio/bio.h
+++ b/lib/libssl/src/crypto/bio/bio.h
@@ -499,15 +499,8 @@ struct bio_dgram_sctp_prinfo {
/* name is cast to lose const, but might be better to route through a function
so we can do it safely */
-#ifdef CONST_STRICT
-/* If you are wondering why this isn't defined, its because CONST_STRICT is
- * purely a compile-time kludge to allow const to be checked.
- */
-int BIO_read_filename(BIO *b, const char *name);
-#else
#define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
BIO_CLOSE|BIO_FP_READ,(char *)name)
-#endif
#define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
BIO_CLOSE|BIO_FP_WRITE,name)
#define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \
diff --git a/lib/libssl/src/crypto/evp/evp.h b/lib/libssl/src/crypto/evp/evp.h
index 3bd36e92661..c32e49dd620 100644
--- a/lib/libssl/src/crypto/evp/evp.h
+++ b/lib/libssl/src/crypto/evp/evp.h
@@ -510,11 +510,7 @@ unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx);
#define EVP_DigestSignUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
#define EVP_DigestVerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c)
-#ifdef CONST_STRICT
-void BIO_set_md(BIO *, const EVP_MD *md);
-#else
-# define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md)
-#endif
+#define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md)
#define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp)
#define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp)
#define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0,(char *)mdcp)