Commit Graph

1826 Commits

Author SHA1 Message Date
Daniel Stenberg
6d553a7bb9 web: the site is now HTTPS 2016-02-23 08:52:47 +01:00
Daniel Stenberg
da6676483b RELEASE-NOTES: 1.7.0 release 2016-02-23 08:25:01 +01:00
Daniel Stenberg
ca5222ea81 diffie_hellman_sha256: convert bytes to bits
As otherwise we get far too small numbers.

Reported-by: Andreas Schneider

CVE-2016-0787
2016-02-23 08:23:19 +01:00
Alexander Lamaison
d453f4ce3c Allow CI failures with VS 2008 x64.
Appveyor doesn't support this combination.
2016-02-18 21:56:04 +00:00
Viktor Szakats
1fcf849e15 GNUmakefile: list system libs after user libs
Otherwise some referenced WinSock functions will fail to
resolve when linking against LibreSSL 2.3.x static libraries
with mingw.

Closes #80
2016-02-16 00:11:32 +01:00
Viktor Szakats
65a4528d17 openssl: apply new HAVE_OPAQUE_STRUCTS macro
Closes #81
2016-02-16 00:08:43 +01:00
Viktor Szakats
0ffb3bfafe openssl: fix LibreSSL support after OpenSSL 1.1.0-pre1/2 support 2016-02-16 00:08:08 +01:00
Alexander Lamaison
30221cfe5d sftp.h: Fix non-C90 type.
uint64_t does not exist in C90.  Use libssh2_uint64_t instead.
2016-02-14 22:12:10 +00:00
Alexander Lamaison
fb2840bc9c Exclude sshd tests from AppVeyor.
They fail complaining that sshd wasn't invoked with an absolute path.
2016-02-14 21:38:12 +00:00
Alexander Lamaison
78043ff25d Test on more versions of Visual Studio. 2016-02-14 20:57:03 +00:00
Alexander Lamaison
5eac3edda5 Fix Appveyor builds. 2016-02-14 20:49:31 +00:00
Viktor Szakats
298f056fd6 openssl: add OpenSSL 1.1.0-pre3-dev compatibility
by using API instead of accessing an internal structure.

Closes #83
2016-02-14 10:56:37 +01:00
Daniel Stenberg
652ae4d134 RELEASE-NOTES: synced with 996b04ecec 2016-02-12 16:19:26 +01:00
Daniel Stenberg
996b04ecec include/libssh2.h: next version is 1.7.0 2016-02-12 16:19:06 +01:00
Daniel Stenberg
8d568d6c3b configure: build "silent" if possible 2016-02-11 14:00:37 +01:00
Daniel Stenberg
ae484b426c sftp: re-indented some minor stuff 2016-02-11 13:57:14 +01:00
Jakob Egger
85dbd4c136 sftp.c: ensure minimum read packet size
For optimum performance we need to ensure we don't request tiny packets.
2016-02-11 13:57:14 +01:00
Jakob Egger
d7e25b4729 sftp.c: Explicit return values & sanity checks 2016-02-11 13:57:14 +01:00
Jakob Egger
e12fe71462 sftp.c: Check Read Packet File Offset
This commit adds a simple check to see if the offset of the read
request matches the expected file offset.

We could try to recover, from this condition at some point in the future.
Right now it is better to return an error instead of corrupted data.
2016-02-11 13:57:14 +01:00
Jakob Egger
992de2fbfa sftp.c: Don't return EAGAIN if data was written to buffer 2016-02-11 13:57:14 +01:00
Jakob Egger
77c48d4e26 sftp.c: Send at least one read request before reading
This commit ensures that we have sent at least one read request before
we try to read data in sftp_read().

Otherwise sftp_read() would return 0 bytes (indicating EOF) if the
socket is not ready for writing.
2016-02-11 13:57:09 +01:00
Jakob Egger
0d60964632 sftp.c: stop reading when buffer is full
Since we can only store data from a single chunk in filep,
we have to stop receiving data as soon as the buffer is full.

This adresses the following bug report:
https://github.com/libssh2/libssh2/issues/50
2016-02-11 13:54:10 +01:00
Salvador Fandiño
60874670ef agent_disconnect_unix: unset the agent fd after closing it
"agent_disconnect_unix", called by "libssh2_agent_disconnect", was
leaving the file descriptor in the agent structure unchanged. Later,
"libssh2_agent_free" would call again "libssh2_agent_disconnect" under
the hood and it would try to close again the same file descriptor. In
most cases that resulted in just a harmless error, but it is also
possible that the file descriptor had been reused between the two
calls resulting in the closing of an unrelated file descriptor.

This patch sets agent->fd to LIBSSH2_INVALID_SOCKET avoiding that
issue.

Signed-off-by: Salvador Fandiño <sfandino@yahoo.com>
2016-01-21 09:23:37 +01:00
Patrick Monnerat
77d825ac93 os400qc3: support encrypted private keys
PKCS#8 EncryptedPrivateKeyinfo structures are recognized and decoded to get
values accepted by the Qc3 crypto library.
2016-01-18 13:42:57 +01:00
Patrick Monnerat
b60fb64b17 os400qc3: New PKCS#5 decoder
The Qc3 library is not able to handle PKCS#8 EncryptedPrivateKeyInfo structures
by itself. It is only capable of decrypting the (encrypted) PrivateKeyInfo
part, providing a key encryption key and an encryption algorithm are given.
Since the encryption key and algorithm description part in a PKCS#8
EncryptedPrivateKeyInfo is a PKCS#5 structure, such a decoder is needed to
get the derived key method and hash, as well as encryption algorith and
initialisation vector.
2016-01-18 13:35:28 +01:00
Patrick Monnerat
0de1cba671 os400qc3: force continuous update on non-final hash/hmac computation 2016-01-18 13:35:28 +01:00
Patrick Monnerat
2ddcaf2db8 os400qc3: Be sure hmac keys have a minimum length
The Qc3 library requires a minimum key length depending on the target
hash algorithm. Append binary zeroes to the given key if not long enough.
This matches RFC 2104 specifications.
2016-01-18 13:35:28 +01:00
Patrick Monnerat
0f15724e72 os400qc3: Slave descriptor for key encryption key
The Qc3 library requires the key encryption key to exist as long as
the encrypted key is used. Its descriptor token is then kept as an
"encrypted key slave" for recursive release.
2016-01-18 13:35:28 +01:00
Patrick Monnerat
57692b6b10 os400qc3.c: comment PEM/DER decoding 2016-01-18 13:35:28 +01:00
Patrick Monnerat
92a3ac4673 os400qc3.c: improve ASN.1 header byte checks 2016-01-18 13:35:28 +01:00
Patrick Monnerat
72453b7367 os400qc3.c: improve OID matching 2016-01-18 13:35:28 +01:00
Patrick Monnerat
8b720f342f os400: os400qc3.c: replace malloc by LIBSSH2_ALLOC or alloca where possible 2016-01-18 13:35:28 +01:00
Patrick Monnerat
e2985f0a67 os400: asn1_new_from_bytes(): use data from a single element only 2016-01-18 13:35:28 +01:00
Patrick Monnerat
002db176b7 os400: fix an ILE/RPG prototype 2016-01-18 13:35:28 +01:00
Patrick Monnerat
7a37c33264 os400: implement character encoding conversion support 2016-01-18 13:35:28 +01:00
Patrick Monnerat
914157804f os400: do not miss some external prototypes
Build procedure extproto() did not strip braces from header files, thus
possibly prepended them to true prototypes. This prevented the prototype to
be recognized as such.
The solution implemented here is to map braces to semicolons, effectively
considering them as potential prototype delimiters.
2016-01-18 13:35:28 +01:00
Patrick Monnerat
4c4d6a8da4 os400: Really add specific README 2016-01-18 13:35:28 +01:00
Patrick Monnerat
c367e61294 os400: Add specific README and include new files in dist tarball 2016-01-18 13:35:28 +01:00
Patrick Monnerat
d900984b0a os400: add compilation scripts 2016-01-18 13:35:28 +01:00
Patrick Monnerat
4bd6d7ebf6 os400: include files for ILE/RPG
In addition, file os400/macros.h declares all procedures originally
defined as macros. It must not be used for real inclusion and is only
intended to be used as a `database' for macro wrapping procedures generation.
2016-01-18 13:35:28 +01:00
Patrick Monnerat
dac4b3bac3 os400: add supplementary header files/wrappers. Define configuration. 2016-01-18 13:35:28 +01:00
Patrick Monnerat
7dcf5ed6fb Protect callback function calls from macro substitution
Some structure fields holding callback addresses have the same name as the
underlying system function (connect, send, recv). Set parentheses around
their reference to suppress a possible macro substitution.

Use a macro for connect() on OS/400 to resolve a const/nonconst parameter
problem.
2016-01-18 13:35:28 +01:00
Patrick Monnerat
8ba6bf2aef Add interface for OS/400 crypto library QC3 2016-01-18 13:35:28 +01:00
Patrick Monnerat
0fba5cfda6 misc: include stdarg.h for debug code 2016-01-18 13:35:28 +01:00
Patrick Monnerat
72bedfe761 Document crypto library interface 2016-01-18 13:35:28 +01:00
Patrick Monnerat
f915a31a4d Feature an optional crypto-specific macro to rsa sign a data fragment vector
OS/400 crypto library is unable to sign a precomputed SHA1 hash: however
it does support a procedure that hashes data fragments and rsa signs.
If defined, the new macro _libssh2_rsa_sha1_signv() implements this function
and disables use of _libssh2_rsa_sha1_sign().

The function described above requires that the struct iovec unused slacks are
cleared: for this reason, macro libssh2_prepare_iovec() has been introduced.
It should be defined as empty for crypto backends that are not sensitive
to struct iovec unused slack values.
2016-01-18 13:35:28 +01:00
Patrick Monnerat
0fbf8f3c7e Fold long lines in include files 2016-01-18 13:35:28 +01:00
Viktor Szakats
e64260a117 kex.c: fix indentation
Closes #71
2016-01-17 17:11:58 +01:00
Viktor Szakats
ed2c3c8d28 add OpenSSL-1.1.0-pre2 compatibility
Closes #70
2016-01-17 17:10:45 +01:00
Viktor Szakats
73930e6577 add OpenSSL 1.1.0-pre1 compatibility
* close https://github.com/libssh2/libssh2/issues/69
* sync a declaration with the rest of similar ones
* handle EVP_MD_CTX_new() returning NULL with OpenSSL 1.1.0
* fix potential memory leak with OpenSSL 1.1.0 in
  _libssh2_*_init() functions, when EVP_MD_CTX_new() succeeds,
  but EVP_DigestInit() fails.
2016-01-17 17:10:32 +01:00