Skip to content

Commit 7b7edac

Browse files
author
Andras Fekete
committed
Fix 'make check' failures
1 parent 2c163ac commit 7b7edac

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

include/wolfprovider/wp_wolfprov.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
#ifndef WP_WOLFPROV_H
2424
#define WP_WOLFPROV_H
2525

26-
const char* wolfprovider_id = "libwolfprov";
26+
extern const char* wolfprovider_id;
27+
28+
int wolfssl_prov_bio_up_ref(OSSL_CORE_BIO *bio);
2729

2830
/* Prototype of public function that initializes the wolfSSL provider. */
2931
OSSL_provider_init_fn wolfssl_provider_init;

src/wp_internal.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include <wolfprovider/settings.h>
2525
#include <wolfprovider/internal.h>
26+
#include <wolfprovider/wp_wolfprov.h>
2627
#include <wolfprovider/wp_logging.h>
2728

2829
#include <wolfssl/wolfcrypt/rsa.h>
@@ -735,14 +736,6 @@ int wp_read_der_bio(WOLFPROV_CTX *provctx, OSSL_CORE_BIO *coreBio, unsigned char
735736
return ok;
736737
}
737738

738-
static OSSL_FUNC_BIO_up_ref_fn *c_bio_up_ref = NULL;
739-
static int wolfssl_prov_bio_up_ref(OSSL_CORE_BIO *bio)
740-
{
741-
if (c_bio_up_ref == NULL)
742-
return 0;
743-
return c_bio_up_ref(bio);
744-
}
745-
746739
/**
747740
* Get the underlying BIO object from the core BIO.
748741
*

src/wp_wolfprov.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "wolfprovider/wp_wolfprov.h"
3434
#include "wolfprovider/alg_funcs.h"
3535

36+
const char* wolfprovider_id = "libwolfprov";
3637

3738
/* Core function that gets the table of parameters. */
3839
static OSSL_FUNC_core_gettable_params_fn* c_gettable_params = NULL;
@@ -86,6 +87,7 @@ static OSSL_FUNC_BIO_gets_fn *c_bio_gets = NULL;
8687
static OSSL_FUNC_BIO_puts_fn *c_bio_puts = NULL;
8788
static OSSL_FUNC_BIO_ctrl_fn *c_bio_ctrl = NULL;
8889
static OSSL_FUNC_BIO_free_fn *c_bio_free = NULL;
90+
static OSSL_FUNC_BIO_up_ref_fn *c_bio_up_ref = NULL;
8991

9092
static int wolfssl_prov_bio_read_ex(OSSL_CORE_BIO *bio, void *data, size_t data_len,
9193
size_t *bytes_read)
@@ -131,6 +133,13 @@ static int wolfssl_prov_bio_free(OSSL_CORE_BIO *bio)
131133
return c_bio_free(bio);
132134
}
133135

136+
int wolfssl_prov_bio_up_ref(OSSL_CORE_BIO *bio)
137+
{
138+
if (c_bio_up_ref == NULL)
139+
return 0;
140+
return c_bio_up_ref(bio);
141+
}
142+
134143

135144
static int bio_core_read_ex(BIO *bio, char *data, size_t data_len,
136145
size_t *bytes_read)
@@ -1135,6 +1144,27 @@ int wolfssl_provider_init(const OSSL_CORE_HANDLE* handle,
11351144
case OSSL_FUNC_CORE_GET_LIBCTX:
11361145
c_get_libctx = OSSL_FUNC_core_get_libctx(in);
11371146
break;
1147+
case OSSL_FUNC_BIO_READ_EX:
1148+
c_bio_read_ex = OSSL_FUNC_BIO_read_ex(in);
1149+
break;
1150+
case OSSL_FUNC_BIO_WRITE_EX:
1151+
c_bio_write_ex = OSSL_FUNC_BIO_write_ex(in);
1152+
break;
1153+
case OSSL_FUNC_BIO_GETS:
1154+
c_bio_gets = OSSL_FUNC_BIO_gets(in);
1155+
break;
1156+
case OSSL_FUNC_BIO_PUTS:
1157+
c_bio_puts = OSSL_FUNC_BIO_puts(in);
1158+
break;
1159+
case OSSL_FUNC_BIO_CTRL:
1160+
c_bio_ctrl = OSSL_FUNC_BIO_ctrl(in);
1161+
break;
1162+
case OSSL_FUNC_BIO_FREE:
1163+
c_bio_free = OSSL_FUNC_BIO_free(in);
1164+
break;
1165+
case OSSL_FUNC_BIO_UP_REF:
1166+
c_bio_up_ref = OSSL_FUNC_BIO_up_ref(in);
1167+
break;
11381168
default:
11391169
/* Just ignore anything we don't understand */
11401170
break;

0 commit comments

Comments
 (0)