add id and status functions for providers

This commit is contained in:
Stephen Lombardo 2019-09-24 10:05:27 -04:00
parent a7c6bb15ad
commit 498941c673
5 changed files with 42 additions and 10 deletions

View File

@ -166,6 +166,14 @@ static int sqlcipher_cc_fips_status(void *ctx) {
return 0;
}
static int sqlcipher_cc_id(void *ctx) {
return 1633265;
}
static void* sqlcipher_cc_status(void *ctx) {
return NULL;
}
int sqlcipher_cc_setup(sqlcipher_provider *p) {
p->random = sqlcipher_cc_random;
p->get_provider_name = sqlcipher_cc_get_provider_name;
@ -182,6 +190,8 @@ int sqlcipher_cc_setup(sqlcipher_provider *p) {
p->add_random = sqlcipher_cc_add_random;
p->fips_status = sqlcipher_cc_fips_status;
p->get_provider_version = sqlcipher_cc_get_provider_version;
p->id = sqlcipher_cc_id;
p->status = sqlcipher_cc_status;
return SQLITE_OK;
}

View File

@ -264,6 +264,14 @@ static int sqlcipher_ltc_fips_status(void *ctx) {
return 0;
}
static int sqlcipher_ltc_id(void *ctx) {
return 4658016;
}
static void* sqlcipher_ltc_status(void *ctx) {
return NULL;
}
int sqlcipher_ltc_setup(sqlcipher_provider *p) {
p->activate = sqlcipher_ltc_activate;
p->deactivate = sqlcipher_ltc_deactivate;
@ -282,6 +290,8 @@ int sqlcipher_ltc_setup(sqlcipher_provider *p) {
p->add_random = sqlcipher_ltc_add_random;
p->fips_status = sqlcipher_ltc_fips_status;
p->get_provider_version = sqlcipher_ltc_get_provider_version;
p->id = sqlcipher_ltc_id;
p->status = sqlcipher_ltc_status;
return SQLITE_OK;
}

View File

@ -264,14 +264,6 @@ static int sqlcipher_nss_cipher(void *ctx, int mode, unsigned char *key, int key
return rc;
}
static int sqlcipher_nss_ctx_copy(void *target_ctx, void *source_ctx) {
return SQLITE_OK;
}
static int sqlcipher_nss_ctx_cmp(void *c1, void *c2) {
return 1; /* always indicate contexts are the same */
}
static int sqlcipher_nss_ctx_init(void **ctx) {
sqlcipher_nss_activate(NULL);
return SQLITE_OK;
@ -286,6 +278,14 @@ static int sqlcipher_nss_fips_status(void *ctx) {
return 0;
}
static int sqlcipher_nss_id(void *ctx) {
return 6342402;
}
static void* sqlcipher_nss_status(void *ctx) {
return NULL;
}
int sqlcipher_nss_setup(sqlcipher_provider *p) {
p->activate = sqlcipher_nss_activate;
p->deactivate = sqlcipher_nss_deactivate;
@ -299,13 +299,13 @@ int sqlcipher_nss_setup(sqlcipher_provider *p) {
p->get_iv_sz = sqlcipher_nss_get_iv_sz;
p->get_block_sz = sqlcipher_nss_get_block_sz;
p->get_hmac_sz = sqlcipher_nss_get_hmac_sz;
p->ctx_copy = sqlcipher_nss_ctx_copy;
p->ctx_cmp = sqlcipher_nss_ctx_cmp;
p->ctx_init = sqlcipher_nss_ctx_init;
p->ctx_free = sqlcipher_nss_ctx_free;
p->add_random = sqlcipher_nss_add_random;
p->fips_status = sqlcipher_nss_fips_status;
p->get_provider_version = sqlcipher_nss_get_provider_version;
p->id = sqlcipher_nss_id;
p->status = sqlcipher_nss_status;
return SQLITE_OK;
}

View File

@ -349,6 +349,14 @@ static int sqlcipher_openssl_fips_status(void *ctx) {
#endif
}
static int sqlcipher_openssl_id(void *ctx) {
return 2678498;
}
static void* sqlcipher_openssl_status(void *ctx) {
return NULL;
}
int sqlcipher_openssl_setup(sqlcipher_provider *p) {
p->activate = sqlcipher_openssl_activate;
p->deactivate = sqlcipher_openssl_deactivate;
@ -367,6 +375,8 @@ int sqlcipher_openssl_setup(sqlcipher_provider *p) {
p->add_random = sqlcipher_openssl_add_random;
p->fips_status = sqlcipher_openssl_fips_status;
p->get_provider_version = sqlcipher_openssl_get_provider_version;
p->id = sqlcipher_openssl_id;
p->status = sqlcipher_openssl_status;
return SQLITE_OK;
}

View File

@ -69,6 +69,8 @@ typedef struct {
int (*ctx_free)(void **ctx);
int (*fips_status)(void *ctx);
const char* (*get_provider_version)(void *ctx);
int (*id)(void *ctx);
void* (*status)(void *ctx);
} sqlcipher_provider;
/* utility functions */