]> git.ipfire.org Git - thirdparty/openssl.git/blame - crypto/evp/evp_locl.h
ossl_method_store_cache_get(): ensure non-NULL property query
[thirdparty/openssl.git] / crypto / evp / evp_locl.h
CommitLineData
0f113f3e 1/*
c13d2ab4 2 * Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
5da2f69f 3 *
4a8b0c55 4 * Licensed under the Apache License 2.0 (the "License"). You may not use
aa6bb135
RS
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
5da2f69f
DSH
8 */
9
7638370c
RL
10/* EVP_MD_CTX related stuff */
11
12struct evp_md_ctx_st {
b7c913c8 13 const EVP_MD *reqdigest; /* The original requested digest */
7638370c
RL
14 const EVP_MD *digest;
15 ENGINE *engine; /* functional reference if 'digest' is
16 * ENGINE-provided */
17 unsigned long flags;
18 void *md_data;
19 /* Public key context for sign/verify */
20 EVP_PKEY_CTX *pctx;
21 /* Update function: usually copied from EVP_MD */
22 int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count);
8c8cf0d9
MC
23
24 /* Provider ctx */
25 void *provctx;
26 EVP_MD *fetched_digest;
7638370c
RL
27} /* EVP_MD_CTX */ ;
28
8baf9968
RL
29struct evp_cipher_ctx_st {
30 const EVP_CIPHER *cipher;
31 ENGINE *engine; /* functional reference if 'cipher' is
32 * ENGINE-provided */
33 int encrypt; /* encrypt or decrypt */
34 int buf_len; /* number we have left */
35 unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */
36 unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */
37 unsigned char buf[EVP_MAX_BLOCK_LENGTH]; /* saved partial block */
38 int num; /* used by cfb/ofb/ctr mode */
39 /* FIXME: Should this even exist? It appears unused */
40 void *app_data; /* application stuff */
41 int key_len; /* May change for variable length cipher */
42 unsigned long flags; /* Various flags */
43 void *cipher_data; /* per EVP data */
44 int final_used;
45 int block_mask;
46 unsigned char final[EVP_MAX_BLOCK_LENGTH]; /* possible final block */
47} /* EVP_CIPHER_CTX */ ;
48
567db2c1
RL
49struct evp_mac_ctx_st {
50 const EVP_MAC *meth; /* Method structure */
51 void *data; /* Individual method data */
52} /* EVP_MAC_CTX */;
53
5a285add
DM
54struct evp_kdf_ctx_st {
55 const EVP_KDF_METHOD *kmeth;
56 EVP_KDF_IMPL *impl; /* Algorithm-specific data */
57} /* EVP_KDF_CTX */ ;
58
0f113f3e
MC
59int PKCS5_v2_PBKDF2_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass,
60 int passlen, ASN1_TYPE *param,
61 const EVP_CIPHER *c, const EVP_MD *md,
62 int en_de);
a0be4fd1
RL
63
64struct evp_Encode_Ctx_st {
65 /* number saved in a partial encode/decode */
66 int num;
67 /*
68 * The length is either the output line length (in input bytes) or the
69 * shortest input line length that is ok. Once decoding begins, the
70 * length is adjusted up each time a longer line is decoded
71 */
72 int length;
73 /* data to encode */
74 unsigned char enc_data[80];
75 /* number read on current line */
76 int line_num;
c0804614 77 unsigned int flags;
a0be4fd1 78};
4a1f3f27
DSH
79
80typedef struct evp_pbe_st EVP_PBE_CTL;
81DEFINE_STACK_OF(EVP_PBE_CTL)
7141ba31
MC
82
83int is_partially_overlapping(const void *ptr1, const void *ptr2, int len);
c13d2ab4
RL
84
85#include <openssl/ossl_typ.h>
86#include <openssl/core.h>
87
88void *evp_generic_fetch(OPENSSL_CTX *ctx, int operation_id,
89 const char *algorithm, const char *properties,
90 void *(*new_method)(int nid, const OSSL_DISPATCH *fns,
91 OSSL_PROVIDER *prov),
92 int (*upref_method)(void *),
dc46e3dd
MC
93 void (*free_method)(void *),
94 int (*nid_method)(void *));