diff options
author | schwarze <> | 2016-12-11 12:52:28 +0000 |
---|---|---|
committer | schwarze <> | 2016-12-11 12:52:28 +0000 |
commit | 11d403ec421a1cca33b5766d8b16528cfce5625c (patch) | |
tree | d4581068f1fca91b79be795008ae6440474cd96b | |
parent | 0864d137aaead93392c7bca5e264c42d8aa291e3 (diff) | |
download | openbsd-11d403ec421a1cca33b5766d8b16528cfce5625c.tar.gz openbsd-11d403ec421a1cca33b5766d8b16528cfce5625c.tar.bz2 openbsd-11d403ec421a1cca33b5766d8b16528cfce5625c.zip |
Merge all of rsa(3) into RSA_new(3).
In this case, keep the text about individual struct fields
because it contains some actual information.
-rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/man/RSA_new.3 | 91 | ||||
-rw-r--r-- | src/lib/libcrypto/man/rsa.3 | 85 |
3 files changed, 86 insertions, 93 deletions
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index ca8fec58fd..82d313af96 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.71 2016/12/10 22:53:31 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.72 2016/12/11 12:52:28 schwarze Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
4 | 4 | ||
@@ -219,7 +219,6 @@ MAN= \ | |||
219 | i2d_PKCS7_bio_stream.3 \ | 219 | i2d_PKCS7_bio_stream.3 \ |
220 | lh_new.3 \ | 220 | lh_new.3 \ |
221 | lh_stats.3 \ | 221 | lh_stats.3 \ |
222 | rsa.3 \ | ||
223 | x509.3 | 222 | x509.3 |
224 | 223 | ||
225 | all clean cleandir depend includes obj tags: | 224 | all clean cleandir depend includes obj tags: |
diff --git a/src/lib/libcrypto/man/RSA_new.3 b/src/lib/libcrypto/man/RSA_new.3 index 4ec89d259e..9e43f03f1d 100644 --- a/src/lib/libcrypto/man/RSA_new.3 +++ b/src/lib/libcrypto/man/RSA_new.3 | |||
@@ -1,8 +1,9 @@ | |||
1 | .\" $OpenBSD: RSA_new.3,v 1.3 2016/11/29 16:41:44 schwarze Exp $ | 1 | .\" $OpenBSD: RSA_new.3,v 1.4 2016/12/11 12:52:28 schwarze Exp $ |
2 | .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 | 2 | .\" OpenSSL doc/man3/RSA_new.pod 99d63d46 Oct 26 13:56:48 2016 -0400 |
3 | .\" OpenSSL doc/crypto/rsa.pod 35d2e327 Jun 3 16:19:49 2016 -0400 | ||
3 | .\" | 4 | .\" |
4 | .\" This file was written by Ulf Moeller <ulf@openssl.org>. | 5 | .\" This file was written by Ulf Moeller <ulf@openssl.org>. |
5 | .\" Copyright (c) 2000, 2002 The OpenSSL Project. All rights reserved. | 6 | .\" Copyright (c) 2000, 2002, 2016 The OpenSSL Project. All rights reserved. |
6 | .\" | 7 | .\" |
7 | .\" Redistribution and use in source and binary forms, with or without | 8 | .\" Redistribution and use in source and binary forms, with or without |
8 | .\" modification, are permitted provided that the following conditions | 9 | .\" modification, are permitted provided that the following conditions |
@@ -48,7 +49,7 @@ | |||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
50 | .\" | 51 | .\" |
51 | .Dd $Mdocdate: November 29 2016 $ | 52 | .Dd $Mdocdate: December 11 2016 $ |
52 | .Dt RSA_NEW 3 | 53 | .Dt RSA_NEW 3 |
53 | .Os | 54 | .Os |
54 | .Sh NAME | 55 | .Sh NAME |
@@ -64,6 +65,9 @@ | |||
64 | .Fa "RSA *rsa" | 65 | .Fa "RSA *rsa" |
65 | .Fc | 66 | .Fc |
66 | .Sh DESCRIPTION | 67 | .Sh DESCRIPTION |
68 | The RSA functions implement RSA public key encryption and signatures | ||
69 | as defined in PKCS #1 v2.0 (RFC 2437). | ||
70 | .Pp | ||
67 | .Fn RSA_new | 71 | .Fn RSA_new |
68 | allocates and initializes an | 72 | allocates and initializes an |
69 | .Vt RSA | 73 | .Vt RSA |
@@ -81,6 +85,62 @@ If | |||
81 | is a | 85 | is a |
82 | .Dv NULL | 86 | .Dv NULL |
83 | pointer, no action occurs. | 87 | pointer, no action occurs. |
88 | .Pp | ||
89 | The | ||
90 | .Vt RSA | ||
91 | structure consists of several | ||
92 | .Vt BIGNUM | ||
93 | components. | ||
94 | It can contain public as well as private RSA keys: | ||
95 | .Bd -literal | ||
96 | typdef struct { | ||
97 | BIGNUM *n; // public modulus | ||
98 | BIGNUM *e; // public exponent | ||
99 | BIGNUM *d; // private exponent | ||
100 | BIGNUM *p; // secret prime factor | ||
101 | BIGNUM *q; // secret prime factor | ||
102 | BIGNUM *dmp1; // d mod (p-1) | ||
103 | BIGNUM *dmq1; // d mod (q-1) | ||
104 | BIGNUM *iqmp; // q^-1 mod p | ||
105 | // ... | ||
106 | } RSA; | ||
107 | .Ed | ||
108 | .Pp | ||
109 | In public keys, the private exponent | ||
110 | .Fa d | ||
111 | and the related secret values | ||
112 | .Fa p , q , dmp1 , dmp2 , | ||
113 | and | ||
114 | .Fa iqmp | ||
115 | are | ||
116 | .Dv NULL . | ||
117 | .Pp | ||
118 | .Fa p , | ||
119 | .Fa q , | ||
120 | .Fa dmp1 , | ||
121 | .Fa dmq1 , | ||
122 | and | ||
123 | .Fa iqmp | ||
124 | may be | ||
125 | .Dv NULL | ||
126 | in private keys, but the RSA operations are much faster when these | ||
127 | values are available. | ||
128 | .Pp | ||
129 | Note that RSA keys may use non-standard | ||
130 | .Vt RSA_METHOD | ||
131 | implementations, either directly or by the use of | ||
132 | .Vt ENGINE | ||
133 | modules. | ||
134 | In some cases (e.g. an | ||
135 | .Vt ENGINE | ||
136 | providing support for hardware-embedded keys), these | ||
137 | .Vt BIGNUM | ||
138 | values will not be used by the implementation or may be used for | ||
139 | alternative data storage. | ||
140 | For this reason, applications should generally avoid using | ||
141 | .Vt RSA | ||
142 | structure elements directly and instead use API functions to query | ||
143 | or modify keys. | ||
84 | .Sh RETURN VALUES | 144 | .Sh RETURN VALUES |
85 | If the allocation fails, | 145 | If the allocation fails, |
86 | .Fn RSA_new | 146 | .Fn RSA_new |
@@ -90,10 +150,29 @@ and sets an error code that can be obtained by | |||
90 | .Xr ERR_get_error 3 . | 150 | .Xr ERR_get_error 3 . |
91 | Otherwise it returns a pointer to the newly allocated structure. | 151 | Otherwise it returns a pointer to the newly allocated structure. |
92 | .Sh SEE ALSO | 152 | .Sh SEE ALSO |
153 | .Xr BN_new 3 , | ||
154 | .Xr d2i_RSAPublicKey 3 , | ||
155 | .Xr DH_new 3 , | ||
156 | .Xr DSA_new 3 , | ||
157 | .Xr engine 3 , | ||
93 | .Xr ERR_get_error 3 , | 158 | .Xr ERR_get_error 3 , |
94 | .Xr rsa 3 , | 159 | .Xr EVP_PKEY_set1_RSA 3 , |
160 | .Xr RSA_blinding_on 3 , | ||
161 | .Xr RSA_check_key 3 , | ||
95 | .Xr RSA_generate_key 3 , | 162 | .Xr RSA_generate_key 3 , |
96 | .Xr RSA_new_method 3 | 163 | .Xr RSA_get_ex_new_index 3 , |
164 | .Xr RSA_padding_add_PKCS1_type_1 3 , | ||
165 | .Xr RSA_print 3 , | ||
166 | .Xr RSA_private_encrypt 3 , | ||
167 | .Xr RSA_public_encrypt 3 , | ||
168 | .Xr RSA_set_method 3 , | ||
169 | .Xr RSA_sign 3 , | ||
170 | .Xr RSA_sign_ASN1_OCTET_STRING 3 , | ||
171 | .Xr RSA_size 3 | ||
172 | .Sh STANDARDS | ||
173 | SSL, PKCS #1 v2.0 | ||
174 | .Pp | ||
175 | RSA was covered by a US patent which expired in September 2000. | ||
97 | .Sh HISTORY | 176 | .Sh HISTORY |
98 | .Fn RSA_new | 177 | .Fn RSA_new |
99 | and | 178 | and |
diff --git a/src/lib/libcrypto/man/rsa.3 b/src/lib/libcrypto/man/rsa.3 deleted file mode 100644 index 7a7aa4a4d7..0000000000 --- a/src/lib/libcrypto/man/rsa.3 +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | .\" $OpenBSD: rsa.3,v 1.6 2016/12/11 09:57:57 jmc Exp $ | ||
2 | .\" | ||
3 | .Dd $Mdocdate: December 11 2016 $ | ||
4 | .Dt RSA 3 | ||
5 | .Os | ||
6 | .Sh NAME | ||
7 | .Nm rsa | ||
8 | .Nd RSA public key cryptosystem | ||
9 | .Sh SYNOPSIS | ||
10 | .In openssl/rsa.h | ||
11 | .Sh DESCRIPTION | ||
12 | These functions implement RSA public key encryption and signatures as | ||
13 | defined in PKCS #1 v2.0 [RFC 2437]. | ||
14 | .Pp | ||
15 | The | ||
16 | .Vt RSA | ||
17 | structure consists of several BIGNUM components. | ||
18 | It can contain public as well as private RSA keys: | ||
19 | .Bd -literal | ||
20 | typdef struct { | ||
21 | BIGNUM *n; // public modulus | ||
22 | BIGNUM *e; // public exponent | ||
23 | BIGNUM *d; // private exponent | ||
24 | BIGNUM *p; // secret prime factor | ||
25 | BIGNUM *q; // secret prime factor | ||
26 | BIGNUM *dmp1; // d mod (p-1) | ||
27 | BIGNUM *dmq1; // d mod (q-1) | ||
28 | BIGNUM *iqmp; // q^-1 mod p | ||
29 | // ... | ||
30 | } RSA; | ||
31 | .Ed | ||
32 | .Pp | ||
33 | In public keys, the private exponent and the related secret values are | ||
34 | .Dv NULL . | ||
35 | .Pp | ||
36 | .Fa p , | ||
37 | .Fa q , | ||
38 | .Fa dmp1 , | ||
39 | .Fa dmq1 , | ||
40 | and | ||
41 | .Fa iqmp | ||
42 | may be | ||
43 | .Dv NULL | ||
44 | in private keys, but the RSA operations are much faster when these | ||
45 | values are available. | ||
46 | .Pp | ||
47 | Note that RSA keys may use non-standard | ||
48 | .Vt RSA_METHOD | ||
49 | implementations, either directly or by the use of | ||
50 | .Vt ENGINE | ||
51 | modules. | ||
52 | In some cases (e.g. an | ||
53 | .Vt ENGINE | ||
54 | providing support for hardware-embedded keys), these | ||
55 | .Vt BIGNUM | ||
56 | values will not be used by the implementation or may be used for | ||
57 | alternative data storage. | ||
58 | For this reason, applications should generally avoid using | ||
59 | .Vt RSA | ||
60 | structure elements directly and instead use API functions to query | ||
61 | or modify keys. | ||
62 | .Sh SEE ALSO | ||
63 | .Xr BN_new 3 , | ||
64 | .Xr d2i_RSAPublicKey 3 , | ||
65 | .Xr DH_new 3 , | ||
66 | .Xr DSA_new 3 , | ||
67 | .Xr engine 3 , | ||
68 | .Xr EVP_PKEY_set1_RSA 3 , | ||
69 | .Xr RSA_blinding_on 3 , | ||
70 | .Xr RSA_check_key 3 , | ||
71 | .Xr RSA_generate_key 3 , | ||
72 | .Xr RSA_get_ex_new_index 3 , | ||
73 | .Xr RSA_new 3 , | ||
74 | .Xr RSA_padding_add_PKCS1_type_1 3 , | ||
75 | .Xr RSA_print 3 , | ||
76 | .Xr RSA_private_encrypt 3 , | ||
77 | .Xr RSA_public_encrypt 3 , | ||
78 | .Xr RSA_set_method 3 , | ||
79 | .Xr RSA_sign 3 , | ||
80 | .Xr RSA_sign_ASN1_OCTET_STRING 3 , | ||
81 | .Xr RSA_size 3 | ||
82 | .Sh STANDARDS | ||
83 | SSL, PKCS #1 v2.0 | ||
84 | .Pp | ||
85 | RSA was covered by a US patent which expired in September 2000. | ||