4002N/A# Patch developed in-house. Solaris-specific; not suitable for upstream.
4002N/A * The LHASH callbacks ("hash" & "cmp") have been replaced by functions with
4002N/A * the base prototypes (we cast each variable inside the function to the
363N/A static void lock_dbg_cb(int mode, int type, const char *file, int line)
4002N/A- static int modes[CRYPTO_NUM_LOCKS]; /* = {0, 0, ... } */
4002N/A- if (type < 0 || type >= CRYPTO_NUM_LOCKS) {
4002N/A+ if (type < 0 || type >= CRYPTO_num_locks()) {
4002N/A errstr = "type out of bounds";
4002N/A if (getenv("OPENSSL_DEBUG_LOCKING") != NULL)
4002N/A+ modes = OPENSSL_malloc(CRYPTO_num_locks() * sizeof (int));
4002N/A+ ERR_load_crypto_strings();
4002N/A+ BIO_printf(bio_err,"Memory allocation failure\n");
4002N/A+ ERR_print_errors(bio_err);
4002N/A+ memset(modes, 0, CRYPTO_num_locks() * sizeof (int));
4002N/A CRYPTO_set_locking_callback(lock_dbg_cb);
4002N/A CRYPTO_set_locking_callback(lock_dbg_cb);
363N/A+ * Add a further check for the FIPS_mode_set() symbol before calling to
363N/A+ * allow openssl(1openssl) to be run against both fips and non-fips libraries.
4002N/A if (getenv("OPENSSL_FIPS")) {
4002N/A+ int (*FIPS_mode_set)(int);
4002N/A+ FIPS_mode_set = (int (*)(int)) dlsym(RTLD_NEXT, "FIPS_mode_set");
4002N/A+ if (FIPS_mode_set != NULL) {
4002N/A+ if (!(*FIPS_mode_set)(1)) {
4002N/A ERR_print_errors(BIO_new_fp(stderr, BIO_NOCLOSE));
4002N/A- fprintf(stderr, "FIPS mode not supported.\n");
4002N/A+ fprintf(stderr, "Failed to enable FIPS mode. "
4002N/A+ "For more information about running in FIPS mode see openssl(5).\n");