Пример #1
0
void OpenSSLUtils::setCustomBioMethod(BIO* b, BIO_METHOD* meth) {
#if defined(OPENSSL_IS_BORINGSSL)
  b->method = meth;
#else
  BIO_set(b, meth);
#endif
}
Пример #2
0
static int print_fp(const char *str, size_t len, void *fp)
	{
	BIO bio;

	BIO_set(&bio,BIO_s_file());
	BIO_set_fp(&bio,fp,BIO_NOCLOSE);

	return BIO_printf(&bio, "%s", str);
	}
Пример #3
0
BIO *BIO_new(const BIO_METHOD *method)
{
    BIO *ret = OPENSSL_malloc(sizeof(*ret));

    if (ret == NULL) {
        BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE);
        return (NULL);
    }
    if (!BIO_set(ret, method)) {
        OPENSSL_free(ret);
        ret = NULL;
    }
    return (ret);
}
Пример #4
0
BIO *
BIO_new(BIO_METHOD *method)
{
	BIO *ret = NULL;

	ret = malloc(sizeof(BIO));
	if (ret == NULL) {
		BIOerror(ERR_R_MALLOC_FAILURE);
		return (NULL);
	}
	if (!BIO_set(ret, method)) {
		free(ret);
		ret = NULL;
	}
	return (ret);
}