Denys Vlasenko
ee2ef17cc7
tftp: use bb_error_msg instead of info_msg for a debug message
...
This is the only use of bb_info_msg in tftp.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-18 10:42:09 +02:00
Denys Vlasenko
27e1fc679e
ntpd: replace two bb_info_msg's with bb_error_msg
...
All other messages are printed via bb_error_msg in this applet.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-18 10:34:17 +02:00
Denys Vlasenko
504f44436f
sulogin: set ^C to SIG_DFL before execing the shell
...
function old new delta
sulogin_main 331 340 +9
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-18 07:29:24 +02:00
Denys Vlasenko
d2ef2c75c5
password applets: update help text
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-18 07:28:32 +02:00
Denys Vlasenko
dde90f1d47
libbb.h: increase MAX_PW_SALT_LEN
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-17 17:34:14 +02:00
Denys Vlasenko
b823735b7e
libbb/yescrypt: actually, largest allowed salt is 86 chars, support that
...
function old new delta
yescrypt_r 767 756 -11
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-17 17:01:40 +02:00
Denys Vlasenko
abe0b45cd7
libbb/yescrypt: code shrink
...
function old new delta
blockmix_xor 1177 702 -475
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-15 05:47:18 +02:00
Denys Vlasenko
e62bfbcaed
libbb/yescrypt: code shrink
...
function old new delta
salsa20 684 650 -34
blockmix_salsa8 198 144 -54
blockmix 762 565 -197
blockmix_xor 1322 1028 -294
blockmix_xor_save 1499 1103 -396
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/5 up/down: 0/-975) Total: -975 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-11 08:58:07 +02:00
Denys Vlasenko
95f169f3bb
libbb/yescrypt: code shrink
...
function old new delta
static.yescrypt_kdf32_body 847 823 -24
yescrypt_r 805 767 -38
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-62) Total: -62 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-09 10:38:11 +02:00
Denys Vlasenko
11d4c08d75
libbb/bitops.c: add inlining comment
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-09 08:21:47 +02:00
Denys Vlasenko
c305c81c94
libbb: introduce and use block-XOR functions
...
On x86_64, they can be done in 16-byte blocks
64-bit:
function old new delta
xorbuf_3 - 84 +84
xorbuf64_3_aligned64 - 58 +58
smix1 687 712 +25
xwrite_encrypted 520 534 +14
xorbuf16_aligned_long - 13 +13
tls_xread_record 733 742 +9
xorbuf 21 13 -8
xorbuf_aligned_AES_BLOCK_SIZE 15 - -15
blockmix 814 762 -52
blockmix_salsa8 317 198 -119
blockmix_xor_save 1620 1499 -121
blockmix_xor 1543 1322 -221
------------------------------------------------------------------------------
(add/remove: 4/1 grow/shrink: 3/5 up/down: 203/-536) Total: -333 bytes
32-bit:
function old new delta
xorbuf_3 - 76 +76
xorbuf64_3_aligned64 - 36 +36
xorbuf16_aligned_long - 23 +23
xwrite_encrypted 499 507 +8
tls_xread_record 646 650 +4
xorbuf 22 11 -11
xorbuf_aligned_AES_BLOCK_SIZE 23 - -23
blockmix 1083 938 -145
blockmix_salsa8 415 210 -205
blockmix_salsa8_xor 601 163 -438
blockmix_xor 2103 1533 -570
blockmix_xor_save 2614 1859 -755
------------------------------------------------------------------------------
(add/remove: 4/1 grow/shrink: 2/6 up/down: 147/-2147) Total: -2000 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-09 07:00:59 +02:00
Denys Vlasenko
e9c21c5c3a
hush: fix SEGV on "echo << >" and such
...
function old new delta
.rodata 105787 105823 +36
fetch_heredocs 461 477 +16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 52/0) Total: 52 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-08 10:36:12 +02:00
Denys Vlasenko
7b313c3465
libbb: code shrink in sha_crypt()
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-08 10:04:47 +02:00
Denys Vlasenko
0930708794
libbb/yescrypt: disable NROM code
...
function old new delta
smix1 - 595 +595
smix2 - 414 +414
static.yescrypt_kdf32_body 899 847 -52
static.smix2 420 - -420
static.smix1 604 - -604
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 0/1 up/down: 1009/-1076) Total: -67 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-08 06:52:27 +02:00
Denys Vlasenko
d0f0874d57
libbb/yescrypt: disable code which accepts unusual yescrypt parameters
...
Almost any reasonable yescrypt hashes in /etc/shadow should only ever use
"jXY" parameters which set N and r. Fancy multi-byte-encoded
wide integers are not needed for that.
function old new delta
static.yescrypt_kdf32_body - 899 +899
static.PBKDF2_SHA256 213 219 +6
decode64_uint32 141 - -141
yescrypt_r 990 805 -185
yescrypt_kdf32_body 1423 - -1423
------------------------------------------------------------------------------
(add/remove: 1/2 grow/shrink: 1/1 up/down: 905/-1749) Total: -844 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-08 05:34:41 +02:00
Denys Vlasenko
78bd8a44b7
libbb/yescrypt: explain and shrink decode64_uint32()
...
function old new delta
decode64_uint32 177 141 -36
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-08 03:47:48 +02:00
Denys Vlasenko
d18ac080e4
libbb/yescrypt: code shrink
...
Setting EINVAL in errno is not necessary, just error return works.
function old new delta
yescrypt_kdf32_body 1434 1423 -11
yescrypt_r 1029 990 -39
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-50) Total: -50 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-08 00:16:56 +02:00
Denys Vlasenko
8466c3e78f
libbb/yescrypt: madvise(MADV_HUGEPAGE) our usually very large allocation
...
Nearly ~2 faster run when buffer is gigabytes in size
function old new delta
yescrypt_kdf32_body 1386 1406 +20
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 23:07:58 +02:00
Denys Vlasenko
f8e9bd30d7
libbb/yescrypt: disable unrolling in two places
...
Also, make many define macros safer
function old new delta
blockmix 2300 814 -1486
blockmix_xor 4606 1543 -3063
blockmix_xor_save 4737 1620 -3117
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-7666) Total: -7666 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 22:34:31 +02:00
Denys Vlasenko
e5d3a87633
libbb/yescrypt: 64-bit build fixes
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 21:52:39 +02:00
Denys Vlasenko
7798f651a4
add libbb/yescrypt/PARAMETERS
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 21:36:31 +02:00
Denys Vlasenko
67b98c7b1b
libbb/yescrypt: no need to find salt-terminating "$" twice
...
function old new delta
yescrypt_r 1048 1029 -19
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 18:28:56 +02:00
Denys Vlasenko
e3484095f9
libbb/yescrypt: code shrink
...
function old new delta
yescrypt_r 1063 1048 -15
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 18:03:10 +02:00
Denys Vlasenko
5e9b95ff40
cryptpw: -m sha512crypt must also be accepted
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 17:42:35 +02:00
Denys Vlasenko
479d8db99f
libbb/yescrypt: fix salts ending in dots (corresponding to binary zeros)
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 17:26:47 +02:00
Denys Vlasenko
75758c7360
libbb/yescrypt: accept longer salts (up to 84 chars)
...
function old new delta
cryptpw_main 214 223 +9
chpasswd_main 347 356 +9
passwd_main 931 934 +3
yescrypt_r 1084 1056 -28
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 21/-28) Total: -7 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 17:08:32 +02:00
Denys Vlasenko
63025e8bca
libbb/yescrypt: remove forgotten SHA256 HMAC header file
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 10:51:13 +02:00
Denys Vlasenko
f464be22bd
libbb/yescrypt: make it possible to set constant parameters, and set YESCRYPT_RW
...
function old new delta
yescrypt_kdf32_body 1052 1420 +368
yescrypt_r 1133 1084 -49
static.smix 762 - -762
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/1 up/down: 368/-811) Total: -443 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 10:39:14 +02:00
Denys Vlasenko
c11730490a
libbb/yescrypt: remove redundant SHA256 HMAC implementation
...
function old new delta
hmac_blocks - 88 +88
static.PBKDF2_SHA256 176 213 +37
yescrypt_kdf32_body 1046 1052 +6
static.smix 759 762 +3
hmac_block 88 64 -24
HMAC_SHA256_Final 53 - -53
HMAC_SHA256_Buf 58 - -58
HMAC_SHA256_Init 159 - -159
------------------------------------------------------------------------------
(add/remove: 1/3 grow/shrink: 3/1 up/down: 134/-294) Total: -160 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 08:21:44 +02:00
Denys Vlasenko
1a0913d57c
libbb: factor out HMAC code from TLS
...
function old new delta
hmac_block - 88 +88
hmac_peek_hash - 61 +61
hmac_end - 50 +50
hmac_begin 140 177 +37
hmac_hash_v - 30 +30
.rodata 105799 105787 -12
hmac_sha_precomputed 54 - -54
hmac_sha_precomputed_v 69 - -69
hmac 83 - -83
------------------------------------------------------------------------------
(add/remove: 5/3 grow/shrink: 1/1 up/down: 266/-218) Total: 48 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 07:44:01 +02:00
Denys Vlasenko
e2091c9842
libbb: add two more forgotten source files
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 04:57:16 +02:00
Denys Vlasenko
a2a5db41a3
libbb/pw_ascii64.c: add forgotten source file
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-07 00:04:10 +02:00
Denys Vlasenko
53de6e6150
libbb/yescrypt: use common ascii64 encoding routine
...
function old new delta
num2str64_lsb_first 33 46 +13
yescrypt_r 1235 1133 -102
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 13/-102) Total: -89 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 22:43:28 +02:00
Denys Vlasenko
5e17e3c6f4
libbb: shuffle ascii64 code around, shrink i2a64()
...
function old new delta
num2str64_4chars_msb_first - 55 +55
num2str64_lsb_first - 33 +33
i2a64 42 25 -17
to64 33 - -33
to64_msb_first 55 - -55
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 0/1 up/down: 88/-105) Total: -17 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 21:59:03 +02:00
Denys Vlasenko
f3a1b7be72
libbb/yescrypt: remove one NOINLINE, add copyright headers, merge two source files
...
function old new delta
pw_encrypt 945 974 +29
yes_crypt 50 - -50
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/0 up/down: 29/-50) Total: -21 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 20:59:00 +02:00
Denys Vlasenko
0574928c85
libbb/yescrypt: remove unused prefetching code
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 20:08:53 +02:00
Denys Vlasenko
aebe6f7132
libbb/yescrypt: remove inlines (whcih gcc detects anyway) and dead ifderfs
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 19:47:29 +02:00
Denys Vlasenko
447eb6bf71
libbb: in DES crypt, error out on invalid salt chars
...
function old new delta
des_crypt 1308 1327 +19
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 19:30:58 +02:00
Denys Vlasenko
82bbbd2e53
libbb: code shrink in DES crypt
...
function old new delta
pw_encrypt 941 945 +4
bits32 128 - -128
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/0 up/down: 4/-128) Total: -124 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 19:14:09 +02:00
Denys Vlasenko
23b5527f5c
libbb/yescrypt: use common ACSII char-to-64 conversion code
...
function old new delta
a2i64 - 46 +46
yescrypt_r 1215 1235 +20
decode64_uint32 167 177 +10
atoi64 25 - -25
ascii_to_bin 53 - -53
static.atoi64_partial 77 - -77
------------------------------------------------------------------------------
(add/remove: 1/3 grow/shrink: 2/0 up/down: 76/-155) Total: -79 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 19:08:57 +02:00
Denys Vlasenko
f5af8aefea
libbb/yescrypt: shrink PBKDF2
...
function old new delta
static.PBKDF2_SHA256 189 176 -13
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 18:35:37 +02:00
Denys Vlasenko
b8f7600166
libbb/yescrypt: more efficient byteswapping
...
function old new delta
static.smix1 631 604 -27
static.smix2 452 420 -32
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-59) Total: -59 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 18:27:16 +02:00
Denys Vlasenko
9c4cd75d12
restore mangled comment
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 11:16:43 +02:00
Denys Vlasenko
0893bc3bac
libbb/yescrypt: code shrink
...
static.PBKDF2_SHA256 - 189 +189
HMAC_SHA256_Init - 159 +159
HMAC_SHA256_Buf - 58 +58
HMAC_SHA256_Final - 53 +53
i2a64 - 42 +42
yescrypt_r 1221 1215 -6
yescrypt_kdf32_body 1064 1046 -18
i64c 42 - -42
libcperciva_HMAC_SHA256_Final 53 - -53
libcperciva_HMAC_SHA256_Buf 58 - -58
ascii64 65 - -65
libcperciva_HMAC_SHA256_Init 159 - -159
PBKDF2_SHA256 386 - -386
------------------------------------------------------------------------------
(add/remove: 5/6 grow/shrink: 0/2 up/down: 501/-787) Total: -286 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 11:12:13 +02:00
Denys Vlasenko
b21cd481db
libbb/yescrypt: code shrink
...
function old new delta
libcperciva_HMAC_SHA256_Final 56 53 -3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 11:02:03 +02:00
Denys Vlasenko
62abd47815
Move "sha256-hash a memory array and produce the digest" helper to libbb
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 10:50:46 +02:00
Denys Vlasenko
4e5a6b6dbb
libbb/yescrypt: remove extra sha256 implementation
...
function old new delta
libcperciva_HMAC_SHA256_Init - 159 +159
libcperciva_HMAC_SHA256_Final - 56 +56
SHA256_Buf - 40 +40
static.smix 753 759 +6
yescrypt_kdf32_body 1059 1060 +1
.rodata 105803 105799 -4
initial_state 32 - -32
libcperciva_SHA256_Init 37 - -37
static.cpu_to_be32_vect 51 - -51
_HMAC_SHA256_Final 55 - -55
PAD 64 - -64
libcperciva_HMAC_SHA256_Buf 132 58 -74
libcperciva_SHA256_Buf 86 - -86
SHA256_Pad_Almost 131 - -131
_SHA256_Final 195 - -195
_SHA256_Update 198 - -198
_HMAC_SHA256_Init 213 - -213
Krnd 256 - -256
PBKDF2_SHA256 1003 386 -617
SHA256_Transform 3083 - -3083
------------------------------------------------------------------------------
(add/remove: 3/12 grow/shrink: 2/3 up/down: 262/-5096) Total: -4834 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 10:35:22 +02:00
Denys Vlasenko
ffac25d056
libbb/yescrypt: comment tweaks
...
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 07:43:04 +02:00
Denys Vlasenko
8be6dafe94
libbb/yescrypt: use mmap for allocation, it's large - 16Mbytes
...
This automatically gives it alignment sufficient for any future SIMD
optimizations.
function old new delta
yescrypt_r 1217 1221 +4
yescrypt_kdf32_body 1077 1059 -18
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 4/-18) Total: -14 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 06:50:18 +02:00
Denys Vlasenko
736589f877
libbb/yescrypt: reduce the number of function parameters
...
function old new delta
yescrypt_kdf32_body - 1077 +1077
static.smix 739 753 +14
yescrypt_init_local 34 - -34
yes_crypt 87 50 -37
yescrypt_free_local 49 - -49
yescrypt_r 1288 1217 -71
static.yescrypt_kdf_body 1166 - -1166
------------------------------------------------------------------------------
(add/remove: 1/3 grow/shrink: 1/2 up/down: 1091/-1357) Total: -266 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-06 06:05:08 +02:00