]>
Commit | Line | Data |
---|---|---|
c76ffc78 BK |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
0d83b7b9 TM |
5 | EVP_CIPHER_CTX_get_original_iv, EVP_CIPHER_CTX_get_updated_iv, |
6 | EVP_CIPHER_CTX_iv, EVP_CIPHER_CTX_original_iv, | |
7 | EVP_CIPHER_CTX_iv_noconst - Routines to inspect EVP_CIPHER_CTX IV data | |
c76ffc78 BK |
8 | |
9 | =head1 SYNOPSIS | |
10 | ||
11 | #include <openssl/evp.h> | |
12 | ||
0d83b7b9 TM |
13 | int EVP_CIPHER_CTX_get_original_iv(EVP_CIPHER_CTX *ctx, void *buf, size_t len); |
14 | int EVP_CIPHER_CTX_get_updated_iv(EVP_CIPHER_CTX *ctx, void *buf, size_t len); | |
15 | ||
16 | Deprecated since OpenSSL 3.0, can be hidden entirely by defining | |
17 | B<OPENSSL_API_COMPAT> with a suitable version value, see | |
18 | L<openssl_user_macros(7)>: | |
19 | ||
c76ffc78 BK |
20 | const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx); |
21 | const unsigned char *EVP_CIPHER_CTX_original_iv(const EVP_CIPHER_CTX *ctx); | |
22 | unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx); | |
23 | ||
24 | =head1 DESCRIPTION | |
25 | ||
0d83b7b9 TM |
26 | EVP_CIPHER_CTX_get_original_iv() and EVP_CIPHER_CTX_get_updated_iv() copy |
27 | initialization vector (IV) information from the B<EVP_CIPHER_CTX> into the | |
28 | caller-supplied buffer. L<EVP_CIPHER_CTX_iv_length(3)> can be used to determine | |
29 | an appropriate buffer size, and if the supplied buffer is too small, an error | |
30 | will be returned (and no data copied). EVP_CIPHER_CTX_get_original_iv() | |
31 | accesses the ("original") IV that was supplied when the B<EVP_CIPHER_CTX> was | |
32 | initialized, and EVP_CIPHER_CTX_get_updated_iv() accesses the current "IV state" | |
33 | of the cipher, which is updated during cipher operation for certain cipher modes | |
34 | (e.g., CBC and OFB). | |
c76ffc78 BK |
35 | |
36 | The functions EVP_CIPHER_CTX_iv(), EVP_CIPHER_CTX_original_iv(), and | |
37 | EVP_CIPHER_CTX_iv_noconst() are deprecated functions that provide similar (at | |
38 | a conceptual level) functionality. EVP_CIPHER_CTX_iv() returns a pointer to | |
39 | the beginning of the "IV state" as maintained internally in the | |
40 | B<EVP_CIPHER_CTX>; EVP_CIPHER_CTX_original_iv() returns a pointer to the | |
41 | beginning of the ("original") IV, as maintained by the B<EVP_CIPHER_CTX>, that | |
42 | was provided when the B<EVP_CIPHER_CTX> was initialized; and | |
43 | EVP_CIPHER_CTX_get_iv_noconst() is the same as EVP_CIPHER_CTX_iv() but has a | |
44 | different return type for the pointer. | |
45 | ||
46 | =head1 RETURN VALUES | |
47 | ||
0d83b7b9 TM |
48 | EVP_CIPHER_CTX_get_original_iv() and EVP_CIPHER_CTX_get_updated_iv() return 1 |
49 | on success and 0 on failure. | |
c76ffc78 BK |
50 | |
51 | The functions EVP_CIPHER_CTX_iv(), EVP_CIPHER_CTX_original_iv(), and | |
52 | EVP_CIPHER_CTX_iv_noconst() return a pointer to an IV as an array of bytes on | |
53 | success, and NULL on failure. | |
54 | ||
55 | =head1 HISTORY | |
56 | ||
0d83b7b9 TM |
57 | EVP_CIPHER_CTX_get_original_iv() and EVP_CIPHER_CTX_get_updated_iv() were added |
58 | in OpenSSL 3.0.0. | |
c76ffc78 BK |
59 | |
60 | EVP_CIPHER_CTX_iv(), EVP_CIPHER_CTX_original_iv(), and | |
61 | EVP_CIPHER_CTX_iv_noconst() were added in OpenSSL 1.1.0, and were deprecated | |
62 | in OpenSSL 3.0.0. | |
63 | ||
64 | =head1 COPYRIGHT | |
65 | ||
0d83b7b9 | 66 | Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. |
c76ffc78 BK |
67 | |
68 | Licensed under the Apache License 2.0 (the "License"). You may not use | |
69 | this file except in compliance with the License. You can obtain a copy | |
70 | in the file LICENSE in the source distribution or at | |
71 | L<https://www.openssl.org/source/license.html>. | |
72 | ||
73 | =cut |