Skip to content

Commit c95563c

Browse files
committed
Issue #249: By requiring linking with OpenSSL, we now no longer need the #ifdef PR_USE_OPENSSL support throughout the code base. And this also makes for a clearer build failure when OpenSSL support is lacking.
1 parent a92814b commit c95563c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+167
-384
lines changed

include/proxy/ssh/agent.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* ProFTPD - mod_proxy SSH agent API
3-
* Copyright (c) 2021 TJ Saunders
3+
* Copyright (c) 2021-2025 TJ Saunders
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -27,8 +27,6 @@
2727

2828
#include "mod_proxy.h"
2929

30-
#if defined(PR_USE_OPENSSL)
31-
3230
struct agent_key {
3331
unsigned char *key_data;
3432
uint32_t key_datalen;
@@ -43,6 +41,4 @@ const unsigned char *proxy_ssh_agent_sign_data(pool *, const char *,
4341
#define PROXY_SSH_AGENT_SIGN_FL_USE_RSA_SHA2560x001
4442
#define PROXY_SSH_AGENT_SIGN_FL_USE_RSA_SHA5120x002
4543

46-
#endif /* PR_USE_OPENSSL */
47-
4844
#endif /* MOD_PROXY_SSH_AGENT_H */

include/proxy/ssh/auth.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* ProFTPD - mod_proxy SSH auth API
3-
* Copyright (c) 2021-2022 TJ Saunders
3+
* Copyright (c) 2021-2025 TJ Saunders
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -29,7 +29,6 @@
2929
#include "proxy/session.h"
3030
#include "proxy/ssh/packet.h"
3131

32-
#if defined(PR_USE_OPENSSL)
3332
int proxy_ssh_auth_init(pool *p);
3433
int proxy_ssh_auth_sess_init(pool *p, const struct proxy_session *proxy_sess);
3534

@@ -41,6 +40,5 @@ int proxy_ssh_auth_handle(struct proxy_ssh_packet *pkt,
4140

4241
int proxy_ssh_auth_set_frontend_success_handle(pool *p, int (*cb)(pool *p,
4342
const char *user));
44-
#endif /* PR_USE_OPENSSL */
4543

4644
#endif /* MOD_PROXY_SSH_AUTH_H */

include/proxy/ssh/bcrypt.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* ProFTPD - mod_proxy SSH bcrypt PBKDF2
3-
* Copyright (c) 2021 TJ Saunders
3+
* Copyright (c) 2021-2025 TJ Saunders
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -27,12 +27,10 @@
2727

2828
#include "mod_proxy.h"
2929

30-
#if defined(PR_USE_OPENSSL)
3130
#define PROXY_SSH_BCRYPT_DIGEST_LEN32
3231

3332
int proxy_ssh_bcrypt_pbkdf2(pool *p, const char *passphrase,
3433
size_t passphrase_len, unsigned char *salt, uint32_t salt_len,
3534
uint32_t rounds, unsigned char *key, uint32_t key_len);
36-
#endif /* PR_USE_OPENSSL */
3735

3836
#endif /* MOD_PROXY_SSH_BCRYPT_H */

include/proxy/ssh/cipher.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
#include "mod_proxy.h"
2929

30-
#if defined(PR_USE_OPENSSL)
3130
#include <openssl/evp.h>
3231

3332
int proxy_ssh_cipher_init(void);
@@ -69,6 +68,5 @@ int proxy_ssh_cipher_set_write_key(pool *p, const EVP_MD *md,
6968
int role);
7069
int proxy_ssh_cipher_write_data(struct proxy_ssh_packet *pkt,
7170
unsigned char *buf, size_t *bufsz);
72-
#endif /* PR_USE_OPENSSL */
7371

7472
#endif /* MOD_PROXY_SSH_CIPHER_H */

include/proxy/ssh/compress.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* ProFTPD - mod_proxy SSH compression API
3-
* Copyright (c) 2021 TJ Saunders
3+
* Copyright (c) 2021-2025 TJ Saunders
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -28,8 +28,6 @@
2828
#include "mod_proxy.h"
2929
#include "proxy/ssh/packet.h"
3030

31-
#if defined(PR_USE_OPENSSL)
32-
3331
#define PROXY_SSH_COMPRESS_FL_NEW_KEY1
3432
#define PROXY_SSH_COMPRESS_FL_AUTHENTICATED2
3533

@@ -42,6 +40,5 @@ int proxy_ssh_compress_init_write(int);
4240
const char *proxy_ssh_compress_get_write_algo(void);
4341
int proxy_ssh_compress_set_write_algo(pool *p, const char *algo);
4442
int proxy_ssh_compress_write_data(struct proxy_ssh_packet *);
45-
#endif /* PR_USE_OPENSSL */
4643

4744
#endif /* MOD_PROXY_SSH_COMPRESS_H */

include/proxy/ssh/crypto.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* ProFTPD - mod_proxy SSH crypto API
3-
* Copyright (c) 2021-2022 TJ Saunders
3+
* Copyright (c) 2021-2025 TJ Saunders
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -27,7 +27,6 @@
2727

2828
#include "mod_proxy.h"
2929

30-
#if defined(PR_USE_OPENSSL)
3130
#include <openssl/evp.h>
3231

3332
void proxy_ssh_crypto_free(int flags);
@@ -39,6 +38,5 @@ const char *proxy_ssh_crypto_get_kexinit_digest_list(pool *p);
3938

4039
const char *proxy_ssh_crypto_get_errors(void);
4140
size_t proxy_ssh_crypto_get_size(size_t, size_t);
42-
#endif /* PR_USE_OPENSSL */
4341

4442
#endif /* MOD_PROXY_SSH_CRYPTO_H */

include/proxy/ssh/db.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* ProFTPD - mod_proxy SSH Database API
3-
* Copyright (c) 2021 TJ Saunders
3+
* Copyright (c) 2021-2025 TJ Saunders
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -28,9 +28,7 @@
2828
#include "mod_proxy.h"
2929
#include "proxy/ssh.h"
3030

31-
#if defined(PR_USE_OPENSSL)
3231
int proxy_ssh_db_as_datastore(struct proxy_ssh_datastore *ds, void *ds_data,
3332
size_t ds_datasz);
34-
#endif /* PR_USE_OPENSSL */
3533

3634
#endif /* MOD_PROXY_SSH_DB_H */

include/proxy/ssh/disconnect.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* ProFTPD - mod_proxy SSH disconnect API
3-
* Copyright (c) 2021 TJ Saunders
3+
* Copyright (c) 2021-2025 TJ Saunders
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -27,8 +27,6 @@
2727

2828
#include "mod_proxy.h"
2929

30-
#if defined(PR_USE_OPENSSL)
31-
3230
void proxy_ssh_disconnect_conn(conn_t *, uint32_t, const char *, const char *,
3331
int, const char *);
3432
void proxy_ssh_disconnect_send(pool *, conn_t *, uint32_t, const char *,
@@ -43,19 +41,18 @@ const char *proxy_ssh_disconnect_get_text(uint32_t);
4341
* (e.g. SunStudio) like __func__.
4442
*/
4543

46-
# if defined(__FUNCTION__)
44+
#if defined(__FUNCTION__)
4745
#define PROXY_SSH_DISCONNECT_CONN(c, n, m) \
4846
proxy_ssh_disconnect_conn((c), (n), (m), __FILE__, __LINE__, __FUNCTION__)
4947

50-
# elif defined(__func__)
48+
#elif defined(__func__)
5149
#define PROXY_SSH_DISCONNECT_CONN(c, n, m) \
5250
proxy_ssh_disconnect_conn((c), (n), (m), __FILE__, __LINE__, __func__)
5351

54-
# else
52+
#else
5553
#define PROXY_SSH_DISCONNECT_CONN(c, n, m) \
5654
proxy_ssh_disconnect_conn((c), (n), (m), __FILE__, __LINE__, "")
5755

58-
# endif
59-
#endif /* PR_USE_OPENSSL */
56+
#endif
6057

6158
#endif /* MOD_PROXY_SSH_DISCONNECT_H */

include/proxy/ssh/interop.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* ProFTPD - mod_proxy SSH interop API
3-
* Copyright (c) 2021 TJ Saunders
3+
* Copyright (c) 2021-2025 TJ Saunders
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -28,8 +28,6 @@
2828
#include "mod_proxy.h"
2929
#include "proxy/session.h"
3030

31-
#if defined(PR_USE_OPENSSL)
32-
3331
/* For servers which do not support IGNORE packets */
3432
#define PROXY_SSH_FEAT_IGNORE_MSG0x0001
3533

@@ -98,6 +96,5 @@ int proxy_ssh_interop_supports_feature(int);
9896

9997
int proxy_ssh_interop_init(void);
10098
int proxy_ssh_interop_free(void);
101-
#endif /* PR_USE_OPENSSL */
10299

103100
#endif /* MOD_PROXY_SSH_INTEROP_H */

include/proxy/ssh/kex.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* ProFTPD - mod_proxy SSH kex API
3-
* Copyright (c) 2021 TJ Saunders
3+
* Copyright (c) 2021-2025 TJ Saunders
44
*
55
* This program is free software; you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -29,8 +29,6 @@
2929
#include "proxy/session.h"
3030
#include "proxy/ssh.h"
3131

32-
#if defined(PR_USE_OPENSSL)
33-
3432
int proxy_ssh_kex_handle(struct proxy_ssh_packet *pkt,
3533
const struct proxy_session *proxy_sess);
3634
int proxy_ssh_kex_init(pool *p, const char *client_version,
@@ -46,6 +44,5 @@ int proxy_ssh_kex_send_first_kexinit(pool *p,
4644

4745
#define PROXY_SSH_KEX_DH_GROUP_MIN1024
4846
#define PROXY_SSH_KEX_DH_GROUP_MAX8192
49-
#endif /* PR_USE_OPENSSL */
5047

5148
#endif /* MOD_PROXY_SSH_KEX_H */

0 commit comments

Comments
 (0)