Exemplo n.º 1
0
Arquivo: ssl.c Projeto: UIKit0/picogui
static void
_SSL_add_random_keypair(SSL_CTX *ctx, int bits)
{
	RSA *rsa;


	rsa = RSA_generate_key(bits, RSA_F4, NULL, NULL);
	if (!SSL_CTX_set_tmp_rsa(ctx, rsa))
		__SSL_critical_error("SSL_CTX_set_tmp_rsa");
	RSA_free(rsa);

	/* force use of this key for key exchange */
	SSL_CTX_set_options(ctx, SSL_OP_EPHEMERAL_RSA);
}
Exemplo n.º 2
0
SSL *
_SSL_socket (SSL_CTX *ctx, int sd)
{
	SSL *ssl;


	if (!(ssl = SSL_new (ctx)))
		/* FATAL */
		__SSL_critical_error ("SSL_new");

	SSL_set_fd (ssl, sd);
	if (ctx->method == SSLv23_client_method())
		SSL_set_connect_state (ssl);
	else
	        SSL_set_accept_state(ssl);

	return (ssl);
}
Exemplo n.º 3
0
Arquivo: ssl.c Projeto: UIKit0/picogui
static char *
_SSL_get_ctx_obj_base64(SSL_CTX *ctx, int type)
{
	void *obj;
	unsigned char *pt;
	SSL *ssl;


	if (!(ssl = SSL_new(ctx)))
		__SSL_critical_error("_SSL_get_ctx_obj_base64 :: SSL_new");

	obj = _SSL_get_sess_obj(ssl, type);	/* it's just a pointer into ssl! */
	pt = _SSL_get_obj_base64(obj, type);

	SSL_free(ssl);

	return (pt);
}