sqlcipher_codec_hmac convenience function

This commit is contained in:
Stephen Lombardo 2017-04-27 11:12:19 -04:00
parent c7c5268b5f
commit 8f52dde735
2 changed files with 11 additions and 0 deletions

View File

@ -241,6 +241,9 @@ static void sqlcipher_codec_get_pass(codec_ctx *ctx, void **zKey, int *nKey);
static void sqlcipher_codec_set_store_pass(codec_ctx *ctx, int value);
int sqlcipher_codec_fips_status(codec_ctx *ctx);
const char* sqlcipher_codec_get_provider_version(codec_ctx *ctx);
int sqlcipher_codec_hmac(const codec_ctx *ctx, const unsigned char *hmac_key, int key_sz,
unsigned char* in, int in_sz, unsigned char *in2, int in2_sz,
unsigned char *out);
#endif
#endif
/* END SQLCIPHER */

View File

@ -1249,5 +1249,13 @@ const char* sqlcipher_codec_get_provider_version(codec_ctx *ctx) {
return ctx->read_ctx->provider->get_provider_version(ctx->read_ctx);
}
int sqlcipher_codec_hmac(const codec_ctx *ctx, const unsigned char *hmac_key, int key_sz,
unsigned char* in, int in_sz, unsigned char *in2, int in2_sz,
unsigned char *out) {
ctx->read_ctx->provider->hmac(ctx->read_ctx, (unsigned char *)hmac_key, key_sz, in, in_sz, in2, in2_sz, out);
return SQLITE_OK;
}
#endif
/* END SQLCIPHER */