diff options
Diffstat (limited to 'src/lib/libcrypto/man/RSA_check_key.3')
-rw-r--r-- | src/lib/libcrypto/man/RSA_check_key.3 | 130 |
1 files changed, 0 insertions, 130 deletions
diff --git a/src/lib/libcrypto/man/RSA_check_key.3 b/src/lib/libcrypto/man/RSA_check_key.3 deleted file mode 100644 index 36b613b3a5..0000000000 --- a/src/lib/libcrypto/man/RSA_check_key.3 +++ /dev/null | |||
@@ -1,130 +0,0 @@ | |||
1 | .\" $OpenBSD: RSA_check_key.3,v 1.10 2023/11/19 21:06:15 tb Exp $ | ||
2 | .\" OpenSSL 6859cf74 Sep 25 13:33:28 2002 +0000 | ||
3 | .\" | ||
4 | .\" This file was written by Ulf Moeller <ulf@openssl.org> and | ||
5 | .\" Geoff Thorpe <geoff@openssl.org>. | ||
6 | .\" Copyright (c) 2000, 2002 The OpenSSL Project. All rights reserved. | ||
7 | .\" | ||
8 | .\" Redistribution and use in source and binary forms, with or without | ||
9 | .\" modification, are permitted provided that the following conditions | ||
10 | .\" are met: | ||
11 | .\" | ||
12 | .\" 1. Redistributions of source code must retain the above copyright | ||
13 | .\" notice, this list of conditions and the following disclaimer. | ||
14 | .\" | ||
15 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
16 | .\" notice, this list of conditions and the following disclaimer in | ||
17 | .\" the documentation and/or other materials provided with the | ||
18 | .\" distribution. | ||
19 | .\" | ||
20 | .\" 3. All advertising materials mentioning features or use of this | ||
21 | .\" software must display the following acknowledgment: | ||
22 | .\" "This product includes software developed by the OpenSSL Project | ||
23 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
24 | .\" | ||
25 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | .\" endorse or promote products derived from this software without | ||
27 | .\" prior written permission. For written permission, please contact | ||
28 | .\" openssl-core@openssl.org. | ||
29 | .\" | ||
30 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
31 | .\" nor may "OpenSSL" appear in their names without prior written | ||
32 | .\" permission of the OpenSSL Project. | ||
33 | .\" | ||
34 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
35 | .\" acknowledgment: | ||
36 | .\" "This product includes software developed by the OpenSSL Project | ||
37 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
38 | .\" | ||
39 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | .\" | ||
52 | .Dd $Mdocdate: November 19 2023 $ | ||
53 | .Dt RSA_CHECK_KEY 3 | ||
54 | .Os | ||
55 | .Sh NAME | ||
56 | .Nm RSA_check_key | ||
57 | .Nd validate private RSA keys | ||
58 | .Sh SYNOPSIS | ||
59 | .In openssl/rsa.h | ||
60 | .Ft int | ||
61 | .Fo RSA_check_key | ||
62 | .Fa "RSA *rsa" | ||
63 | .Fc | ||
64 | .Sh DESCRIPTION | ||
65 | This function validates RSA keys. | ||
66 | It checks that | ||
67 | .Fa rsa->p | ||
68 | and | ||
69 | .Fa rsa->q | ||
70 | are in fact prime, and that | ||
71 | .Fa rsa->n | ||
72 | satisfies n = p*q. | ||
73 | .Pp | ||
74 | It also checks that | ||
75 | .Fa rsa->d | ||
76 | and | ||
77 | .Fa rsa->e | ||
78 | satisfy d*e = 1 mod ((p-1)*(q-1)), | ||
79 | and that | ||
80 | .Fa rsa->dmp1 , | ||
81 | .Fa rsa->dmq1 , | ||
82 | and | ||
83 | .Fa resa->iqmp | ||
84 | are set correctly or are | ||
85 | .Dv NULL . | ||
86 | .Pp | ||
87 | This function does not work on RSA public keys that have only the | ||
88 | modulus and public exponent elements populated. | ||
89 | It performs integrity checks on all the RSA key material, so the | ||
90 | .Vt RSA | ||
91 | key structure must contain all the private key data too. | ||
92 | Therefore, it cannot be used with any arbitrary | ||
93 | .Vt RSA | ||
94 | key object, even if it is otherwise fit for regular RSA operation. | ||
95 | .Sh RETURN VALUES | ||
96 | .Fn RSA_check_key | ||
97 | returns 1 if | ||
98 | .Fa rsa | ||
99 | is a valid RSA key, and 0 otherwise. | ||
100 | -1 is returned if an error occurs while checking the key. | ||
101 | .Pp | ||
102 | If the key is invalid or an error occurred, the reason code can be | ||
103 | obtained using | ||
104 | .Xr ERR_get_error 3 . | ||
105 | .Sh SEE ALSO | ||
106 | .Xr BN_is_prime_ex 3 , | ||
107 | .Xr RSA_get0_key 3 , | ||
108 | .Xr RSA_new 3 | ||
109 | .Sh HISTORY | ||
110 | .Fn RSA_check_key | ||
111 | first appeared in OpenSSL 0.9.4 and has been available since | ||
112 | .Ox 2.6 . | ||
113 | .Sh BUGS | ||
114 | A method of verifying the RSA key using opaque RSA API functions might | ||
115 | need to be considered. | ||
116 | Right now | ||
117 | .Fn RSA_check_key | ||
118 | simply uses the | ||
119 | .Vt RSA | ||
120 | structure elements directly, bypassing the | ||
121 | .Vt RSA_METHOD | ||
122 | table altogether (and completely violating encapsulation and | ||
123 | object-orientation in the process). | ||
124 | The best fix will probably be to introduce a | ||
125 | .Fn check_key | ||
126 | handler | ||
127 | to the | ||
128 | .Vt RSA_METHOD | ||
129 | function table so that alternative implementations can also provide | ||
130 | their own verifiers. | ||