Andreas Schneider
075895da40
sftp: Use ssh_buffer_pack() in sftp_fsync()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f1e84d5e67 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
7930086a37
sftp: Use ssh_buffer_pack() in sftp_statvfs()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8e3dd09e11 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
3f376f848d
sftp: Reformat sftp_statvfs()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ae0afec98d )
2018-09-03 19:04:13 +02:00
Andreas Schneider
3cee61a65b
sftp: Use ssh_buffer_unpack() in sftp_readlink()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 0be43c333e )
2018-09-03 19:04:13 +02:00
Andreas Schneider
90321f732e
sftp: Use ssh_buffer_pack() in sftp_readlink()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 83a5d3b258 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
c6140b1a4c
sftp: Reformat sftp_readlink()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit bb4bdec184 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
9290d89570
sftp: Use ssh_buffer_pack() in sftp_setstat()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit e0449ba21f )
2018-09-03 19:04:13 +02:00
Andreas Schneider
da9ab71f88
sftp: Reformat sftp_setstat()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8a56b90c3e )
2018-09-03 19:04:13 +02:00
Andreas Schneider
53dfee98d2
sftp: Use ssh_buffer_pack() in sftp_mkdir()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 218c67a51d )
2018-09-03 19:04:13 +02:00
Andreas Schneider
bb14611f86
sftp: Reformat sftp_mkdir()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 89c525bbf1 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
b1aca92268
sftp: Use ssh_buffer_pack in sftp_open()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 2c0baef7d4 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
2b524655ae
sftp: Reformat sftp_open()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit bfb6718b50 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
b51594c34a
sftp: Use ssh_buffer_pack() in sftp_handle_close()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit d99c066a0b )
2018-09-03 19:04:13 +02:00
Andreas Schneider
b409b7d092
sftp: Reformat sftp_handle_close()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 2844942c1b )
2018-09-03 19:04:13 +02:00
Andreas Schneider
4256936fed
sftp: Use ssh_buffer_pack() in sftp_readdir()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 3a729829fd )
2018-09-03 19:04:13 +02:00
Andreas Schneider
fdb6dc7069
sftp: Reformat sftp_readdir()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 576fdbe1e8 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
6291900234
sftp: Use ssh_buffer_pack() in sftp_opendir()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 87df9cfc5d )
2018-09-03 19:04:13 +02:00
Andreas Schneider
216bd2abd8
sftp: Reformat sftp_opendir()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ea375d1605 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
574f279f00
buffer: Precalculate the size required for ssh_buffer_pack()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c15bd2831f )
2018-09-03 19:04:13 +02:00
Andreas Schneider
d886870bbf
buffer: Only reduce the buffer size if it gets bigger than 64K
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit efef877356 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
f56c93cccd
buffer: Only allow to allocate a maximum of 256MB
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 254a0f7132 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
bbd17bc97a
buffer: Always preallocate a buffer with 64 bytes
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit d2131b286f )
2018-09-03 19:04:13 +02:00
Andreas Schneider
26fa923b55
buffer: Rewrite ssh_buffer_free()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c1c32bda14 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
177a082974
buffer: Use bool for secure buffer
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit a1b57d3b94 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
ce3ee332d4
buffer: Reformat buffer_shift()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit be703974e9 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
eb95f8fa85
buffer: Cleanup buffer_verify
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 29f36791c9 )
2018-09-03 19:04:13 +02:00
Andreas Schneider
8d3db75724
cmake: Store Profiling and AddressSanitizer flags in the cache
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 492e3d5c77 )
2018-09-03 15:43:06 +02:00
Andreas Schneider
e1fbc02209
cmake: Add -fstack-clash-protection
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 9a3f43f4ee )
2018-09-03 15:43:04 +02:00
Andreas Schneider
766041d956
cmake: Small improvements to AddCMockaTest
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit baa434ebed )
2018-09-02 13:58:42 +02:00
Andreas Schneider
f880a7728f
auth: Fix freeing memory in ssh_userauth_agent_publickey()
...
CID 1395453
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f99e6766d6 )
2018-09-02 10:30:54 +02:00
Andreas Schneider
013203301f
include: Add SSH_STRING_FREE() and SSH_STRING_FREE_CHAR()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 3efc64112a )
2018-09-02 10:30:52 +02:00
Andreas Schneider
bfb60befa7
gitlab-ci: Correctly run AddressSanitizer with cmake
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit bc19f892eb )
2018-09-01 21:34:04 +02:00
Andreas Schneider
4d34890624
messages: Fix memory leak in ssh_packet_userauth_request
...
Found by AddressSanitizer.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit f8fc0b9dfb )
2018-09-01 21:34:02 +02:00
Andreas Schneider
6751c0e2c3
gitlab-ci: Enable address sanitzer build
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 1b12a2415d )
2018-09-01 17:15:11 +02:00
Andreas Schneider
a641b6ea79
tests: Fix memory leaks in torture_hashes
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 1c0ac0b12e )
2018-09-01 17:15:09 +02:00
Andreas Schneider
fa3c73016d
auth: Fix a memory leak in ssh_userauth_agent_publickey()
...
CID 1230358
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit ea2b403ab2 )
2018-09-01 09:43:43 +02:00
Andreas Schneider
ffabd8c6ed
pki: Fix a memory leak in ssh_pki_do_sign()
...
CID 1395335
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8323cd791f )
2018-09-01 09:43:40 +02:00
Andreas Schneider
219a311925
packet: Add a bound check for nr_extensions
...
CID 1395335
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 461ebd1e2f )
2018-09-01 09:43:36 +02:00
Andreas Schneider
8e3af4d859
doc: Update Public Key Algorithms
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit be147e897d )
2018-08-31 15:04:54 +02:00
Jakub Jelen
9fa614a36d
tests: Properly initilize library in threads tests
...
This was already done in the torture_threads_pki.
Without the explicit initialization, we can observe random
failures tests (at least of the torture_threads_crypto) from
various threads.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6b10bbea2f )
2018-08-31 14:30:53 +02:00
Jakub Jelen
3d207f72a0
pki: Support RSA SHA2 signatures of sessionid for server
...
This involves mostly creation of host keys proofs but needs
to follow the same procedure as the client authentication
signatures.
At the same time, the SHA2 extension is enabled in the pkd
so we are able to atomicaly provide correct signatures and
pass tests.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit b4c8bd9fe4 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
f53d2f7511
server: We should list SHA2 variants in offered hostkeys
...
The SHA2 variants should be preferred. Also the buffer needs to be
extended to fit all possible public key algorithms.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5d13006650 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
b853d99546
server: Support for extension negotiation
...
This includes intercepting the ext-info-c string from
the client kex proposal, configuring the server to allow using
this extension and sending the SSH_MSG_EXT_INFO packet back
to the client after the new keys are in use.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 6fa5e8adb0 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
a09976e3d6
messages: Create correct digest for pki signatures
...
This does not affect old signatures, where the public key algorithm
matches the public key type.
This is a problem when using SHA2 extension for the RSA keys, where
the new signature algorithsm are introduced in addition to the
exitsing ssh-rsa which was ignored throughout the code.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 60ad7ee15d )
2018-08-31 14:30:53 +02:00
Jakub Jelen
1ba0432524
tests: Verify the public key algorithms can be limited by configuration option
...
SSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES configuration option can limit
what keys can or can not be used for public key authentication.
This is useful for disabling obsolete algorithms while not completely
removing the support for them or allows to configure what public key
algorithms will be used with the SHA2 RSA extension.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5fe81e89fb )
2018-08-31 14:30:53 +02:00
Jakub Jelen
7dcd749ee1
auth: Prevent authentication with non-allowed key algorithms
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 09cf301eee )
2018-08-31 14:30:53 +02:00
Jakub Jelen
30368fb06a
tests: PUBLICKEY_ACCEPTED_TYPES are effective
...
Verify the PUBLICKEY_ACCEPTED_TYPES option is handled correctly
and affects the signature algorithm selection based on the
extensions and can be used to limit list of offered mechanisms
to the server.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 594c62d718 )
2018-08-31 14:30:53 +02:00
Jakub Jelen
fd6b7db1ce
pki: Allow filtering accepted public key types based on the configuration
...
This effectively allows to disable using the SHA2 extension, disable
other old public key mechanisms out of the box (hello DSA) or force
the new SHA2-based key algorithm types if needed.
This exposes the default_methods array from kex.c.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 4169be45eb )
2018-08-31 14:30:53 +02:00
Jakub Jelen
53514b2a40
tests: Cover PubkeyAcceptedTypes configuration option
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 5d53f519bc )
2018-08-31 14:30:53 +02:00
Jakub Jelen
0e20418296
config: Accept the PubkeyAcceptedTypes configuration option
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 37864b6575 )
2018-08-31 14:30:53 +02:00