/*
- * Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 2013-2014 Timo Teräs <timo.teras@gmail.com>
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
goto end;
}
if (name != NULL) {
- if ((h == HASH_NEW) || (h == HASH_BOTH))
- errs += add_entry(type, X509_NAME_hash(name), filename, digest, 1, ~0);
+ if (h == HASH_NEW || h == HASH_BOTH) {
+ int ok;
+ unsigned long hash_value =
+ X509_NAME_hash_ex(name,
+ app_get0_libctx(), app_get0_propq(), &ok);
+
+ if (ok) {
+ errs += add_entry(type, hash_value, filename, digest, 1, ~0);
+ } else {
+ BIO_printf(bio_err, "%s: error calculating SHA1 hash value\n",
+ opt_getprog());
+ errs++;
+ }
+ }
if ((h == HASH_OLD) || (h == HASH_BOTH))
- errs += add_entry(type, X509_NAME_hash_old(name), filename, digest, 1, ~0);
+ errs += add_entry(type, X509_NAME_hash_old(name),
+ filename, digest, 1, ~0);
}
end:
}
typedef enum OPTION_choice {
- OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_COMMON,
OPT_COMPAT, OPT_OLD, OPT_N, OPT_VERBOSE,
OPT_PROV_ENUM
} OPTION_CHOICE;
argv = opt_rest();
evpmd = EVP_sha1();
- evpmdsize = EVP_MD_size(evpmd);
+ evpmdsize = EVP_MD_get_size(evpmd);
if (*argv != NULL) {
while (*argv != NULL)