Fix warnings from both the compiler and the static analyzer.
Reword cracklib/HISTORY to consistently use the past tense.
* Modified the adjacent character check to depend on the password length.
* Remove checks against the user's GECOS entry.
* Don't exit on failure to open the database.
* Modified the adjacent character check to depend on the password length.
* Remove checks against the user's GECOS entry.
* Don't exit on failure to open the database.
- * Improve the search algorithm in FindPW somewhat.
+ * Improved the search algorithm in FindPW somewhat.
* Don't segfault on corrupt dictionaries.
* Fixed the data format output by packer to properly pad the end.
* Don't segfault on corrupt dictionaries.
* Fixed the data format output by packer to properly pad the end.
- * Add ANSI C prototypes for all functions and mark const variables.
- * Remove unused functions.
- * Various compilation warning and portability fixes.
- * Use Autoconf and portable/system.h to find types of specific lengths.
- * Increase MINLENGTH.
- * Add a check for a duplicated dictionary word.
+ * Added ANSI C prototypes for all functions and mark const variables.
+ * Removed unused functions.
+ * Increased MINLENGTH.
+ * Added a check for a duplicated dictionary word.
* Changed error for very short passwords to match current CrackLib.
* Changed error for very short passwords to match current CrackLib.
- * Remove last block optimization in GetPW and start fresh each time.
+ * Removed last block optimization in GetPW and start fresh each time.
* Close the dictionary after each password lookup.
* Set hidden visibility on all CrackLib symbols.
* Close the wfp file handle on PWClose if it's open.
* Close the dictionary after each password lookup.
* Set hidden visibility on all CrackLib symbols.
* Close the wfp file handle on PWClose if it's open.
* Changed the type of some variables to size_t to avoid truncation.
* Forced locale in mkdict to avoid problems with non-C-locale sort.
* Added a warning to packer if processing out-of-order words.
* Changed the type of some variables to size_t to avoid truncation.
* Forced locale in mkdict to avoid problems with non-C-locale sort.
* Added a warning to packer if processing out-of-order words.
- * Added cast of CRACK_TOLOWER and CRACK_TOUPPER to char.
+ * Used Autoconf and portable/system.h to find types of specific lengths.
* Added missing break to RULE_MFIRST "(" and RULE_MLAST ")" handling.
* Added missing break to RULE_MFIRST "(" and RULE_MLAST ")" handling.
+ * Various compilation warning and portability fixes.
See the leading comments in each source file for a more detailed timeline
and list of changes.
See the leading comments in each source file for a more detailed timeline
and list of changes.
* 2020-05-16 Russ Allbery <eagle@eyrie.org>
* - Change variables from int to size_t to silence warnings.
* - Add missing break to RULE_MFIRST and RULE_MLAST handling.
* 2020-05-16 Russ Allbery <eagle@eyrie.org>
* - Change variables from int to size_t to silence warnings.
* - Add missing break to RULE_MFIRST and RULE_MLAST handling.
+ * - Remove break after return to silence Clang warnings.
default:
Debug(1, "MatchClass: unknown class %c\n", class);
return (0);
default:
Debug(1, "MatchClass: unknown class %c\n", class);
return (0);
default:
Debug(1, "Mangle: unknown command %c in %s\n", *ptr, control);
return ((char *) 0);
default:
Debug(1, "Mangle: unknown command %c in %s\n", *ptr, control);
return ((char *) 0);
}
}
if (!area[0]) /* have we deweted de poor widdle fing away? */
}
}
if (!area[0]) /* have we deweted de poor widdle fing away? */
code = strength_error_dict(ctx, ERROR_DICT);
fail:
code = strength_error_dict(ctx, ERROR_DICT);
fail:
- memset(prefix, 0, length);
+ if (prefix != NULL)
+ memset(prefix, 0, length);
memset(drowssap, 0, length);
free(prefix);
free(drowssap);
memset(drowssap, 0, length);
free(prefix);
free(drowssap);
# The canonical representation of our password tests is in JSON, but I don't
# want to require a JSON parser for the C tests to run. This script reads the
# JSON input and generates a C data structure that holds all of the tests.
# The canonical representation of our password tests is in JSON, but I don't
# want to require a JSON parser for the C tests to run. This script reads the
# JSON input and generates a C data structure that holds all of the tests.
+#
+# SPDX-License-Identifier: MIT
* for the use in C test programs. To make changes, modify the original
* JSON source or (more rarely) the make-c-data script and run it again.
*
* for the use in C test programs. To make changes, modify the original
* JSON source or (more rarely) the make-c-data script and run it again.
*
+ * Written by Russ Allbery <eagle@eyrie.org>
+ * Copyright 2020 Russ Allbery <eagle@eyrie.org>
* Copyright 2013
* The Board of Trustees of the Leland Stanford Junior University
*
* Copyright 2013
* The Board of Trustees of the Leland Stanford Junior University
*
- * See LICENSE for licensing terms.
+ * SPDX-License-Identifier: MIT
*/
#include <tests/data/passwords/tests.h>
*/
#include <tests/data/passwords/tests.h>
my $name = basename($datafile);
$name =~ s{ [.]json \z }{}xms;
print_fh(\*STDOUT, $HEADER);
my $name = basename($datafile);
$name =~ s{ [.]json \z }{}xms;
print_fh(\*STDOUT, $HEADER);
+say_fh(\*STDOUT, "extern const struct password_test ${name}_tests[];");
say_fh(\*STDOUT, "const struct password_test ${name}_tests[] = {");
# Print out the test data.
say_fh(\*STDOUT, "const struct password_test ${name}_tests[] = {");
# Print out the test data.
=head1 COPYRIGHT AND LICENSE
=head1 COPYRIGHT AND LICENSE
+Copyright 2020 Russ Alllbery <eagle@eyrie.org>
+
Copyright 2013 The Board of Trustees of the Leland Stanford Junior
University
Copyright 2013 The Board of Trustees of the Leland Stanford Junior
University
char *path;
krb5_error_code code;
krb5_pwqual_vtable vtable = NULL;
char *path;
krb5_error_code code;
krb5_pwqual_vtable vtable = NULL;
- krb5_error_code (*init)(krb5_context, int, int, krb5_plugin_vtable);
+ pwqual_strength_initvt *init;
/* Load the module. */
path = test_file_path("../plugin/.libs/strength.so");
/* Load the module. */
path = test_file_path("../plugin/.libs/strength.so");
test_file_path_free(path);
/* Find the entry point function. */
test_file_path_free(path);
/* Find the entry point function. */
- init = dlsym(*handle, "pwqual_strength_initvt");
+ init = (pwqual_strength_initvt *) dlsym(*handle, "pwqual_strength_initvt");
if (init == NULL)
bail("cannot get pwqual_strength_initvt symbol: %s", dlerror());
if (init == NULL)
bail("cannot get pwqual_strength_initvt symbol: %s", dlerror());