diff options
author | Zack Weinberg <zackw@panix.com> | 2021-02-27 19:36:43 -0500 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2021-03-07 11:00:44 -0500 |
commit | 931427d19b1f314321bf8c300f1d2cef976464bc (patch) | |
tree | 1db846d61d708127c422a8ea2c382933bc216749 | |
parent | 8ff604bf35b73a0a363c1a00f6ff529173ab4394 (diff) | |
download | libxcrypt-931427d19b1f314321bf8c300f1d2cef976464bc.tar.gz libxcrypt-931427d19b1f314321bf8c300f1d2cef976464bc.tar.bz2 libxcrypt-931427d19b1f314321bf8c300f1d2cef976464bc.zip |
Remove the XCRYPT_STRCPY_OR_ABORT macro.
All callers changed to call strcpy_or_abort directly.
-rw-r--r-- | lib/crypt-des.c | 5 | ||||
-rw-r--r-- | lib/crypt-gost-yescrypt.c | 4 | ||||
-rw-r--r-- | lib/crypt-nthash.c | 4 | ||||
-rw-r--r-- | lib/crypt-port.h | 2 | ||||
-rw-r--r-- | lib/crypt-scrypt.c | 2 | ||||
-rw-r--r-- | lib/crypt-yescrypt.c | 4 | ||||
-rw-r--r-- | test/gensalt.c | 2 |
7 files changed, 11 insertions, 12 deletions
diff --git a/lib/crypt-des.c b/lib/crypt-des.c index e3509ec..0ab786b 100644 --- a/lib/crypt-des.c +++ b/lib/crypt-des.c @@ -435,8 +435,9 @@ gensalt_bigcrypt_rn (unsigned long count, gensalt_descrypt_rn (count, rbytes, nrbytes, output, output_size); #if !INCLUDE_descrypt - /* ... add 12 trailing characters to signalize bigcrypt. */ - XCRYPT_STRCPY_OR_ABORT (output + 2, output_size - 2, "............"); + /* ... add 12 trailing dummy characters, which makes the string too + long to be a descrypt setting, thus bigcrypt will be used. */ + strcpy_or_abort (output + 2, output_size - 2, "............"); #endif } #endif diff --git a/lib/crypt-gost-yescrypt.c b/lib/crypt-gost-yescrypt.c index 51009c7..16f26a1 100644 --- a/lib/crypt-gost-yescrypt.c +++ b/lib/crypt-gost-yescrypt.c @@ -110,7 +110,7 @@ crypt_gost_yescrypt_rn (const char *phrase, size_t phr_size, intbuf->gsetting[0] = '$'; intbuf->gsetting[1] = 'y'; intbuf->gsetting[2] = '$'; - XCRYPT_STRCPY_OR_ABORT (&intbuf->gsetting[3], set_size - 3, setting + 4); + strcpy_or_abort (&intbuf->gsetting[3], set_size - 3, setting + 4); intbuf->retval = yescrypt_r (NULL, &intbuf->local, (const uint8_t *) phrase, phr_size, @@ -171,7 +171,7 @@ crypt_gost_yescrypt_rn (const char *phrase, size_t phr_size, encode64 ((uint8_t *) hptr, o_size - (size_t) ((uint8_t *) hptr - intbuf->retval), intbuf->y, sizeof (intbuf->y)); - XCRYPT_STRCPY_OR_ABORT (output, o_size, intbuf->outbuf); + strcpy_or_abort (output, o_size, intbuf->outbuf); return; } diff --git a/lib/crypt-nthash.c b/lib/crypt-nthash.c index e19fa45..2036da7 100644 --- a/lib/crypt-nthash.c +++ b/lib/crypt-nthash.c @@ -94,7 +94,7 @@ crypt_nt_rn (const char *phrase, size_t phr_size, MD4_Final (intbuf->hash, &intbuf->ctx); /* Write the computed hash to the output buffer. */ - output += XCRYPT_STRCPY_OR_ABORT (output, out_size, magic); + output += strcpy_or_abort (output, out_size, magic); *output++ = '$'; for (size_t i = 0; i < MD4_HASHLEN; i++) { @@ -128,7 +128,7 @@ gensalt_nt_rn (unsigned long count, return; } - XCRYPT_STRCPY_OR_ABORT (output, o_size, prefix); + strcpy_or_abort (output, o_size, prefix); } #endif diff --git a/lib/crypt-port.h b/lib/crypt-port.h index 995e77b..9b61c9b 100644 --- a/lib/crypt-port.h +++ b/lib/crypt-port.h @@ -177,8 +177,6 @@ extern void explicit_bzero (void *, size_t); function with unsigned char * arguments. */ #define strcpy_or_abort _crypt_strcpy_or_abort extern size_t strcpy_or_abort (void *dst, size_t d_size, const void *src); -#define XCRYPT_STRCPY_OR_ABORT(dst, d_size, src) \ - strcpy_or_abort (dst, d_size, src) /* Define ALIASNAME as a strong alias for NAME. */ diff --git a/lib/crypt-scrypt.c b/lib/crypt-scrypt.c index 5614570..5cc4110 100644 --- a/lib/crypt-scrypt.c +++ b/lib/crypt-scrypt.c @@ -234,7 +234,7 @@ gensalt_scrypt_rn (unsigned long count, if (out_p) { - XCRYPT_STRCPY_OR_ABORT (output, o_size, outbuf); + strcpy_or_abort (output, o_size, outbuf); } return; diff --git a/lib/crypt-yescrypt.c b/lib/crypt-yescrypt.c index 7a6851c..b2daf16 100644 --- a/lib/crypt-yescrypt.c +++ b/lib/crypt-yescrypt.c @@ -86,7 +86,7 @@ crypt_yescrypt_rn (const char *phrase, size_t phr_size, if (yescrypt_free_local (&intbuf->local) || !intbuf->retval) return; - XCRYPT_STRCPY_OR_ABORT (output, o_size, intbuf->outbuf); + strcpy_or_abort (output, o_size, intbuf->outbuf); return; } @@ -166,7 +166,7 @@ gensalt_yescrypt_rn (unsigned long count, return; } - XCRYPT_STRCPY_OR_ABORT (output, o_size, outbuf); + strcpy_or_abort (output, o_size, outbuf); return; } diff --git a/test/gensalt.c b/test/gensalt.c index 2d590a9..52ca242 100644 --- a/test/gensalt.c +++ b/test/gensalt.c @@ -467,7 +467,7 @@ main (void) fprintf (stderr, " ok: %s/%lu/%u -> %s\n", tcase->prefix, tcase->rounds, ent, salt); - XCRYPT_STRCPY_OR_ABORT (prev_output, CRYPT_GENSALT_OUTPUT_SIZE, salt); + strcpy_or_abort (prev_output, CRYPT_GENSALT_OUTPUT_SIZE, salt); /* Test if crypt works with this salt. */ if (!tcase->rounds) |