summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2025-04-23 10:09:08 +0000
committerjsing <>2025-04-23 10:09:08 +0000
commit273e048d695a49faad75ca2ffa6e445353142be8 (patch)
treed1c2ceba5dcba84401a9f27175cd75d24ed0522c /src
parentfc19b6b60b2fc471fedda6057b5e1e5c20ccb6b8 (diff)
downloadopenbsd-273e048d695a49faad75ca2ffa6e445353142be8.tar.gz
openbsd-273e048d695a49faad75ca2ffa6e445353142be8.tar.bz2
openbsd-273e048d695a49faad75ca2ffa6e445353142be8.zip
Unifdef OPENSSL_SMALL_FOOTPRINT.
We do not build with OPENSSL_SMALL_FOOTPRINT and it removes more untested code paths. Request by tb@ (and it was already on my TODO list!)
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/des/des_local.h6
-rw-r--r--src/lib/libcrypto/modes/cbc128.c6
-rw-r--r--src/lib/libcrypto/modes/cfb128.c6
-rw-r--r--src/lib/libcrypto/modes/ctr128.c6
-rw-r--r--src/lib/libcrypto/modes/ofb128.c4
5 files changed, 5 insertions, 23 deletions
diff --git a/src/lib/libcrypto/des/des_local.h b/src/lib/libcrypto/des/des_local.h
index 61bfde7520..077c03139f 100644
--- a/src/lib/libcrypto/des/des_local.h
+++ b/src/lib/libcrypto/des/des_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: des_local.h,v 1.5 2024/08/31 16:22:18 jsing Exp $ */ 1/* $OpenBSD: des_local.h,v 1.6 2025/04/23 10:08:20 jsing Exp $ */
2/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -217,10 +217,6 @@ ROTATE(uint32_t a, uint32_t n)
217 217
218extern const DES_LONG DES_SPtrans[8][64]; 218extern const DES_LONG DES_SPtrans[8][64];
219 219
220#ifdef OPENSSL_SMALL_FOOTPRINT
221#undef DES_UNROLL
222#endif
223
224__END_HIDDEN_DECLS 220__END_HIDDEN_DECLS
225 221
226#endif 222#endif
diff --git a/src/lib/libcrypto/modes/cbc128.c b/src/lib/libcrypto/modes/cbc128.c
index 5767533c44..1b6858ee25 100644
--- a/src/lib/libcrypto/modes/cbc128.c
+++ b/src/lib/libcrypto/modes/cbc128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cbc128.c,v 1.10 2025/04/21 16:01:18 jsing Exp $ */ 1/* $OpenBSD: cbc128.c,v 1.11 2025/04/23 10:09:08 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2008 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -70,7 +70,6 @@ CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
70 size_t n; 70 size_t n;
71 const unsigned char *iv = ivec; 71 const unsigned char *iv = ivec;
72 72
73#if !defined(OPENSSL_SMALL_FOOTPRINT)
74 if (STRICT_ALIGNMENT && 73 if (STRICT_ALIGNMENT &&
75 ((size_t)in|(size_t)out|(size_t)ivec) % sizeof(size_t) != 0) { 74 ((size_t)in|(size_t)out|(size_t)ivec) % sizeof(size_t) != 0) {
76 while (len >= 16) { 75 while (len >= 16) {
@@ -94,7 +93,6 @@ CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
94 out += 16; 93 out += 16;
95 } 94 }
96 } 95 }
97#endif
98 while (len) { 96 while (len) {
99 for (n = 0; n < 16 && n < len; ++n) 97 for (n = 0; n < 16 && n < len; ++n)
100 out[n] = in[n] ^ iv[n]; 98 out[n] = in[n] ^ iv[n];
@@ -123,7 +121,6 @@ CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
123 unsigned char c[16]; 121 unsigned char c[16];
124 } tmp; 122 } tmp;
125 123
126#if !defined(OPENSSL_SMALL_FOOTPRINT)
127 if (in != out) { 124 if (in != out) {
128 const unsigned char *iv = ivec; 125 const unsigned char *iv = ivec;
129 126
@@ -188,7 +185,6 @@ CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
188 } 185 }
189 } 186 }
190 } 187 }
191#endif
192 while (len) { 188 while (len) {
193 unsigned char c; 189 unsigned char c;
194 (*block)(in, tmp.c, key); 190 (*block)(in, tmp.c, key);
diff --git a/src/lib/libcrypto/modes/cfb128.c b/src/lib/libcrypto/modes/cfb128.c
index 4f9dac178d..9a63a46724 100644
--- a/src/lib/libcrypto/modes/cfb128.c
+++ b/src/lib/libcrypto/modes/cfb128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cfb128.c,v 1.9 2025/04/21 16:01:18 jsing Exp $ */ 1/* $OpenBSD: cfb128.c,v 1.10 2025/04/23 10:09:08 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2008 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -71,7 +71,6 @@ CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
71 n = *num; 71 n = *num;
72 72
73 if (enc) { 73 if (enc) {
74#if !defined(OPENSSL_SMALL_FOOTPRINT)
75 if (16 % sizeof(size_t) == 0) 74 if (16 % sizeof(size_t) == 0)
76 do { /* always true actually */ 75 do { /* always true actually */
77 while (n && len) { 76 while (n && len) {
@@ -107,7 +106,6 @@ CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
107 return; 106 return;
108 } while (0); 107 } while (0);
109 /* the rest would be commonly eliminated by x86* compiler */ 108 /* the rest would be commonly eliminated by x86* compiler */
110#endif
111 while (l < len) { 109 while (l < len) {
112 if (n == 0) { 110 if (n == 0) {
113 (*block)(ivec, ivec, key); 111 (*block)(ivec, ivec, key);
@@ -118,7 +116,6 @@ CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
118 } 116 }
119 *num = n; 117 *num = n;
120 } else { 118 } else {
121#if !defined(OPENSSL_SMALL_FOOTPRINT)
122 if (16 % sizeof(size_t) == 0) 119 if (16 % sizeof(size_t) == 0)
123 do { /* always true actually */ 120 do { /* always true actually */
124 while (n && len) { 121 while (n && len) {
@@ -159,7 +156,6 @@ CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
159 return; 156 return;
160 } while (0); 157 } while (0);
161 /* the rest would be commonly eliminated by x86* compiler */ 158 /* the rest would be commonly eliminated by x86* compiler */
162#endif
163 while (l < len) { 159 while (l < len) {
164 unsigned char c; 160 unsigned char c;
165 if (n == 0) { 161 if (n == 0) {
diff --git a/src/lib/libcrypto/modes/ctr128.c b/src/lib/libcrypto/modes/ctr128.c
index 6d1bcff313..30563ed6e3 100644
--- a/src/lib/libcrypto/modes/ctr128.c
+++ b/src/lib/libcrypto/modes/ctr128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ctr128.c,v 1.16 2025/04/22 14:08:24 jsing Exp $ */ 1/* $OpenBSD: ctr128.c,v 1.17 2025/04/23 10:09:08 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2008 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -76,7 +76,6 @@ ctr128_inc(unsigned char *counter)
76 } while (n); 76 } while (n);
77} 77}
78 78
79#if !defined(OPENSSL_SMALL_FOOTPRINT)
80static void 79static void
81ctr128_inc_aligned(unsigned char *counter) 80ctr128_inc_aligned(unsigned char *counter)
82{ 81{
@@ -96,7 +95,6 @@ ctr128_inc_aligned(unsigned char *counter)
96 } while (n); 95 } while (n);
97#endif 96#endif
98} 97}
99#endif
100 98
101/* The input encrypted as though 128bit counter mode is being 99/* The input encrypted as though 128bit counter mode is being
102 * used. The extra state information to record how much of the 100 * used. The extra state information to record how much of the
@@ -122,7 +120,6 @@ CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
122 120
123 OPENSSL_assert(n < 16); 121 OPENSSL_assert(n < 16);
124 122
125#if !defined(OPENSSL_SMALL_FOOTPRINT)
126 if (16 % sizeof(size_t) == 0) 123 if (16 % sizeof(size_t) == 0)
127 do { /* always true actually */ 124 do { /* always true actually */
128 while (n && len) { 125 while (n && len) {
@@ -160,7 +157,6 @@ CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
160 return; 157 return;
161 } while (0); 158 } while (0);
162 /* the rest would be commonly eliminated by x86* compiler */ 159 /* the rest would be commonly eliminated by x86* compiler */
163#endif
164 while (l < len) { 160 while (l < len) {
165 if (n == 0) { 161 if (n == 0) {
166 (*block)(ivec, ecount_buf, key); 162 (*block)(ivec, ecount_buf, key);
diff --git a/src/lib/libcrypto/modes/ofb128.c b/src/lib/libcrypto/modes/ofb128.c
index 3f5a6ce110..8440e7f583 100644
--- a/src/lib/libcrypto/modes/ofb128.c
+++ b/src/lib/libcrypto/modes/ofb128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ofb128.c,v 1.9 2025/04/21 16:01:18 jsing Exp $ */ 1/* $OpenBSD: ofb128.c,v 1.10 2025/04/23 10:09:08 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2008 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -70,7 +70,6 @@ CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
70 70
71 n = *num; 71 n = *num;
72 72
73#if !defined(OPENSSL_SMALL_FOOTPRINT)
74 if (16 % sizeof(size_t) == 0) 73 if (16 % sizeof(size_t) == 0)
75 do { /* always true actually */ 74 do { /* always true actually */
76 while (n && len) { 75 while (n && len) {
@@ -105,7 +104,6 @@ CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
105 return; 104 return;
106 } while (0); 105 } while (0);
107 /* the rest would be commonly eliminated by x86* compiler */ 106 /* the rest would be commonly eliminated by x86* compiler */
108#endif
109 while (l < len) { 107 while (l < len) {
110 if (n == 0) { 108 if (n == 0) {
111 (*block)(ivec, ivec, key); 109 (*block)(ivec, ivec, key);