summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-04-11 16:16:16 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-04-11 16:16:16 +0000
commit10dfdb70197abfe81d73d69fdb5be31bac1b9aa0 (patch)
treeb2f4872bf09cebaa54fb4da1687abf5524de7cbe /lib
parent1c615d78562f58d4f327221f9e9fbbe61ea8453e (diff)
Send OPENSSL_issetugid() straight to hell, no final cigarette.
The issetugid() API is supposed to make a strong promise where "0 means it is safe to look at the environment". Way back in the past someone on the OpenSSL team responded to the environment access danger by creating a wrapper called OPENSSL_issetugid, and went to use it a number of places. However, by default on systems lacking true issetugid(), OPENSSL_issetugid returns 0. 0 indicating safely. False safety. Which means OPENSSL_issetugid() fails to make any sort of promise about safety, in fact it is just the opposite. Can you believe the OpenSSL team? This nastiness was noticed over the years, however noone could gain traction and get it fixed in OpenSSL. Also see a paragraph about this in http://www.tedunangst.com/flak/post/worst-common-denominator-programming ok jsing
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/crypto/Makefile4
-rw-r--r--lib/libcrypto/crypto/shlib_version2
-rw-r--r--lib/libssl/src/crypto/crypto.h4
-rw-r--r--lib/libssl/src/crypto/uid.c12
4 files changed, 4 insertions, 18 deletions
diff --git a/lib/libcrypto/crypto/Makefile b/lib/libcrypto/crypto/Makefile
index 4e8f489c2d5..a4e65fd6a6d 100644
--- a/lib/libcrypto/crypto/Makefile
+++ b/lib/libcrypto/crypto/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.56 2015/02/10 13:28:17 jsing Exp $
+# $OpenBSD: Makefile,v 1.57 2015/04/11 16:16:15 deraadt Exp $
LIB= crypto
@@ -27,7 +27,7 @@ CFLAGS+= -I${LCRYPTO_SRC}/modes -I${LCRYPTO_SRC}/asn1 -I${LCRYPTO_SRC}/evp
# crypto/
SRCS+= cryptlib.c malloc-wrapper.c mem_dbg.c cversion.c ex_data.c cpt_err.c
-SRCS+= uid.c o_time.c o_str.c o_init.c
+SRCS+= o_time.c o_str.c o_init.c
SRCS+= mem_clr.c
# aes/
diff --git a/lib/libcrypto/crypto/shlib_version b/lib/libcrypto/crypto/shlib_version
index 2e4d25cdf59..ed8f7473b52 100644
--- a/lib/libcrypto/crypto/shlib_version
+++ b/lib/libcrypto/crypto/shlib_version
@@ -1,2 +1,2 @@
-major=32
+major=33
minor=0
diff --git a/lib/libssl/src/crypto/crypto.h b/lib/libssl/src/crypto/crypto.h
index 27b7f3fe022..4012f1c99aa 100644
--- a/lib/libssl/src/crypto/crypto.h
+++ b/lib/libssl/src/crypto/crypto.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypto.h,v 1.33 2015/02/07 13:19:15 doug Exp $ */
+/* $OpenBSD: crypto.h,v 1.34 2015/04/11 16:16:15 deraadt Exp $ */
/* ====================================================================
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
*
@@ -348,8 +348,6 @@ int CRYPTO_is_mem_check_on(void);
const char *SSLeay_version(int type);
unsigned long SSLeay(void);
-int OPENSSL_issetugid(void);
-
/* An opaque type representing an implementation of "ex_data" support */
typedef struct st_CRYPTO_EX_DATA_IMPL CRYPTO_EX_DATA_IMPL;
/* Return an opaque pointer to the current "ex_data" implementation */
diff --git a/lib/libssl/src/crypto/uid.c b/lib/libssl/src/crypto/uid.c
deleted file mode 100644
index c1bd92756bd..00000000000
--- a/lib/libssl/src/crypto/uid.c
+++ /dev/null
@@ -1,12 +0,0 @@
-/* $OpenBSD: uid.c,v 1.8 2014/06/12 15:49:27 deraadt Exp $ */
-/*
- * Written by Theo de Raadt. Public domain.
- */
-
-#include <unistd.h>
-
-int
-OPENSSL_issetugid(void)
-{
- return issetugid();
-}