* project 2000.
*/
/* ====================================================================
- * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#include "vendor_defns/atalla.h"
#endif
+static int atalla_destroy(ENGINE *e);
static int atalla_init(ENGINE *e);
static int atalla_finish(ENGINE *e);
static int atalla_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)());
ERR_load_strings(atalla_err_lib,atalla_str_functs);
}
}
+static void atalla_unload_error_strings(void)
+ {
+ if (atalla_err_lib >= 0)
+ {
+ ERR_unload_strings(atalla_err_lib,atalla_str_functs);
+ atalla_err_lib = -1;
+ }
+ }
#else
#define ATALLAerr(f,r) /* NOP */
static void atalla_load_error_strings(void) { } /* NOP */
+static void atalla_unload_error_strings(void) { } /* NOP */
#endif
/* Constants used when creating the ENGINE */
!ENGINE_set_DH(e, &atalla_dh) ||
#endif
!ENGINE_set_BN_mod_exp(e, atalla_mod_exp) ||
+ !ENGINE_set_destroy_function(e, atalla_destroy) ||
!ENGINE_set_init_function(e, atalla_init) ||
!ENGINE_set_finish_function(e, atalla_finish) ||
!ENGINE_set_ctrl_function(e, atalla_ctrl) ||
static const char *ATALLA_F2 = "ASI_RSAPrivateKeyOpFn";
static const char *ATALLA_F3 = "ASI_GetPerformanceStatistics";
+/* Destructor (complements the "ENGINE_atalla()" constructor) */
+static int atalla_destroy(ENGINE *e)
+ {
+ /* Unload the atalla error strings so any error state including our
+ * functs or reasons won't lead to a segfault (they simply get displayed
+ * without corresponding string data because none will be found). */
+ atalla_unload_error_strings();
+ return 1;
+ }
+
/* (de)initialisation functions. */
static int atalla_init(ENGINE *e)
{