Skip to content

Commit cdd7652

Browse files
committed
Reinstating full range of CI tests.
Also, LibreSSL doesn't support blake2b512 as a digest which is, of course, what we are using for the resume feature in scp. So we need to disable that function for LibreSSL
1 parent 6eef555 commit cdd7652

File tree

2 files changed

+69
-65
lines changed

2 files changed

+69
-65
lines changed

.github/workflows/c-cpp.yml

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -19,56 +19,57 @@ jobs:
1919
config: [default]
2020
# Then we include any extra configs we want to test for specific VMs.
2121
include:
22-
# - { target: ubuntu-20.04, config: valgrind-1 }
23-
# - { target: ubuntu-20.04, config: valgrind-2 }
24-
# - { target: ubuntu-20.04, config: valgrind-3 }
25-
# - { target: ubuntu-20.04, config: valgrind-4 }
26-
# - { target: ubuntu-20.04, config: valgrind-5 }
27-
# - { target: ubuntu-20.04, config: c89 }
28-
# - { target: ubuntu-20.04, config: clang-6.0 }
29-
# - { target: ubuntu-20.04, config: clang-8 }
30-
# - { target: ubuntu-20.04, config: clang-9 }
31-
# - { target: ubuntu-20.04, config: clang-10 }
32-
# - { target: ubuntu-20.04, config: clang-11 }
33-
# - { target: ubuntu-20.04, config: clang-12-Werror }
34-
# - { target: ubuntu-20.04, config: clang-sanitize-address }
35-
# - { target: ubuntu-20.04, config: clang-sanitize-undefined }
36-
# - { target: ubuntu-20.04, config: gcc-sanitize-address }
37-
# - { target: ubuntu-20.04, config: gcc-sanitize-undefined }
38-
# - { target: ubuntu-20.04, config: gcc-7 }
39-
# - { target: ubuntu-20.04, config: gcc-8 }
40-
# - { target: ubuntu-20.04, config: gcc-10 }
41-
# - { target: ubuntu-20.04, config: gcc-11-Werror }
42-
# - { target: ubuntu-20.04, config: pam }
43-
# - { target: ubuntu-20.04, config: kitchensink }
22+
- { target: ubuntu-20.04, config: valgrind-1 }
23+
- { target: ubuntu-20.04, config: valgrind-2 }
24+
- { target: ubuntu-20.04, config: valgrind-3 }
25+
- { target: ubuntu-20.04, config: valgrind-4 }
26+
- { target: ubuntu-20.04, config: valgrind-5 }
27+
- { target: ubuntu-20.04, config: c89 }
28+
- { target: ubuntu-20.04, config: clang-6.0 }
29+
- { target: ubuntu-20.04, config: clang-8 }
30+
- { target: ubuntu-20.04, config: clang-9 }
31+
- { target: ubuntu-20.04, config: clang-10 }
32+
- { target: ubuntu-20.04, config: clang-11 }
33+
- { target: ubuntu-20.04, config: clang-12-Werror }
34+
- { target: ubuntu-20.04, config: clang-sanitize-address }
35+
- { target: ubuntu-20.04, config: clang-sanitize-undefined }
36+
- { target: ubuntu-20.04, config: gcc-sanitize-address }
37+
- { target: ubuntu-20.04, config: gcc-sanitize-undefined }
38+
- { target: ubuntu-20.04, config: gcc-7 }
39+
- { target: ubuntu-20.04, config: gcc-8 }
40+
- { target: ubuntu-20.04, config: gcc-10 }
41+
- { target: ubuntu-20.04, config: gcc-11-Werror }
42+
- { target: ubuntu-20.04, config: pam }
43+
- { target: ubuntu-20.04, config: kitchensink }
4444
- { target: ubuntu-22.04, config: hardenedmalloc }
45-
# - { target: ubuntu-20.04, config: tcmalloc }
46-
# - { target: ubuntu-latest, config: openssl-master }
47-
# - { target: ubuntu-latest, config: openssl-noec }
48-
# - { target: ubuntu-latest, config: openssl-1.1.0h }
49-
# - { target: ubuntu-latest, config: openssl-1.1.1 }
50-
# - { target: ubuntu-latest, config: openssl-1.1.1k }
51-
# - { target: ubuntu-latest, config: openssl-1.1.1n }
52-
# - { target: ubuntu-latest, config: openssl-1.1.1q }
53-
# - { target: ubuntu-latest, config: openssl-1.1.1s }
54-
# - { target: ubuntu-latest, config: openssl-3.0.0 }
55-
# - { target: ubuntu-latest, config: openssl-3.0.5 }
56-
# - { target: ubuntu-latest, config: openssl-3.0.7 }
57-
# - { target: ubuntu-latest, config: openssl-1.1.1_stable }
58-
# - { target: ubuntu-latest, config: openssl-3.0 } # stable branch
59-
- { target: ubuntu-latest, config: libressl-3.7.1 }
45+
- { target: ubuntu-20.04, config: tcmalloc }
46+
- { target: ubuntu-latest, config: openssl-master }
47+
- { target: ubuntu-latest, config: openssl-noec }
48+
- { target: ubuntu-latest, config: openssl-1.1.0h }
49+
- { target: ubuntu-latest, config: openssl-1.1.1 }
50+
- { target: ubuntu-latest, config: openssl-1.1.1k }
51+
- { target: ubuntu-latest, config: openssl-1.1.1n }
52+
- { target: ubuntu-latest, config: openssl-1.1.1q }
53+
- { target: ubuntu-latest, config: openssl-1.1.1s }
54+
- { target: ubuntu-latest, config: openssl-3.0.0 }
55+
- { target: ubuntu-latest, config: openssl-3.0.5 }
56+
- { target: ubuntu-latest, config: openssl-3.0.7 }
57+
- { target: ubuntu-latest, config: openssl-1.1.1_stable }
58+
- { target: ubuntu-latest, config: openssl-3.0 } # stable branch
59+
- { target: ubuntu-latest, config: libressl-3.7.1 }
6060
- { target: ubuntu-latest, config: libressl-3.8.0 }
61-
# - { target: ubuntu-22.04, config: pam }
62-
# - { target: ubuntu-22.04, config: krb5 }
63-
# - { target: ubuntu-22.04, config: heimdal }
64-
# - { target: ubuntu-22.04, config: libedit }
65-
# - { target: ubuntu-22.04, config: sk }
66-
# - { target: ubuntu-22.04, config: selinux }
67-
# - { target: ubuntu-22.04, config: kitchensink }
68-
# - { target: ubuntu-22.04, config: without-openssl }
69-
# - { target: macos-11, config: pam }
70-
# - { target: macos-12, config: pam }
71-
# - { target: macos-13, config: pam }
61+
- { target: ubuntu-latest, config: libressl-3.7.0 }
62+
- { target: ubuntu-22.04, config: pam }
63+
- { target: ubuntu-22.04, config: krb5 }
64+
- { target: ubuntu-22.04, config: heimdal }
65+
- { target: ubuntu-22.04, config: libedit }
66+
- { target: ubuntu-22.04, config: sk }
67+
- { target: ubuntu-22.04, config: selinux }
68+
- { target: ubuntu-22.04, config: kitchensink }
69+
- { target: ubuntu-22.04, config: without-openssl }
70+
- { target: macos-11, config: pam }
71+
- { target: macos-12, config: pam }
72+
- { target: macos-13, config: pam }
7273
runs-on: ${{ matrix.target }}
7374
steps:
7475
- uses: actions/checkout@main

scp.c

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@
134134
#include "misc.h"
135135
#include "progressmeter.h"
136136
#include "utf8.h"
137-
#ifdef WITH_OPENSSL
137+
/* libressl doesn't support the blake2b512 digest so
138+
* we need to prevent libressl from using the resume feature
139+
* cjr 7/18/2023 */
140+
#if (defined WITH_OPENSSL) && !defined(LIBRESSL_VERSION_NUMBER)
138141
#include <openssl/evp.h>
139142
#endif
140143
#include "sftp.h"
@@ -206,7 +209,7 @@ char hostname[HOST_NAME_MAX + 1];
206209
/* defines for the resume function. Need them even if not supported */
207210
#define HASH_LEN 128 /*40 sha1, 64 blake2s256 128 blake2b512*/
208211
#define BUF_AND_HASH HASH_LEN + 64 /* length of the hash and other data to get size of buffer */
209-
#define HASH_BUFLEN 8192 /* 8192 seems to be a good balance between freads
212+
#define HASH_BUFLEN 8192 /* 8192 seems to be a good balance between freads
210213
* and the digest func*/
211214
static void
212215
killchild(int signo)
@@ -618,7 +621,7 @@ main(int argc, char **argv)
618621
addargs(&remote_remote_args, "-q");
619622
showprogress = 0;
620623
break;
621-
#ifdef WITH_OPENSSL
624+
#if (defined WITH_OPENSSL) && !defined(LIBRESSL_VERSION_NUMBER)
622625
case 'Z':
623626
/* currently resume only works in SCP mode */
624627
resume_flag = 1;
@@ -728,9 +731,9 @@ main(int argc, char **argv)
728731
do_cmd_pid = -1;
729732
/* Command to be executed on remote system using "ssh". */
730733
/* In the event of an hpn to hpn connection the scp
731-
* command is rewritten to hpnscp. This happens in
734+
* command is rewritten to hpnscp. This happens in
732735
* clientloop.c -cjr 12/12/2022 */
733-
736+
734737
(void) snprintf(cmd, sizeof cmd, "%s%s%s%s%s%s",
735738
remote_path ? remote_path : "scp",
736739
verbose_mode ? " -v" : "",
@@ -1352,10 +1355,10 @@ tolocal(int argc, char **argv, enum scp_mode_e mode, char *sftp_direct)
13521355

13531356
/* calculate the hash of a file up to length bytes
13541357
* this is used to determine if remote and local file
1355-
* fragments match. There may be a more efficient process for the hashing
1356-
* TODO: I'd like to XXHash for the hashing but that requires that both
1357-
* ends have xxhash installed and then dealing with fallbacks */
1358-
#ifdef WITH_OPENSSL
1358+
* fragments match. There may be a more efficient process for the hashing
1359+
* Note: LibreSSL doesn't support blake2b512 so we can't offer them
1360+
* the resume feature cjr 7/18/2023 */
1361+
#if (defined WITH_OPENSSL) && !defined(LIBRESSL_VERSION_NUMBER)
13591362
void calculate_hash(char *filename, char *output, off_t length)
13601363
{
13611364
int n, md_len;
@@ -1386,7 +1389,7 @@ void calculate_hash(char *filename, char *output, off_t length)
13861389

13871390
while (length > 0) {
13881391
if (length > HASH_BUFLEN)
1389-
/* fread returns the number of elements read.
1392+
/* fread returns the number of elements read.
13901393
* in this case 1. Multiply by the length to get the bytes */
13911394
bytes=fread(buf, HASH_BUFLEN, 1, file_ptr) * HASH_BUFLEN;
13921395
else
@@ -1409,7 +1412,7 @@ void calculate_hash(char *filename, char *output, off_t length)
14091412
#else
14101413
void calculate_hash(char *filename, char *output, off_t length)
14111414
{
1412-
/* empty function for builds without openssl */
1415+
/* empty function for builds without openssl or are using libressl */
14131416
}
14141417
#endif /* WITH_OPENSSL */
14151418

@@ -1931,15 +1934,15 @@ sink(int argc, char **argv, const char *src)
19311934
int bad_match_flag = 0;
19321935
np = NULL; /* this was originally '/0' but that's wrong */
19331936
np_tmp = NULL;
1934-
1935-
1937+
1938+
19361939
#define atime tv[0]
19371940
#define mtime tv[1]
19381941
#define SCREWUP(str) { why = str; goto screwup; }
19391942

19401943
#ifdef DEBUG
19411944
fprintf (stderr, "%s: LOCAL In sink with %s\n", hostname, src);
1942-
#endif
1945+
#endif
19431946
if (TYPE_OVERFLOW(time_t, 0) || TYPE_OVERFLOW(off_t, 0))
19441947
SCREWUP("Unexpected off_t/time_t size");
19451948

@@ -2700,7 +2703,7 @@ response(void)
27002703
void
27012704
usage(void)
27022705
{
2703-
#ifdef WITH_OPENSSL
2706+
#if (defined WITH_OPENSSL) && !defined(LIBRESSL_VERSION_NUMBER)
27042707
(void) fprintf(stderr,
27052708
"usage: hpnscp [-346ABCOpqRrsTvZ] [-c cipher] [-D sftp_server_path] [-F ssh_config]\n"
27062709
" [-i identity_file] [-J destination] [-l limit] [-o ssh_option]\n"
@@ -2710,11 +2713,11 @@ usage(void)
27102713
(void) fprintf(stderr,
27112714
"usage: hpnscp [-346ABCOpqRrsTv] [-c cipher] [-D sftp_server_path] [-F ssh_config]\n"
27122715
" [-i identity_file] [-J destination] [-l limit]\n"
2713-
" [-o ssh_option] [-P port]"
2716+
" [-o ssh_option] [-P port]"
27142717
" [-S program] source ... target\n");
27152718
exit(1);
27162719
#endif
2717-
2720+
27182721
}
27192722

27202723
void

0 commit comments

Comments
 (0)