1
1

32 Коммитов

Автор SHA1 Сообщение Дата
Will Cosgrove
8ab5c36a32
misc.c : String buffer API improvements (#332)
Files : misc.c, hostkey.c, kex.c, misc.h, openssl.c, sftp.c

Notes : 
* updated _libssh2_get_bignum_bytes and _libssh2_get_string. Now pass in length as an argument instead of returning it to keep signedness correct. Now returns -1 for failure, 0 for success.

_libssh2_check_length now returns 0 on success and -1 on failure to match the other string_buf functions. Added comment to _libssh2_check_length.

Credit : Will Cosgrove
2019-04-23 10:28:01 -07:00
Daniel Stenberg
12bddb0d45
code style: unify code style
Indent-level: 4
Max columns: 79
No spaces after if/for/while
Unified brace positions
Unified white spaces
2019-03-20 14:21:38 +01:00
Matthew D. Fuller
d47af1bfc7 Spell OpenSS_H_ right when talking about their specific private key (#321)
Good catch, thanks.
2019-03-19 09:41:24 -07:00
Daniel Stenberg
bd5a620d1a
lib: fix various compiler warnings 2019-03-17 14:33:24 +01:00
Daniel Stenberg
fb43746aaa
pem: //-comments are not allowed 2019-03-15 01:09:18 +01:00
Will Cosgrove
a09f518ff7
Use malloc abstraction function in pem parse
Fix warning on WinCNG build.
2018-08-27 12:09:51 -07:00
Will Cosgrove
0309229259
ED25519 Key Support #39 (#248)
OpenSSH Key and ED25519 support #39
Added _libssh2_explicit_zero() to explicitly zero sensitive data in memory #120

* ED25519 Key file support - Requires OpenSSL 1.1.1 or later
* OpenSSH Key format reading support - Supports RSA/DSA/ECDSA/ED25519 types
* New string buffer reading functions - These add build-in bounds checking and convenance methods. Used for OpenSSL PEM file reading.
* Added new tests for OpenSSH formatted Keys
2018-08-02 14:00:25 -07:00
Tseng Jun
d04f9b2bd3 Fix the EVP cipher meth memory leakage problem (#244)
* Fix the EVP cipher meth memory leakage problem

Looks good, thanks for the fixes.
2018-04-18 10:08:09 -07:00
Viktor Szakats
e54ef175d4 src: fix checksrc warnings
Use checksrc.pl from the curl project, with (for now)
suppressed long line warnings and indentation set to
4 spaces. Fixes are whitespace for the most part.

Warning count went down from 2704 to 12.

Also fix codespell typos, two non-ANSI C89 comments
and a stray tab in include/libssh2.h.

Ref: https://github.com/libssh2/libssh2/pull/235
2018-03-12 11:08:21 +00:00
Viktor Szakats
2d4d062813 src: add static qualifier
To private, const strings.

Closes https://github.com/libssh2/libssh2/pull/237
2018-03-12 10:57:01 +00:00
Will Cosgrove
23b873a9e5 Fixes out of bounds memory access (#210)
If an invalid PEM file is read and the lines are longer than 128 characters it will go out of bounds and crash on line 91.
2017-09-27 11:08:50 -07:00
Marc Hoersken
fe963dfd3a pem: fix indentation and replace assert after 386e012292 2017-03-02 00:14:36 +01:00
Keno Fischer
386e012292 pem: add passphrase-protected PEM file support for libgcrypt and wincng
Since they use our own PEM parser which did not support encrypted
PEM files, trying to use such files on these backends failed.
Fix that by augmenting the PEM parser to support encrypted PEM files.
2017-03-02 00:12:06 +01:00
Marc Hoersken
247dfce5fb pem.c: fixed warning C6269: possible incorrect order of operations 2015-03-22 15:54:14 +01:00
Marc Hoersken
daa2dfa2db pem.c: add _libssh2_pem_parse_memory to parse PEM from memory
Requirement to implement 18cfec8336e for Libgcrypt and WinCNG.
2015-03-22 14:39:14 +01:00
Marc Hoersken
1429ad749d pem.c: fix copy and paste mistake from 55d030089b8 2015-03-22 13:58:09 +01:00
Marc Hoersken
55d030089b pem.c: reduce number of calls to strlen in readline 2015-03-22 13:38:22 +01:00
Marc Hoersken
22204c4e2e pem.c: fix mixed line-endings introduced with 8670f5da24 2014-12-26 13:39:18 +01:00
Marc Hoersken
8670f5da24 pem.c: make sure there's a trailing zero and b64data is not NULL
... if there is no base64 data between PEM header and footer.
Reported by Coverity CID 89823.
2014-12-26 13:31:26 +01:00
Marc Hoersken
21cb7bfb36 pem.c: always compile pem.c independently of crypto backend 2014-03-16 16:38:55 +01:00
Peter Stuge
a5bf809b80 Revert "Added Windows Cryptography API: Next Generation based backend"
This reverts commit d385230e15715e67796f16f3e65fd899f21a638b.
2013-09-15 13:32:38 +02:00
Marc Hoersken
d385230e15 Added Windows Cryptography API: Next Generation based backend 2013-09-07 22:38:14 +02:00
Guenter Knauf
7c32c84d0e removed conditional sources from Makefile.inc
added ifdef blocks to libgcrypt.c, pem.c, openssl.c
2009-09-07 18:10:49 +02:00
Simon Josefsson
f2253aeee9 Fix compiler warnings. 2008-11-20 10:29:01 +00:00
Daniel Stenberg
210459db4b re-indented the source code with this script:
indent \
--braces-on-if-line \
--braces-after-struct-decl-line \
--space-after-cast \
--line-length 79 \
--comment-line-length 79 \
--cuddle-else \
--no-tabs \
--tab-size 8 \
--indent-level 4 \
--no-space-after-for \
--space-after-if \
--space-after-while \
--no-space-after-function-call-names \
*.[ch]
2007-08-06 20:48:04 +00:00
Daniel Stenberg
cf9ed016e7 as mentioned in bug #1655429, the CRLF pair was stripped off in the wrong
order!
2007-06-28 20:53:32 +00:00
James Housley
412b25d971 Initially the libssh2 code was indented with tabs of 4 spaces. Some of
the recent commits converted the tabs to 4 spaces, which matched the
initial indent size.  Other commits converted the tabs to 8 spaces, this
didn't match.

All the code has been converted to 4 space indents.  No changes to line
lengths or actual code was performed.  This is in preperation to my up
coming non-blocking work so my commits should only be code changes and
line lengths in the code I am working on.
2007-05-28 17:56:08 +00:00
Daniel Stenberg
a139ab0b45 fix compiler warnings 2007-01-23 21:36:40 +00:00
Simon Josefsson
6cf4420264 Fix mem leak. 2007-01-23 12:18:50 +00:00
Simon Josefsson
1f232d69ed Fix warnings. 2007-01-23 11:52:23 +00:00
Simon Josefsson
f252d350ec Fix warnings. 2007-01-23 11:52:08 +00:00
Simon Josefsson
be984707e2 Add. Functions for reading PEM files and decoding ASN.1. 2007-01-23 08:13:10 +00:00