diff options
Diffstat (limited to 'cpukit/libcrypt')
-rw-r--r-- | cpukit/libcrypt/crypt-md5.c | 2 | ||||
-rw-r--r-- | cpukit/libcrypt/crypt-sha256.c | 15 | ||||
-rw-r--r-- | cpukit/libcrypt/crypt-sha512.c | 15 | ||||
-rw-r--r-- | cpukit/libcrypt/crypt.c | 2 | ||||
-rw-r--r-- | cpukit/libcrypt/misc.c | 4 |
5 files changed, 14 insertions, 24 deletions
diff --git a/cpukit/libcrypt/crypt-md5.c b/cpukit/libcrypt/crypt-md5.c index c60dcf8973..ca86bcd9b7 100644 --- a/cpukit/libcrypt/crypt-md5.c +++ b/cpukit/libcrypt/crypt-md5.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 Poul-Henning Kamp * All rights reserved. * diff --git a/cpukit/libcrypt/crypt-sha256.c b/cpukit/libcrypt/crypt-sha256.c index 7a677284b5..24373680f7 100644 --- a/cpukit/libcrypt/crypt-sha256.c +++ b/cpukit/libcrypt/crypt-sha256.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -67,15 +69,12 @@ crypt_sha256_r(const char *key, const char *salt, struct crypt_data *data) uint8_t alt_result[32], temp_result[32]; SHA256_CTX ctx, alt_ctx; size_t salt_len, key_len, cnt, rounds; - char *cp, *copied_key, *copied_salt, *p_bytes, *s_bytes, *endp; + char *cp, *p_bytes, *s_bytes, *endp; const char *num; bool rounds_custom; char *buffer = &data->buffer[0]; int buflen = (int)sizeof(data->buffer); - copied_key = NULL; - copied_salt = NULL; - /* Default number of rounds. */ rounds = ROUNDS_DEFAULT; rounds_custom = false; @@ -258,12 +257,6 @@ crypt_sha256_r(const char *key, const char *salt, struct crypt_data *data) memset(temp_result, '\0', sizeof(temp_result)); memset(p_bytes, '\0', key_len); memset(s_bytes, '\0', salt_len); - memset(&ctx, '\0', sizeof(ctx)); - memset(&alt_ctx, '\0', sizeof(alt_ctx)); - if (copied_key != NULL) - memset(copied_key, '\0', key_len); - if (copied_salt != NULL) - memset(copied_salt, '\0', salt_len); return buffer; } diff --git a/cpukit/libcrypt/crypt-sha512.c b/cpukit/libcrypt/crypt-sha512.c index d418b8946a..da8acd7790 100644 --- a/cpukit/libcrypt/crypt-sha512.c +++ b/cpukit/libcrypt/crypt-sha512.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -67,15 +69,12 @@ crypt_sha512_r(const char *key, const char *salt, struct crypt_data *data) uint8_t alt_result[64], temp_result[64]; SHA512_CTX ctx, alt_ctx; size_t salt_len, key_len, cnt, rounds; - char *cp, *copied_key, *copied_salt, *p_bytes, *s_bytes, *endp; + char *cp, *p_bytes, *s_bytes, *endp; const char *num; bool rounds_custom; char *buffer = &data->buffer[0]; int buflen = (int)sizeof(data->buffer); - copied_key = NULL; - copied_salt = NULL; - /* Default number of rounds. */ rounds = ROUNDS_DEFAULT; rounds_custom = false; @@ -270,12 +269,6 @@ crypt_sha512_r(const char *key, const char *salt, struct crypt_data *data) memset(temp_result, '\0', sizeof(temp_result)); memset(p_bytes, '\0', key_len); memset(s_bytes, '\0', salt_len); - memset(&ctx, '\0', sizeof(ctx)); - memset(&alt_ctx, '\0', sizeof(alt_ctx)); - if (copied_key != NULL) - memset(copied_key, '\0', key_len); - if (copied_salt != NULL) - memset(copied_salt, '\0', salt_len); return buffer; } diff --git a/cpukit/libcrypt/crypt.c b/cpukit/libcrypt/crypt.c index a571ce60f4..bbbb697fa8 100644 --- a/cpukit/libcrypt/crypt.c +++ b/cpukit/libcrypt/crypt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 embedded brains GmbH. All rights reserved. + * Copyright (c) 2014 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/cpukit/libcrypt/misc.c b/cpukit/libcrypt/misc.c index 5daffba391..b553068f10 100644 --- a/cpukit/libcrypt/misc.c +++ b/cpukit/libcrypt/misc.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1999 * University of California. All rights reserved. * |