Blame libfreerdp/crypto/opensslcompat.c

Packit 1fb8d4
/**
Packit 1fb8d4
 * FreeRDP: A Remote Desktop Protocol Implementation
Packit 1fb8d4
 * OpenSSL Compatibility
Packit 1fb8d4
 *
Packit 1fb8d4
 * Copyright (C) 2016 Norbert Federa <norbert.federa@thincast.com>
Packit 1fb8d4
 *
Packit 1fb8d4
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit 1fb8d4
 * you may not use this file except in compliance with the License.
Packit 1fb8d4
 * You may obtain a copy of the License at
Packit 1fb8d4
 *
Packit 1fb8d4
 *		 http://www.apache.org/licenses/LICENSE-2.0
Packit 1fb8d4
 *
Packit 1fb8d4
 * Unless required by applicable law or agreed to in writing, software
Packit 1fb8d4
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 1fb8d4
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 1fb8d4
 * See the License for the specific language governing permissions and
Packit 1fb8d4
 * limitations under the License.
Packit 1fb8d4
 */
Packit 1fb8d4
Packit 1fb8d4
#include "opensslcompat.h"
Packit 1fb8d4
Packit 1fb8d4
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
Packit 1fb8d4
Packit 1fb8d4
BIO_METHOD* BIO_meth_new(int type, const char* name)
Packit 1fb8d4
{
Packit 1fb8d4
	BIO_METHOD* m;
Packit 1fb8d4
	if (!(m = calloc(1, sizeof(BIO_METHOD))))
Packit 1fb8d4
		return NULL;
Packit 1fb8d4
	m->type = type;
Packit 1fb8d4
	m->name = name;
Packit 1fb8d4
	return m;
Packit 1fb8d4
}
Packit 1fb8d4
Packit 1fb8d4
void RSA_get0_key(const RSA* r, const BIGNUM** n, const BIGNUM** e, const BIGNUM** d)
Packit 1fb8d4
{
Packit 1fb8d4
	if (n != NULL)
Packit 1fb8d4
		*n = r->n;
Packit 1fb8d4
	if (e != NULL)
Packit 1fb8d4
		*e = r->e;
Packit 1fb8d4
	if (d != NULL)
Packit 1fb8d4
		*d = r->d;
Packit 1fb8d4
}
Packit 1fb8d4
Packit 1fb8d4
#endif /* OPENSSL < 1.1.0 || LIBRESSL */