diff options
author | Richard Levitte <levitte@openssl.org> | 2020-09-14 11:35:07 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-09-20 17:31:54 +0200 |
commit | 48b62fb33aa0c5bce52b939fcd94780736491a5d (patch) | |
tree | c9faa14517c8073ae72737d5f2f6d1a118d15079 /include | |
parent | ae12eac074be92e14c11a36b90e1c95eca3723f1 (diff) |
DECODER: Some cleanups, and aligning with OSSL_ENCODER
Mostly source nits, but also removing a couple of OSSL_DECODER_PARAM
macros that are never used or even make sense.
Also, some function names weren't quite consistent. They were made a
bit more consistent in the OSSL_ENCODER API, now we bring that back to
OSSL_DECODER.
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12873)
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/core_names.h | 2 | ||||
-rw-r--r-- | include/openssl/decoder.h | 25 |
2 files changed, 13 insertions, 14 deletions
diff --git a/include/openssl/core_names.h b/include/openssl/core_names.h index e3d3d27a7f..d17ab49700 100644 --- a/include/openssl/core_names.h +++ b/include/openssl/core_names.h @@ -450,9 +450,7 @@ extern "C" { #define OSSL_ENCODER_PARAM_INPUT_TYPE "input-type" #define OSSL_ENCODER_PARAM_OUTPUT_TYPE "output-type" -#define OSSL_DECODER_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER #define OSSL_DECODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES -#define OSSL_DECODER_PARAM_PASS "passphrase" #define OSSL_DECODER_PARAM_INPUT_TYPE "input-type" /* Passphrase callback parameters */ diff --git a/include/openssl/decoder.h b/include/openssl/decoder.h index 91dfca4a09..3da4577437 100644 --- a/include/openssl/decoder.h +++ b/include/openssl/decoder.h @@ -53,11 +53,9 @@ void OSSL_DECODER_CTX_free(OSSL_DECODER_CTX *ctx); /* Utilities that help set specific parameters */ int OSSL_DECODER_CTX_set_passphrase(OSSL_DECODER_CTX *ctx, - const unsigned char *kstr, - size_t klen); + const unsigned char *kstr, size_t klen); int OSSL_DECODER_CTX_set_pem_password_cb(OSSL_DECODER_CTX *ctx, - pem_password_cb *cb, - void *cbarg); + pem_password_cb *cb, void *cbarg); int OSSL_DECODER_CTX_set_passphrase_cb(OSSL_DECODER_CTX *ctx, OSSL_PASSPHRASE_CALLBACK *cb, void *cbarg); @@ -75,17 +73,20 @@ int OSSL_DECODER_CTX_set_input_type(OSSL_DECODER_CTX *ctx, int OSSL_DECODER_CTX_add_decoder(OSSL_DECODER_CTX *ctx, OSSL_DECODER *decoder); int OSSL_DECODER_CTX_add_extra(OSSL_DECODER_CTX *ctx, OPENSSL_CTX *libctx, const char *propq); -int OSSL_DECODER_CTX_num_decoders(OSSL_DECODER_CTX *ctx); +int OSSL_DECODER_CTX_get_num_decoders(OSSL_DECODER_CTX *ctx); typedef struct ossl_decoder_instance_st OSSL_DECODER_INSTANCE; OSSL_DECODER * -OSSL_DECODER_INSTANCE_decoder(OSSL_DECODER_INSTANCE *decoder_inst); -void *OSSL_DECODER_INSTANCE_decoder_ctx(OSSL_DECODER_INSTANCE *decoder_inst); - -typedef int (OSSL_DECODER_CONSTRUCT)(OSSL_DECODER_INSTANCE *decoder_inst, - const OSSL_PARAM *params, - void *construct_data); -typedef void (OSSL_DECODER_CLEANUP)(void *construct_data); +OSSL_DECODER_INSTANCE_get_decoder(OSSL_DECODER_INSTANCE *decoder_inst); +void * +OSSL_DECODER_INSTANCE_get_decoder_ctx(OSSL_DECODER_INSTANCE *decoder_inst); +const char * +OSSL_DECODER_INSTANCE_get_input_type(OSSL_DECODER_INSTANCE *decoder_inst); + +typedef int OSSL_DECODER_CONSTRUCT(OSSL_DECODER_INSTANCE *decoder_inst, + const OSSL_PARAM *params, + void *construct_data); +typedef void OSSL_DECODER_CLEANUP(void *construct_data); int OSSL_DECODER_CTX_set_construct(OSSL_DECODER_CTX *ctx, OSSL_DECODER_CONSTRUCT *construct); |