Remove internal calls to ssh_init
Since the call is made automatically when the library is loaded, these calls are no longer required (if the library is not linked statically). Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Этот коммит содержится в:
родитель
e0e0d62a71
Коммит
9305762fcd
@ -253,11 +253,6 @@ int ssh_bind_listen(ssh_bind sshbind) {
|
||||
socket_t fd;
|
||||
int rc;
|
||||
|
||||
if (ssh_init() < 0) {
|
||||
ssh_set_error(sshbind, SSH_FATAL, "ssh_init() failed");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (sshbind->rsa == NULL &&
|
||||
sshbind->dsa == NULL &&
|
||||
sshbind->ecdsa == NULL &&
|
||||
|
@ -505,9 +505,6 @@ int ssh_connect(ssh_session session) {
|
||||
session->alive = 0;
|
||||
session->client = 1;
|
||||
|
||||
if (ssh_init() < 0) {
|
||||
return SSH_ERROR;
|
||||
}
|
||||
if (session->opts.fd == SSH_INVALID_SOCKET &&
|
||||
session->opts.host == NULL &&
|
||||
session->opts.ProxyCommand == NULL) {
|
||||
|
@ -637,11 +637,6 @@ ssh_string pki_private_key_to_pem(const ssh_key key,
|
||||
BIO *mem;
|
||||
int rc;
|
||||
|
||||
/* needed for openssl initialization */
|
||||
if (ssh_init() < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mem = BIO_new(BIO_s_mem());
|
||||
if (mem == NULL) {
|
||||
return NULL;
|
||||
@ -768,11 +763,6 @@ ssh_key pki_private_key_from_base64(const char *b64_key,
|
||||
void *ecdsa = NULL;
|
||||
#endif
|
||||
|
||||
/* needed for openssl initialization */
|
||||
if (ssh_init() < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
type = pki_privatekey_type_from_string(b64_key);
|
||||
if (type == SSH_KEYTYPE_UNKNOWN) {
|
||||
SSH_LOG(SSH_LOG_WARN, "Unknown or invalid private key.");
|
||||
|
@ -918,11 +918,6 @@ ssh_key pki_private_key_from_base64(const char *b64_key,
|
||||
enum ssh_keytypes_e type;
|
||||
int valid;
|
||||
|
||||
/* needed for gcrypt initialization */
|
||||
if (ssh_init() < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
type = pki_privatekey_type_from_string(b64_key);
|
||||
if (type == SSH_KEYTYPE_UNKNOWN) {
|
||||
SSH_LOG(SSH_LOG_WARN, "Unknown or invalid private key.");
|
||||
|
@ -74,10 +74,6 @@ ssh_key pki_private_key_from_base64(const char *b64_key, const char *passphrase,
|
||||
size_t b64len = strlen(b64_key) + 1;
|
||||
unsigned char tmp[MAX_PASSPHRASE_SIZE] = {0};
|
||||
|
||||
if (ssh_init() < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
type = pki_privatekey_type_from_string(b64_key);
|
||||
if (type == SSH_KEYTYPE_UNKNOWN) {
|
||||
SSH_LOG(SSH_LOG_WARN, "Unknown or invalid private key.");
|
||||
|
@ -727,8 +727,14 @@ int torture_run_tests(void)
|
||||
* The original tests in torture_pki_rsa.c require files to be erased
|
||||
*/
|
||||
|
||||
/*
|
||||
* If the library is statically linked, ssh_init() is not called
|
||||
* automatically
|
||||
*/
|
||||
ssh_init();
|
||||
torture_filter_tests(tests);
|
||||
rc = cmocka_run_group_tests(tests, NULL, NULL);
|
||||
ssh_finalize();
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user