diff options
Diffstat (limited to 'src/lib/libcrypto/man/PEM_read_bio_PrivateKey.3')
| -rw-r--r-- | src/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 | 82 |
1 files changed, 12 insertions, 70 deletions
diff --git a/src/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 b/src/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 index 3799baa040..cc58640b1c 100644 --- a/src/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 +++ b/src/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: PEM_read_bio_PrivateKey.3,v 1.17 2020/06/12 11:37:42 schwarze Exp $ | 1 | .\" $OpenBSD: PEM_read_bio_PrivateKey.3,v 1.18 2020/06/15 14:13:14 schwarze Exp $ |
| 2 | .\" full merge up to: | 2 | .\" full merge up to: |
| 3 | .\" OpenSSL man3/PEM_read_bio_PrivateKey.pod 18bad535 Apr 9 15:13:55 2019 +0100 | 3 | .\" OpenSSL man3/PEM_read_bio_PrivateKey.pod 18bad535 Apr 9 15:13:55 2019 +0100 |
| 4 | .\" OpenSSL man3/PEM_read_CMS.pod 83cf7abf May 29 13:07:08 2018 +0100 | 4 | .\" OpenSSL man3/PEM_read_CMS.pod 83cf7abf May 29 13:07:08 2018 +0100 |
| @@ -51,11 +51,10 @@ | |||
| 51 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 51 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 52 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 52 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 53 | .\" | 53 | .\" |
| 54 | .Dd $Mdocdate: June 12 2020 $ | 54 | .Dd $Mdocdate: June 15 2020 $ |
| 55 | .Dt PEM_READ_BIO_PRIVATEKEY 3 | 55 | .Dt PEM_READ_BIO_PRIVATEKEY 3 |
| 56 | .Os | 56 | .Os |
| 57 | .Sh NAME | 57 | .Sh NAME |
| 58 | .Nm pem_password_cb , | ||
| 59 | .Nm PEM_read_bio_PrivateKey , | 58 | .Nm PEM_read_bio_PrivateKey , |
| 60 | .Nm PEM_read_PrivateKey , | 59 | .Nm PEM_read_PrivateKey , |
| 61 | .Nm PEM_write_bio_PrivateKey , | 60 | .Nm PEM_write_bio_PrivateKey , |
| @@ -149,13 +148,6 @@ | |||
| 149 | .Nd PEM routines | 148 | .Nd PEM routines |
| 150 | .Sh SYNOPSIS | 149 | .Sh SYNOPSIS |
| 151 | .In openssl/pem.h | 150 | .In openssl/pem.h |
| 152 | .Ft typedef int | ||
| 153 | .Fo pem_password_cb | ||
| 154 | .Fa "char *buf" | ||
| 155 | .Fa "int size" | ||
| 156 | .Fa "int rwflag" | ||
| 157 | .Fa "void *u" | ||
| 158 | .Fc | ||
| 159 | .Ft EVP_PKEY * | 151 | .Ft EVP_PKEY * |
| 160 | .Fo PEM_read_bio_PrivateKey | 152 | .Fo PEM_read_bio_PrivateKey |
| 161 | .Fa "BIO *bp" | 153 | .Fa "BIO *bp" |
| @@ -754,7 +746,9 @@ | |||
| 754 | .Sh DESCRIPTION | 746 | .Sh DESCRIPTION |
| 755 | The PEM functions read or write structures in PEM format. | 747 | The PEM functions read or write structures in PEM format. |
| 756 | In this sense PEM format is simply base64-encoded data surrounded by | 748 | In this sense PEM format is simply base64-encoded data surrounded by |
| 757 | header lines. | 749 | header lines; see |
| 750 | .Xr PEM_read 3 | ||
| 751 | for more details. | ||
| 758 | .Pp | 752 | .Pp |
| 759 | For more details about the meaning of arguments see the | 753 | For more details about the meaning of arguments see the |
| 760 | .Sx PEM function arguments | 754 | .Sx PEM function arguments |
| @@ -1050,10 +1044,14 @@ If this parameter is set to | |||
| 1050 | .Dv NULL , | 1044 | .Dv NULL , |
| 1051 | then the private key is written in unencrypted form. | 1045 | then the private key is written in unencrypted form. |
| 1052 | .Pp | 1046 | .Pp |
| 1053 | The | 1047 | The optional arguments |
| 1048 | .Fa u | ||
| 1049 | and | ||
| 1054 | .Fa cb | 1050 | .Fa cb |
| 1055 | argument is the callback to use when querying for the passphrase used | 1051 | are a passphrase used for encrypting a PEM structure |
| 1056 | for encrypted PEM structures (normally only private keys). | 1052 | or a callback to obtain the passphrase; see |
| 1053 | .Xr pem_password_cb 3 | ||
| 1054 | for details. | ||
| 1057 | .Pp | 1055 | .Pp |
| 1058 | For the PEM write routines, if the | 1056 | For the PEM write routines, if the |
| 1059 | .Fa kstr | 1057 | .Fa kstr |
| @@ -1066,62 +1064,6 @@ bytes at | |||
| 1066 | are used as the passphrase and | 1064 | are used as the passphrase and |
| 1067 | .Fa cb | 1065 | .Fa cb |
| 1068 | is ignored. | 1066 | is ignored. |
| 1069 | .Pp | ||
| 1070 | If the | ||
| 1071 | .Fa cb | ||
| 1072 | parameter is set to | ||
| 1073 | .Dv NULL | ||
| 1074 | and the | ||
| 1075 | .Fa u | ||
| 1076 | parameter is not | ||
| 1077 | .Dv NULL , | ||
| 1078 | then the | ||
| 1079 | .Fa u | ||
| 1080 | parameter is interpreted as a null terminated string to use as the | ||
| 1081 | passphrase. | ||
| 1082 | If both | ||
| 1083 | .Fa cb | ||
| 1084 | and | ||
| 1085 | .Fa u | ||
| 1086 | are | ||
| 1087 | .Dv NULL , | ||
| 1088 | then the default callback routine is used, which will typically | ||
| 1089 | prompt for the passphrase on the current terminal with echoing | ||
| 1090 | turned off. | ||
| 1091 | .Pp | ||
| 1092 | The default passphrase callback is sometimes inappropriate (for example | ||
| 1093 | in a GUI application) so an alternative can be supplied. | ||
| 1094 | The callback routine has the following form: | ||
| 1095 | .Bd -filled -offset inset | ||
| 1096 | .Ft int | ||
| 1097 | .Fo cb | ||
| 1098 | .Fa "char *buf" | ||
| 1099 | .Fa "int size" | ||
| 1100 | .Fa "int rwflag" | ||
| 1101 | .Fa "void *u" | ||
| 1102 | .Fc | ||
| 1103 | .Ed | ||
| 1104 | .Pp | ||
| 1105 | .Fa buf | ||
| 1106 | is the buffer to write the passphrase to. | ||
| 1107 | .Fa size | ||
| 1108 | is the maximum length of the passphrase, i.e. the size of | ||
| 1109 | .Fa buf . | ||
| 1110 | .Fa rwflag | ||
| 1111 | is a flag which is set to 0 when reading and 1 when writing. | ||
| 1112 | A typical routine will ask the user to verify the passphrase (for | ||
| 1113 | example by prompting for it twice) if | ||
| 1114 | .Fa rwflag | ||
| 1115 | is 1. | ||
| 1116 | The | ||
| 1117 | .Fa u | ||
| 1118 | parameter has the same value as the | ||
| 1119 | .Fa u | ||
| 1120 | parameter passed to the PEM routine. | ||
| 1121 | It allows arbitrary data to be passed to the callback by the application | ||
| 1122 | (for example a window handle in a GUI application). | ||
| 1123 | The callback must return the number of characters in the passphrase | ||
| 1124 | or -1 if an error occurred. | ||
| 1125 | .Ss PEM encryption format | 1067 | .Ss PEM encryption format |
| 1126 | This old | 1068 | This old |
| 1127 | .Sy PrivateKey | 1069 | .Sy PrivateKey |
