summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod
diff options
context:
space:
mode:
authorschwarze <>2016-11-04 10:17:17 +0000
committerschwarze <>2016-11-04 10:17:17 +0000
commit195fe5e91c60bd205043b4bea113abdff1c67bcc (patch)
tree1d15fe02d83a7ffb422ebe78c34ee1117da63e59 /src/lib/libcrypto/doc/RSA_get_ex_new_index.pod
parent00872265b9546fcf2d5795aa3a120c35142d268b (diff)
downloadopenbsd-195fe5e91c60bd205043b4bea113abdff1c67bcc.tar.gz
openbsd-195fe5e91c60bd205043b4bea113abdff1c67bcc.tar.bz2
openbsd-195fe5e91c60bd205043b4bea113abdff1c67bcc.zip
convert RSA manuals from pod to mdoc
Diffstat (limited to 'src/lib/libcrypto/doc/RSA_get_ex_new_index.pod')
-rw-r--r--src/lib/libcrypto/doc/RSA_get_ex_new_index.pod122
1 files changed, 0 insertions, 122 deletions
diff --git a/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod b/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod
deleted file mode 100644
index b1ac1167dd..0000000000
--- a/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod
+++ /dev/null
@@ -1,122 +0,0 @@
1=pod
2
3=head1 NAME
4
5RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data - add application
6specific data to RSA structures
7
8=head1 SYNOPSIS
9
10 #include <openssl/rsa.h>
11
12 int RSA_get_ex_new_index(long argl, void *argp,
13 CRYPTO_EX_new *new_func,
14 CRYPTO_EX_dup *dup_func,
15 CRYPTO_EX_free *free_func);
16
17 int RSA_set_ex_data(RSA *r, int idx, void *arg);
18
19 void *RSA_get_ex_data(RSA *r, int idx);
20
21 typedef int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
22 int idx, long argl, void *argp);
23 typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
24 int idx, long argl, void *argp);
25 typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
26 int idx, long argl, void *argp);
27
28=head1 DESCRIPTION
29
30Several OpenSSL structures can have application specific data attached to them.
31This has several potential uses, it can be used to cache data associated with
32a structure (for example the hash of some part of the structure) or some
33additional data (for example a handle to the data in an external library).
34
35Since the application data can be anything at all it is passed and retrieved
36as a B<void *> type.
37
38The B<RSA_get_ex_new_index()> function is initially called to "register" some
39new application specific data. It takes three optional function pointers which
40are called when the parent structure (in this case an RSA structure) is
41initially created, when it is copied and when it is freed up. If any or all of
42these function pointer arguments are not used they should be set to NULL. The
43precise manner in which these function pointers are called is described in more
44detail below. B<RSA_get_ex_new_index()> also takes additional long and pointer
45parameters which will be passed to the supplied functions but which otherwise
46have no special meaning. It returns an B<index> which should be stored
47(typically in a static variable) and passed used in the B<idx> parameter in
48the remaining functions. Each successful call to B<RSA_get_ex_new_index()>
49will return an index greater than any previously returned, this is important
50because the optional functions are called in order of increasing index value.
51
52B<RSA_set_ex_data()> is used to set application specific data, the data is
53supplied in the B<arg> parameter and its precise meaning is up to the
54application.
55
56B<RSA_get_ex_data()> is used to retrieve application specific data. The data
57is returned to the application, this will be the same value as supplied to
58a previous B<RSA_set_ex_data()> call.
59
60B<new_func()> is called when a structure is initially allocated (for example
61with B<RSA_new()>. The parent structure members will not have any meaningful
62values at this point. This function will typically be used to allocate any
63application specific structure.
64
65B<free_func()> is called when a structure is being freed up. The dynamic parent
66structure members should not be accessed because they will be freed up when
67this function is called.
68
69B<new_func()> and B<free_func()> take the same parameters. B<parent> is a
70pointer to the parent RSA structure. B<ptr> is a the application specific data
71(this wont be of much use in B<new_func()>. B<ad> is a pointer to the
72B<CRYPTO_EX_DATA> structure from the parent RSA structure: the functions
73B<CRYPTO_get_ex_data()> and B<CRYPTO_set_ex_data()> can be called to manipulate
74it. The B<idx> parameter is the index: this will be the same value returned by
75B<RSA_get_ex_new_index()> when the functions were initially registered. Finally
76the B<argl> and B<argp> parameters are the values originally passed to the same
77corresponding parameters when B<RSA_get_ex_new_index()> was called.
78
79B<dup_func()> is called when a structure is being copied. Pointers to the
80destination and source B<CRYPTO_EX_DATA> structures are passed in the B<to> and
81B<from> parameters respectively. The B<from_d> parameter is passed a pointer to
82the source application data when the function is called, when the function
83returns the value is copied to the destination: the application can thus modify
84the data pointed to by B<from_d> and have different values in the source and
85destination. The B<idx>, B<argl> and B<argp> parameters are the same as those
86in B<new_func()> and B<free_func()>.
87
88=head1 RETURN VALUES
89
90B<RSA_get_ex_new_index()> returns a new index or -1 on failure (note 0 is a
91valid index value).
92
93B<RSA_set_ex_data()> returns 1 on success or 0 on failure.
94
95B<RSA_get_ex_data()> returns the application data or 0 on failure. 0 may also
96be valid application data but currently it can only fail if given an invalid
97B<idx> parameter.
98
99B<new_func()> and B<dup_func()> should return 0 for failure and 1 for success.
100
101On failure an error code can be obtained from
102L<ERR_get_error(3)|ERR_get_error(3)>.
103
104=head1 BUGS
105
106B<dup_func()> is currently never called.
107
108The return value of B<new_func()> is ignored.
109
110The B<new_func()> function isn't very useful because no meaningful values are
111present in the parent RSA structure when it is called.
112
113=head1 SEE ALSO
114
115L<rsa(3)|rsa(3)>, L<CRYPTO_set_ex_data(3)|CRYPTO_set_ex_data(3)>
116
117=head1 HISTORY
118
119RSA_get_ex_new_index(), RSA_set_ex_data() and RSA_get_ex_data() are
120available since SSLeay 0.9.0.
121
122=cut