Justus Winter
f62cded9f0
pki_gcrypt: Handle ECDSA keys and signatures
...
* ConfigureChecks.cmake: Set 'HAVE_ECC' and 'HAVE_GCRYPT_ECC' if
applicable.
* include/libssh/pki.h (struct ssh_key_struct): Fix type of field
'ecdsa'.
(struct ssh_signature_struct): Likewise for 'ecdsa_sig'.
* src/pki.c (ssh_pki_key_ecdsa_name): Relax guard now that the used
function is also provided by the gcrypt backend.
(ssh_signature_free): Free ecdsa signature.
* src/pki_gcrypt.c (ECDSA_HEADER_{BEGIN,END}): New macros.
(privatekey_string_to_buffer): Handle ECDSA keys.
(pki_key_ecdsa_to_nid): New function.
(pki_key_ecdsa_nid_to_gcrypt_name): Likewise.
(pki_key_ecdsa_nid_to_name): Likewise.
(pki_key_ecdsa_nid_to_char): Likewise.
(pki_key_ecdsa_nid_from_name): Implement.
(asn1_oi_to_nid): New function.
(b64decode_ecdsa_privatekey): Likewise.
(pki_private_key_from_base64): Handle ECDSA keys.
(pki_pubkey_build_ecdsa): Implement.
(pki_key_dup): Handle ECDSA keys.
(pki_key_generate): Likewise.
(pki_key_generate_ecdsa): Implement.
(pki_key_compare): Handle ECDSA keys.
(pki_publickey_to_blob): Likewise.
(pki_signature_from_blob): Likewise.
(pki_signature_verify): Likewise.
(pki_do_sign): Likewise.
(pki_do_sign_sessionid): Likewise.
Signed-off-by: Justus Winter <justus@g10code.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-03 15:20:30 +01:00
Andreas Schneider
2384236849
cmake: Try to fix FindArgp module
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-03-17 10:42:52 +01:00
Aris Adamantiadis
5027627344
cmake: detect argp.h on osx
2016-03-14 22:27:06 +01:00
pouete
b3ad6a015b
cmake: use check_symbol for (v)snprintf
...
Updated how snprintf and vsnprintf are discovered by cmake. Visual studio
2015 now include it in the file stdio.h.
More information here :
https://msdn.microsoft.com/en-us/library/bb531344.aspx
Reviewed-By: Aris Adamantiadis <aris@0xbadc0de.be>
2015-12-30 19:51:11 +01:00
Sebastián Peyrott
be36586d74
CMake: include CheckIncludeFiles for calls to check_include_files.
2015-12-24 13:01:37 +01:00
Andreas Schneider
21bf499bb4
agent: Fix agent auth on big endian machines
...
BUG: https://red.libssh.org/issues/204
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-10-20 17:16:38 +02:00
Aris Adamantiadis
0409a302bb
cmake: fix EVP detection with gcc
2015-09-25 12:00:25 +02:00
Aris Adamantiadis
84a85803b4
crypto: old-fashioned aes_ctr when evp_aes_ctr is missing
2015-09-25 11:51:45 +02:00
Andreas Schneider
613b71b385
cmake: Fix OpenSSL detection in non-standard path
...
This should fix the detection on Windows.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-07-03 11:38:58 +02:00
Andreas Schneider
70cc11618a
cmake: Fail if can't find OpenSSL aes and des headers
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-07-03 10:51:36 +02:00
Andreas Schneider
195f25cfbd
cmake: Detect network function correctly on Windows
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-10 13:32:09 +02:00
Andreas Schneider
b1cb8de385
cmake: Check for sys/param.h header file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-10 13:07:12 +02:00
Andreas Schneider
69c9cd029f
cmake: Check for arpa/inet.h header file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-10 13:02:56 +02:00
Andreas Schneider
dbe7df7571
cmake: Detect __func__ and __FUNCTION__ during configure step
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-02 13:41:02 +02:00
Aris Adamantiadis
a653e27a2e
buffer: detect compilers not supporting __VA_ARGS__
2015-02-08 18:49:02 +01:00
Andreas Schneider
8536cd9808
cmake: Fix ntohll and htonll macro detection.
...
BUG: https://red.libssh.org/issues/164
Thanks to Ryan Schmidt!
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-01-13 08:53:42 +01:00
Andreas Schneider
b7b535816d
libcrypto: Fix Windows build with ssh_reseed().
...
gettimeofday() is not available on Windows and we need it only in case
of forking.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2014-12-17 19:39:18 +01:00
Audrius Butkevicius
afe97d6cab
examples: Add ssh_server_fork example
...
Signed-off-by: Audrius Butkevicius <audrius.butkevicius@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-02-16 17:52:50 +01:00
Andreas Schneider
4463d89a4a
cmake: Check for libutil.h on FreeBSD.
2014-02-14 10:33:07 +01:00
Raphael Kubo da Costa
79a80cdc77
ConfigureChecks: Stop checking for CMAKE_HAVE_THREADS_LIBRARY.
...
libssh is primarily interested in whether pthreads is present and can be
used. Checking for CMAKE_HAVE_THREADS_LIBRARY is not the same thing, as
there are cases where pthread exists but CMAKE_HAVE_THREADS_LIBRARY is not
set (for example, FreeBSD passes -DTHREADS_HAVE_PTHREAD_ARG=1 to CMake by
default as a way to skip the checks for -lpthread, -lpthreads and others and
tell the build system that -pthread is the one expected to be used).
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-02-03 14:36:56 +01:00
Aris Adamantiadis
ebf4a03908
examples: fix forktty() warning on OSX
2013-11-03 14:10:04 +01:00
Andreas Schneider
cfea381307
cmake: Check for isblank().
2013-10-30 17:30:07 +01:00
Andreas Schneider
1067591480
cmake: Fix configure check for ntohll and htonll.
2013-07-27 11:27:09 +02:00
Andreas Schneider
5ba88f01e8
cmake: Rewrote FindGSSAPI.cmake.
2013-07-24 20:48:14 +02:00
Andreas Schneider
90e5ce3c3e
cmake: Set HAVE_GETADDRINFO if we have libsocket.
...
This fixes the build on Solaris.
2013-07-24 07:54:11 +02:00
Andreas Schneider
df81a05505
cmake: Check for unistd.h.
2013-07-23 10:44:51 +02:00
Andreas Schneider
7d07e1f1bd
cmake: If we don't have gssapi libs, disable it.
2013-07-23 10:44:51 +02:00
Andreas Schneider
1829e9981b
cmake: Check for HAVE_GCC_VOLATILE_MEMORY_PROTECTION.
...
This ensures that the memset call is not optimized out by the compiler
(works works with gcc and clang).
2013-07-23 10:44:39 +02:00
Andreas Schneider
5145daba69
cmake: Define HAVE_NTOHLL and HAVE_HTONLL on Windows.
2013-07-22 13:01:36 +02:00
Andreas Schneider
729a586027
cmake: Make sure we check some functions on all platforms.
2013-07-22 13:01:36 +02:00
Andreas Schneider
8ff6a7a850
cmake: Check for _strtoui64() on Windows.
2013-07-22 13:01:36 +02:00
Andreas Schneider
73309f19e5
cmake: Check if we have Thread Local Storage support.
2013-07-14 12:36:35 +02:00
Andreas Schneider
b14df297fa
BUG 97: Fix strtoull() detection on serveral platforms.
2012-12-03 14:00:06 +01:00
Andreas Schneider
3896aa43ff
BUG 96: Guard ntohll() and htonll prototypes correctly.
2012-12-03 13:44:02 +01:00
Andreas Schneider
c6fc69fbdd
BUG 97: Remove obsolete hsterror().
...
This function is pretty much obsolete on most platforms. The standard
errno should be used. If it is not enough on Windows we should use
WSAGetLastError() in future.
2012-12-03 13:08:17 +01:00
Andreas Schneider
7e93edc722
cmake: Add better check to detect -fvisibility=hidden.
2012-10-14 18:40:05 +02:00
Andreas Schneider
82711acd39
cmake: Fix building with gcrypt support.
2012-10-12 17:07:20 +02:00
Christophe Baribaud
9460c5906f
MSVC Windows and winsock2.h
...
With Microsoft Visual Studio, winsock2.h shall be included before
ws2tcpip.h
Signed-off-by: Christophe Baribaud <christophe.baribaud@gmail.com>
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2012-09-21 09:45:03 +02:00
Andreas Schneider
84dfa13fe8
cmake: Disable gcrypt ECC.
2012-02-04 20:35:27 +01:00
Andreas Schneider
3e83bc665f
cmake: Enable ECC support for GCrypt 1.5.0 or newer.
2012-02-04 20:25:07 +01:00
Andreas Schneider
fa37965ab0
cmake: Add a define to see if we have ecc support.
2012-02-04 18:37:04 +01:00
Andreas Schneider
8a3b02f68d
cmake: Fix library linking.
2011-09-23 08:00:58 +02:00
Andreas Schneider
dc42a1757f
gzip: Fix zlib support.
2011-09-18 21:37:18 +02:00
Andreas Schneider
85d12f6774
cmake: Add ec.h and ecdsa.h checks.
2011-08-30 00:44:46 +02:00
Aris Adamantiadis
b54e8cdae5
Check for ecdsa with openssl, added log_warning
2011-06-12 19:38:42 +02:00
Andreas Schneider
640e3830f2
build: Check for ntohll().
...
This function is available on AIX.
2011-06-06 18:56:30 +02:00
Andreas Schneider
8b73609e47
cmake: Remove unused regcomp check.
2011-05-25 22:09:41 +02:00
Andreas Schneider
07fb895fe9
cmake: Fix detection of clock_gettime.
2011-05-25 22:08:31 +02:00
Aris Adamantiadis
59f7647cd9
Introduced ssh_timeout_elapsed functions
...
Functions to mesure elapsed time before and after a serie of
calls. Introduces a dependancy to clock_gettime() and librt,
hope this doesn't break anything. Porting to gettimeofday() should
not be too hard.
2011-05-24 23:26:18 +02:00
Andreas Schneider
7150cabafa
cmake: Fixed a typo.
2011-04-08 11:02:25 +02:00
milo
000d659ea2
examples: Added a event context based sshd example.
2011-02-20 14:37:43 +01:00
Andreas Schneider
9baa491b0b
build: Try to fix the build on Solaris.
2011-02-13 13:22:25 +01:00
Andreas Schneider
460d43f050
cmake: Fixed ZLIB configure check.
2011-01-18 18:56:24 +01:00
Andreas Schneider
98b5f07631
cmake: Fixed a warning on OS/2 if the compiler version is empty.
2010-12-31 14:41:50 +01:00
Andreas Schneider
f46bf41813
libssh: Don't use the visibility flag on OS/2.
2010-12-31 14:35:06 +01:00
Andreas Schneider
b4c62ac9ea
server: Replace gethostbyname() with getaddrinfo().
...
Fixes rlo#13.
2010-12-27 21:51:55 +01:00
Andreas Schneider
01eb20e13f
cmake: Fixed a problem with ccache.
2010-10-19 11:50:29 +02:00
Andreas Schneider
f45dc29eb2
build: Improve pthread detection.
2010-09-08 16:51:55 +02:00
Andreas Schneider
4f75fdcd14
build: There is no need to check for system libraries on Linux.
2010-09-08 11:20:10 +02:00
Andreas Schneider
fbe102bada
threads: Build a libssh threading library.
2010-09-06 15:17:03 +02:00
Andreas Schneider
461dde231c
build: Fixed a wrong if statement.
2010-09-05 13:11:19 +02:00
Andreas Schneider
0785c522f0
build: Fixed build with gcc 3.4.
...
The -fvisibility=hidden flag is broken in gcc 3.4. This fixes the build
on CentOS, bug #74 .
2010-09-05 12:56:01 +02:00
Andreas Schneider
aff5786ed3
thread: Fixed detection of thread libraries on Windows.
2010-09-02 12:31:59 +02:00
Andreas Schneider
f97928c740
build: Fixed checking for printf function on Windows.
2010-09-02 11:50:21 +02:00
Andreas Schneider
a93f2d8bfe
build: Fixed pthread detection.
2010-09-01 15:15:17 +02:00
Aris Adamantiadis
8c55294ea9
Openssl implementation of threading + default imp
2010-09-01 14:07:45 +02:00
Andreas Schneider
019cb77b84
build: Don't test for big endian on Windows.
...
Visual Studio 2010 has problems running the test.
2010-08-03 18:13:59 +02:00
Andreas Schneider
296f6a9217
build: Fixed the Windows preprocessor macros and defines.
2010-08-03 18:13:59 +02:00
Andreas Schneider
f5191ec222
Added configure checks for _vsnprintf_s and strncpy.
2010-05-10 15:27:40 +02:00
Andreas Schneider
144126789c
Added configure checks for vsnprintf and _vsnprintf.
2010-05-10 15:24:52 +02:00
Andreas Schneider
8738e93dc0
cmake: Fixed openssl detection.
...
Thanks to Xi Wang for the patch.
2010-04-20 13:25:46 +02:00
Andreas Schneider
b168b8f03f
Fixed a typo that we don't export all symbols.
2010-03-25 14:04:13 +01:00
Aris Adamantiadis
5e002635fc
Fix compilation on freebsd 6.0 which lacks argp.h
2009-11-03 21:04:36 +01:00
Andreas Schneider
8ed9cdce80
Remove --as-needed linker flag.
2009-10-01 10:19:07 +02:00
Andreas Schneider
4aa7d73b43
Fix typo.
2009-08-25 15:23:28 +02:00
Andreas Schneider
3804e72e24
Fix linking on solaris.
...
libresolv and librt are required.
2009-08-25 15:07:29 +02:00
Andreas Schneider
8463d9d7c6
Improve header checks on windows.
2009-08-21 15:15:49 +02:00
Andreas Schneider
c497f057a0
Improve detection for required libraries on Solaris.
2009-08-21 15:15:18 +02:00
Andreas Schneider
d23e64fc52
Add a warning if wspiapi.h doesn't exist.
2009-08-20 12:32:35 +02:00
Andreas Schneider
fd83d69440
Improve the configure checks.
2009-08-20 11:50:49 +02:00
Andreas Schneider
461e46b814
Improve checks for Windows version and wspiapi.h.
2009-08-20 11:43:37 +02:00
Andreas Schneider
d9b7e4cb7a
Fix compilation with visibility flags with mingw.
...
Thanks to Patrick Spendrin.
2009-08-12 14:05:17 +02:00
Andreas Schneider
8e6ab1809f
Enable the debug calltrace by default.
2009-08-12 10:08:20 +02:00
Andreas Schneider
9b13390ad0
Use gcc visibility attribute to get rid of the map file.
2009-08-11 17:10:00 +02:00
Andreas Schneider
1939a55c3c
Fix getaddrinfo and gethostbyname build problems on Solaris.
2009-07-23 11:57:17 +02:00
Andreas Schneider
2a116bb291
Fix OpenSSL include file checks on Solaris.
2009-07-23 11:54:32 +02:00
Andreas Schneider
ea0315ed88
Add cmake check for big endian.
2009-07-23 09:25:36 +02:00
Aris Adamantiadis
bf8d139b2d
Enable conditional compiling for IP regex code.
2009-07-13 12:32:06 +02:00
Andreas Schneider
f29e119c25
Improve OpenSSL cmake checks.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@752 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-05-07 15:11:04 +00:00
Andreas Schneider
126dcd51e5
Improve GCrypt cmake checks.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@751 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-05-07 15:07:54 +00:00
Andreas Schneider
72aeba410f
Don't set options again.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@619 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-04-27 11:00:32 +00:00
Andreas Schneider
59f04bfddd
Add option to enable crypto debug output.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@509 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-04-16 15:47:15 +00:00
Andreas Schneider
e02a6e0225
Add WITH_SERVER option.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@293 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-03-28 21:56:28 +00:00
Andreas Schneider
fce4840c77
Fix SSH1 support.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@292 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-03-28 21:52:15 +00:00
Andreas Schneider
33b948cab9
Add an option WITH_LIBZ to compile with zlib support.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@289 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-03-28 21:43:53 +00:00
Andreas Schneider
d3d7f08d6a
Fix zlib detection.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@288 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-03-28 21:14:45 +00:00
Andreas Schneider
14580705d5
Set needed functions on Windows to true for now.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@247 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-03-08 13:32:28 +00:00
Andreas Schneider
460d0b402b
Add Makefiles for the CMake build system.
...
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@203 7dcaeef0-15fb-0310-b436-a5af3365683c
2009-02-02 14:44:46 +00:00