diff options
author | jsorg71 <jay.sorg@gmail.com> | 2014-07-23 19:54:55 -0700 |
---|---|---|
committer | jsorg71 <jay.sorg@gmail.com> | 2014-07-23 19:54:55 -0700 |
commit | a4721e8c7ce94f49ba1730784a651275e430fd9b (patch) | |
tree | 5dda767c72daf9dd9e202331139935693266d970 /common/trans.h | |
parent | fde7be5151f7db096610cb59ca964e22e6af79fb (diff) | |
parent | 16929efb059e1e29c826388e5d57be82014d241b (diff) | |
download | xrdp-proprietary-a4721e8c7ce94f49ba1730784a651275e430fd9b.tar.gz xrdp-proprietary-a4721e8c7ce94f49ba1730784a651275e430fd9b.zip |
Merge pull request #156 from speidy/devel
work on TLS security mode
Diffstat (limited to 'common/trans.h')
-rw-r--r-- | common/trans.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/common/trans.h b/common/trans.h index 4a8b249c..54566d85 100644 --- a/common/trans.h +++ b/common/trans.h @@ -23,6 +23,7 @@ #include "arch.h" #include "parse.h" +#include <openssl/ssl.h> #define TRANS_MODE_TCP 1 #define TRANS_MODE_UNIX 2 @@ -35,11 +36,14 @@ #define TRANS_STATUS_UP 1 struct trans; /* forward declaration */ +struct xrdp_tls; typedef int (DEFAULT_CC *ttrans_data_in)(struct trans* self); typedef int (DEFAULT_CC *ttrans_conn_in)(struct trans* self, struct trans* new_self); typedef int (DEFAULT_CC *tis_term)(void); +typedef int (APP_CC *trans_read_call) (struct trans *self, struct stream *in_s, int size); +typedef int (APP_CC *trans_write_call) (struct trans *self, struct stream *out_s); struct trans { @@ -60,8 +64,34 @@ struct trans char port[256]; int no_stream_init_on_data_in; int extra_flags; /* user defined */ + struct xrdp_tls *tls; + trans_read_call trans_read_call; + trans_write_call trans_write_call; }; +/* xrdp_tls */ +struct xrdp_tls { + SSL *ssl; + SSL_CTX *ctx; + char *cert; + char *key; + struct trans *trans; +}; + +/* xrdp_tls.c */ +struct xrdp_tls *APP_CC +xrdp_tls_create(struct trans *trans, const char *key, const char *cert); +int APP_CC +xrdp_tls_accept(struct xrdp_tls *self); +int APP_CC +xrdp_tls_disconnect(struct xrdp_tls *self); +void APP_CC +xrdp_tls_delete(struct xrdp_tls *self); +int APP_CC +xrdp_tls_force_read_s(struct trans *self, struct stream *in_s, int size); +int APP_CC +xrdp_tls_force_write_s(struct trans *self, struct stream *out_s); + struct trans* APP_CC trans_create(int mode, int in_size, int out_size); void APP_CC @@ -95,5 +125,13 @@ struct stream* APP_CC trans_get_in_s(struct trans* self); struct stream* APP_CC trans_get_out_s(struct trans* self, int size); +int APP_CC +trans_set_tls_mode(struct trans *self, const char *key, const char *cert); +int APP_CC +trans_shutdown_tls_mode(struct trans *self); +int APP_CC +trans_tcp_force_read_s(struct trans *self, struct stream *in_s, int size); +int APP_CC +trans_tcp_force_write_s(struct trans *self, struct stream *out_s); #endif |