2
* init.c - initialization and finalization of the library
4
* This file is part of the SSH Library
6
* Copyright (c) 2003-2009 by Aris Adamantiadis
8
* The SSH Library is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU Lesser General Public License as published by
10
* the Free Software Foundation; either version 2.1 of the License, or (at your
11
* option) any later version.
13
* The SSH Library is distributed in the hope that it will be useful, but
14
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16
* License for more details.
18
* You should have received a copy of the GNU Lesser General Public License
19
* along with the SSH Library; see the file COPYING. If not, write to
20
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25
#include "libssh/priv.h"
26
#include "libssh/socket.h"
27
#include "libssh/dh.h"
34
* \addtogroup ssh_session
39
* @brief initialize global cryptographic data structures.
41
* This function should only be called once, at the beginning of the program, in
42
* the main thread. It may be omitted if your program is not multithreaded.
58
* @brief Finalize and cleanup all libssh and cryptographic data structures.
60
* This function should only be called once, at the end of the program!
62
* @returns -1 in case of error
65
int ssh_finalize(void) {
67
ssh_crypto_finalize();
70
gcry_control(GCRYCTL_TERM_SECMEM);
71
#elif defined HAVE_LIBCRYPTO
83
/* vim: set ts=2 sw=2 et cindent: */