library initialization fails if libstrongswan checksum is invalid
This commit is contained in:
+4
-1
@@ -686,7 +686,10 @@ int main(int argc, char *argv[])
|
|||||||
dbg = dbg_stderr;
|
dbg = dbg_stderr;
|
||||||
|
|
||||||
/* initialize library */
|
/* initialize library */
|
||||||
library_init(STRONGSWAN_CONF);
|
if (!library_init(STRONGSWAN_CONF))
|
||||||
|
{
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
lib->printf_hook->add_handler(lib->printf_hook, 'R',
|
lib->printf_hook->add_handler(lib->printf_hook, 'R',
|
||||||
traffic_selector_printf_hook,
|
traffic_selector_printf_hook,
|
||||||
PRINTF_HOOK_ARGTYPE_POINTER,
|
PRINTF_HOOK_ARGTYPE_POINTER,
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ void library_deinit()
|
|||||||
/*
|
/*
|
||||||
* see header file
|
* see header file
|
||||||
*/
|
*/
|
||||||
void library_init(char *settings)
|
bool library_init(char *settings)
|
||||||
{
|
{
|
||||||
printf_hook_t *pfh;
|
printf_hook_t *pfh;
|
||||||
private_library_t *this = malloc_thing(private_library_t);
|
private_library_t *this = malloc_thing(private_library_t);
|
||||||
@@ -136,7 +136,9 @@ void library_init(char *settings)
|
|||||||
"libstrongswan", library_init))
|
"libstrongswan", library_init))
|
||||||
{
|
{
|
||||||
DBG1("integrity check of libstrongswan failed");
|
DBG1("integrity check of libstrongswan failed");
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -123,8 +123,9 @@ struct library_t {
|
|||||||
* Initialize library, creates "lib" instance.
|
* Initialize library, creates "lib" instance.
|
||||||
*
|
*
|
||||||
* @param settings file to read settings from, may be NULL for none
|
* @param settings file to read settings from, may be NULL for none
|
||||||
|
* @return FALSE if integrity check failed
|
||||||
*/
|
*/
|
||||||
void library_init(char *settings);
|
bool library_init(char *settings);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deinitialize library, destroys "lib" instance.
|
* Deinitialize library, destroys "lib" instance.
|
||||||
|
|||||||
@@ -265,7 +265,10 @@ int main(int argc, char **argv)
|
|||||||
#endif /* CAPABILITIES */
|
#endif /* CAPABILITIES */
|
||||||
|
|
||||||
/* initialize library and optionsfrom */
|
/* initialize library and optionsfrom */
|
||||||
library_init(STRONGSWAN_CONF);
|
if (!library_init(STRONGSWAN_CONF))
|
||||||
|
{
|
||||||
|
abort();
|
||||||
|
}
|
||||||
options = options_create();
|
options = options_create();
|
||||||
|
|
||||||
/* handle arguments */
|
/* handle arguments */
|
||||||
|
|||||||
Reference in New Issue
Block a user