2012-09-20 07:51:34 +04:00
|
|
|
/**
|
|
|
|
* xrdp: A Remote Desktop Protocol server.
|
|
|
|
*
|
2014-02-21 11:15:24 +04:00
|
|
|
* Copyright (C) Jay Sorg 2004-2014
|
2014-11-26 05:55:37 +03:00
|
|
|
* Copyright (C) Idan Freiberg 2013-2014
|
2012-09-20 07:51:34 +04:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2005-06-28 07:04:36 +04:00
|
|
|
|
|
|
|
#if !defined(SSL_CALLS_H)
|
|
|
|
#define SSL_CALLS_H
|
|
|
|
|
2006-11-05 01:05:06 +03:00
|
|
|
#include "arch.h"
|
|
|
|
|
2011-05-29 10:56:10 +04:00
|
|
|
int
|
|
|
|
ssl_init(void);
|
|
|
|
int
|
|
|
|
ssl_finish(void);
|
2017-03-12 19:35:00 +03:00
|
|
|
void*
|
2005-11-26 03:57:12 +03:00
|
|
|
ssl_rc4_info_create(void);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2005-11-26 03:57:12 +03:00
|
|
|
ssl_rc4_info_delete(void* rc4_info);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2005-11-26 03:57:12 +03:00
|
|
|
ssl_rc4_set_key(void* rc4_info, char* key, int len);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2005-11-26 03:57:12 +03:00
|
|
|
ssl_rc4_crypt(void* rc4_info, char* data, int len);
|
2017-03-12 19:35:00 +03:00
|
|
|
void*
|
2005-11-26 03:57:12 +03:00
|
|
|
ssl_sha1_info_create(void);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2005-11-26 03:57:12 +03:00
|
|
|
ssl_sha1_info_delete(void* sha1_info);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2005-11-26 03:57:12 +03:00
|
|
|
ssl_sha1_clear(void* sha1_info);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2016-06-22 02:30:17 +03:00
|
|
|
ssl_sha1_transform(void* sha1_info, const char *data, int len);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2005-11-26 03:57:12 +03:00
|
|
|
ssl_sha1_complete(void* sha1_info, char* data);
|
2017-03-12 19:35:00 +03:00
|
|
|
void*
|
2005-11-26 03:57:12 +03:00
|
|
|
ssl_md5_info_create(void);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2005-11-26 03:57:12 +03:00
|
|
|
ssl_md5_info_delete(void* md5_info);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2005-11-26 03:57:12 +03:00
|
|
|
ssl_md5_clear(void* md5_info);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2005-11-26 03:57:12 +03:00
|
|
|
ssl_md5_transform(void* md5_info, char* data, int len);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2005-11-26 03:57:12 +03:00
|
|
|
ssl_md5_complete(void* md5_info, char* data);
|
2017-03-12 19:35:00 +03:00
|
|
|
void *
|
2014-02-21 11:15:24 +04:00
|
|
|
ssl_des3_encrypt_info_create(const char *key, const char* ivec);
|
2017-03-12 19:35:00 +03:00
|
|
|
void *
|
2014-02-21 11:15:24 +04:00
|
|
|
ssl_des3_decrypt_info_create(const char *key, const char* ivec);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2014-02-21 11:15:24 +04:00
|
|
|
ssl_des3_info_delete(void *des3);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-02-21 11:15:24 +04:00
|
|
|
ssl_des3_encrypt(void *des3, int length, const char *in_data, char *out_data);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-02-21 11:15:24 +04:00
|
|
|
ssl_des3_decrypt(void *des3, int length, const char *in_data, char *out_data);
|
2017-03-12 19:35:00 +03:00
|
|
|
void *
|
2014-02-24 08:40:13 +04:00
|
|
|
ssl_hmac_info_create(void);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2014-02-24 08:40:13 +04:00
|
|
|
ssl_hmac_info_delete(void *hmac);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2014-02-24 08:40:13 +04:00
|
|
|
ssl_hmac_sha1_init(void *hmac, const char *data, int len);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2014-02-24 08:40:13 +04:00
|
|
|
ssl_hmac_transform(void *hmac, const char *data, int len);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2014-02-24 08:40:13 +04:00
|
|
|
ssl_hmac_complete(void *hmac, char *data, int len);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2016-12-25 09:44:33 +03:00
|
|
|
ssl_mod_exp(char *out, int out_len, const char *in, int in_len,
|
|
|
|
const char *mod, int mod_len, const char *exp, int exp_len);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2016-12-25 09:44:33 +03:00
|
|
|
ssl_gen_key_xrdp1(int key_size_in_bits, const char* exp, int exp_len,
|
2007-06-16 08:51:19 +04:00
|
|
|
char* mod, int mod_len, char* pri, int pri_len);
|
2005-06-28 07:04:36 +04:00
|
|
|
|
2014-11-26 05:55:37 +03:00
|
|
|
/* ssl_tls */
|
|
|
|
struct ssl_tls
|
|
|
|
{
|
2016-07-08 04:33:29 +03:00
|
|
|
struct ssl_st *ssl; /* SSL * */
|
|
|
|
struct ssl_ctx_st *ctx; /* SSL_CTX * */
|
2014-11-26 05:55:37 +03:00
|
|
|
char *cert;
|
|
|
|
char *key;
|
|
|
|
struct trans *trans;
|
|
|
|
tintptr rwo; /* wait obj */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* xrdp_tls.c */
|
2017-03-12 19:35:00 +03:00
|
|
|
struct ssl_tls *
|
2014-11-26 05:55:37 +03:00
|
|
|
ssl_tls_create(struct trans *trans, const char *key, const char *cert);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2016-12-13 09:49:13 +03:00
|
|
|
ssl_tls_accept(struct ssl_tls *self, long ssl_protocols,
|
2016-08-25 21:20:47 +03:00
|
|
|
const char *tls_ciphers);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-11-26 05:55:37 +03:00
|
|
|
ssl_tls_disconnect(struct ssl_tls *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
void
|
2014-11-26 05:55:37 +03:00
|
|
|
ssl_tls_delete(struct ssl_tls *self);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-11-26 05:55:37 +03:00
|
|
|
ssl_tls_read(struct ssl_tls *tls, char *data, int length);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-11-26 05:55:37 +03:00
|
|
|
ssl_tls_write(struct ssl_tls *tls, const char *data, int length);
|
2017-03-12 19:35:00 +03:00
|
|
|
int
|
2014-11-26 05:55:37 +03:00
|
|
|
ssl_tls_can_recv(struct ssl_tls *tls, int sck, int millis);
|
2017-06-08 19:39:07 +03:00
|
|
|
const char *
|
|
|
|
ssl_get_version(const struct ssl_st *ssl);
|
|
|
|
const char *
|
|
|
|
ssl_get_cipher_name(const struct ssl_st *ssl);
|
|
|
|
int
|
|
|
|
ssl_get_protocols_from_string(const char *str, long *ssl_protocols);
|
2018-04-09 13:23:41 +03:00
|
|
|
const char *
|
|
|
|
get_openssl_version();
|
2016-09-09 09:42:04 +03:00
|
|
|
|
2005-06-28 07:04:36 +04:00
|
|
|
#endif
|