|
33 | 33 | #include "wolfprovider/wp_wolfprov.h" |
34 | 34 | #include "wolfprovider/alg_funcs.h" |
35 | 35 |
|
| 36 | +const char* wolfprovider_id = "libwolfprov"; |
36 | 37 |
|
37 | 38 | /* Core function that gets the table of parameters. */ |
38 | 39 | 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; |
86 | 87 | static OSSL_FUNC_BIO_puts_fn *c_bio_puts = NULL; |
87 | 88 | static OSSL_FUNC_BIO_ctrl_fn *c_bio_ctrl = NULL; |
88 | 89 | static OSSL_FUNC_BIO_free_fn *c_bio_free = NULL; |
| 90 | +static OSSL_FUNC_BIO_up_ref_fn *c_bio_up_ref = NULL; |
89 | 91 |
|
90 | 92 | static int wolfssl_prov_bio_read_ex(OSSL_CORE_BIO *bio, void *data, size_t data_len, |
91 | 93 | size_t *bytes_read) |
@@ -131,6 +133,13 @@ static int wolfssl_prov_bio_free(OSSL_CORE_BIO *bio) |
131 | 133 | return c_bio_free(bio); |
132 | 134 | } |
133 | 135 |
|
| 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 | + |
134 | 143 |
|
135 | 144 | static int bio_core_read_ex(BIO *bio, char *data, size_t data_len, |
136 | 145 | size_t *bytes_read) |
@@ -1135,6 +1144,27 @@ int wolfssl_provider_init(const OSSL_CORE_HANDLE* handle, |
1135 | 1144 | case OSSL_FUNC_CORE_GET_LIBCTX: |
1136 | 1145 | c_get_libctx = OSSL_FUNC_core_get_libctx(in); |
1137 | 1146 | 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; |
1138 | 1168 | default: |
1139 | 1169 | /* Just ignore anything we don't understand */ |
1140 | 1170 | break; |
|
0 commit comments