diff options
Diffstat (limited to 'src')
33 files changed, 2040 insertions, 1253 deletions
diff --git a/src/lib/libcrypto/man/CMS_add0_cert.3 b/src/lib/libcrypto/man/CMS_add0_cert.3 new file mode 100644 index 0000000000..b02eb06673 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_add0_cert.3 | |||
| @@ -0,0 +1,127 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_ADD0_CERT 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_add0_cert , | ||
| 6 | .Nm CMS_add1_cert , | ||
| 7 | .Nm CMS_get1_certs , | ||
| 8 | .Nm CMS_add0_crl , | ||
| 9 | .Nm CMS_add1_crl , | ||
| 10 | .Nm CMS_get1_crls | ||
| 11 | .Nd CMS certificate and CRL utility functions | ||
| 12 | .Sh SYNOPSIS | ||
| 13 | .In openssl/cms.h | ||
| 14 | .Ft int | ||
| 15 | .Fo CMS_add0_cert | ||
| 16 | .Fa "CMS_ContentInfo *cms" | ||
| 17 | .Fa "X509 *cert" | ||
| 18 | .Fc | ||
| 19 | .Ft int | ||
| 20 | .Fo CMS_add1_cert | ||
| 21 | .Fa "CMS_ContentInfo *cms" | ||
| 22 | .Fa "X509 *cert" | ||
| 23 | .Fc | ||
| 24 | .Ft STACK_OF(X509) * | ||
| 25 | .Fo CMS_get1_certs | ||
| 26 | .Fa "CMS_ContentInfo *cms" | ||
| 27 | .Fc | ||
| 28 | .Ft int | ||
| 29 | .Fo CMS_add0_crl | ||
| 30 | .Fa "CMS_ContentInfo *cms" | ||
| 31 | .Fa "X509_CRL *crl" | ||
| 32 | .Fc | ||
| 33 | .Ft int | ||
| 34 | .Fo CMS_add1_crl | ||
| 35 | .Fa "CMS_ContentInfo *cms" | ||
| 36 | .Fa "X509_CRL *crl" | ||
| 37 | .Fc | ||
| 38 | .Ft STACK_OF(X509_CRL) * | ||
| 39 | .Fo CMS_get1_crls | ||
| 40 | .Fa "CMS_ContentInfo *cms" | ||
| 41 | .Fc | ||
| 42 | .Sh DESCRIPTION | ||
| 43 | .Fn CMS_add0_cert | ||
| 44 | and | ||
| 45 | .Fn CMS_add1_cert | ||
| 46 | add certificate | ||
| 47 | .Fa cert | ||
| 48 | to | ||
| 49 | .Fa cms . | ||
| 50 | .Fa cms | ||
| 51 | must be of type signed data or enveloped data. | ||
| 52 | .Pp | ||
| 53 | .Fn CMS_get1_certs | ||
| 54 | returns all certificates in | ||
| 55 | .Fa cms . | ||
| 56 | .Pp | ||
| 57 | .Fn CMS_add0_crl | ||
| 58 | and | ||
| 59 | .Fn CMS_add1_crl | ||
| 60 | add CRL | ||
| 61 | .Fa crl | ||
| 62 | to | ||
| 63 | .Fa cms . | ||
| 64 | .Fn CMS_get1_crls | ||
| 65 | returns any CRLs in | ||
| 66 | .Fa cms . | ||
| 67 | .Sh NOTES | ||
| 68 | The | ||
| 69 | .Vt CMS_ContentInfo | ||
| 70 | structure | ||
| 71 | .Fa cms | ||
| 72 | must be of type signed data or enveloped data or an error will be | ||
| 73 | returned. | ||
| 74 | .Pp | ||
| 75 | For signed data, certificates and CRLs are added to the | ||
| 76 | .Fa certificates | ||
| 77 | and | ||
| 78 | .Fa crls | ||
| 79 | fields of the SignedData structure. | ||
| 80 | For enveloped data, they are added to | ||
| 81 | .Fa OriginatorInfo . | ||
| 82 | .Pp | ||
| 83 | As the | ||
| 84 | .Sq 0 | ||
| 85 | implies, | ||
| 86 | .Fn CMS_add0_cert | ||
| 87 | adds | ||
| 88 | .Fa cert | ||
| 89 | internally to | ||
| 90 | .Fa cms | ||
| 91 | and it must not be freed up after the call, as opposed to | ||
| 92 | .Fn CMS_add1_cert | ||
| 93 | where | ||
| 94 | .Fa cert | ||
| 95 | must be freed up. | ||
| 96 | .Pp | ||
| 97 | The same certificate or CRL must not be added to the same cms structure | ||
| 98 | more than once. | ||
| 99 | .Sh RETURN VALUES | ||
| 100 | .Fn CMS_add0_cert , | ||
| 101 | .Fn CMS_add1_cert , | ||
| 102 | .Fn CMS_add0_crl , | ||
| 103 | and | ||
| 104 | .Fn CMS_add1_crl | ||
| 105 | return 1 for success and 0 for failure. | ||
| 106 | .Pp | ||
| 107 | .Fn CMS_get1_certs | ||
| 108 | and | ||
| 109 | .Fn CMS_get1_crls | ||
| 110 | return the STACK of certificates or CRLs or | ||
| 111 | .Dv NULL | ||
| 112 | if there are none or an error occurs. | ||
| 113 | The only error which will occur in practice is if the | ||
| 114 | .Fa cms | ||
| 115 | type is invalid. | ||
| 116 | .Sh SEE ALSO | ||
| 117 | .Xr CMS_encrypt 3 , | ||
| 118 | .Xr CMS_sign 3 , | ||
| 119 | .Xr ERR_get_error 3 | ||
| 120 | .Sh HISTORY | ||
| 121 | .Fn CMS_add0_cert , | ||
| 122 | .Fn CMS_add1_cert , | ||
| 123 | .Fn CMS_get1_certs , | ||
| 124 | .Fn CMS_add0_crl | ||
| 125 | and | ||
| 126 | .Fn CMS_get1_crls | ||
| 127 | were all first added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_add1_recipient_cert.3 b/src/lib/libcrypto/man/CMS_add1_recipient_cert.3 new file mode 100644 index 0000000000..4e848446a6 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_add1_recipient_cert.3 | |||
| @@ -0,0 +1,115 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_ADD1_RECIPIENT_CERT 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_add1_recipient_cert , | ||
| 6 | .Nm CMS_add0_recipient_key | ||
| 7 | .Nd add recipients to a CMS enveloped data structure | ||
| 8 | .Sh SYNOPSIS | ||
| 9 | .In openssl/cms.h | ||
| 10 | .Ft CMS_RecipientInfo * | ||
| 11 | .Fo CMS_add1_recipient_cert | ||
| 12 | .Fa "CMS_ContentInfo *cms" | ||
| 13 | .Fa "X509 *recip" | ||
| 14 | .Fa "unsigned int flags" | ||
| 15 | .Fc | ||
| 16 | .Ft CMS_RecipientInfo * | ||
| 17 | .Fo CMS_add0_recipient_key | ||
| 18 | .Fa "CMS_ContentInfo *cms" | ||
| 19 | .Fa "int nid" | ||
| 20 | .Fa "unsigned char *key" | ||
| 21 | .Fa "size_t keylen" | ||
| 22 | .Fa "unsigned char *id" | ||
| 23 | .Fa "size_t idlen" | ||
| 24 | .Fa "ASN1_GENERALIZEDTIME *date" | ||
| 25 | .Fa "ASN1_OBJECT *otherTypeId" | ||
| 26 | .Fa "ASN1_TYPE *otherType" | ||
| 27 | .Fc | ||
| 28 | .Sh DESCRIPTION | ||
| 29 | .Fn CMS_add1_recipient_cert | ||
| 30 | adds recipient | ||
| 31 | .Fa recip | ||
| 32 | to the | ||
| 33 | .Vt CMS_ContentInfo | ||
| 34 | enveloped data structure | ||
| 35 | .Fa cms | ||
| 36 | as a KeyTransRecipientInfo structure. | ||
| 37 | .Pp | ||
| 38 | .Fn CMS_add0_recipient_key | ||
| 39 | adds the symmetric key | ||
| 40 | .Fa key | ||
| 41 | of length | ||
| 42 | .Fa keylen | ||
| 43 | using the wrapping algorithm | ||
| 44 | .Fa nid , | ||
| 45 | identifier | ||
| 46 | .Fa id | ||
| 47 | of length | ||
| 48 | .Fa idlen | ||
| 49 | and optional values | ||
| 50 | .Fa date , | ||
| 51 | .Fa otherTypeId , | ||
| 52 | and | ||
| 53 | .Fa otherType | ||
| 54 | to the | ||
| 55 | .Vt CMS_ContentInfo | ||
| 56 | enveloped data structure | ||
| 57 | .Fa cms | ||
| 58 | as a KEKRecipientInfo structure. | ||
| 59 | .Pp | ||
| 60 | The | ||
| 61 | .Vt CMS_ContentInfo | ||
| 62 | structure should be obtained from an initial call to | ||
| 63 | .Xr CMS_encrypt 3 | ||
| 64 | with the flag | ||
| 65 | .Dv CMS_PARTIAL | ||
| 66 | set. | ||
| 67 | .Sh NOTES | ||
| 68 | The main purpose of this function is to provide finer control over a CMS | ||
| 69 | enveloped data structure where the simpler | ||
| 70 | .Xr CMS_encrypt 3 | ||
| 71 | function defaults are not appropriate. | ||
| 72 | For example if one or more KEKRecipientInfo structures need to be added. | ||
| 73 | New attributes can also be added using the returned | ||
| 74 | .Vt CMS_RecipientInfo | ||
| 75 | structure and the CMS attribute utility functions. | ||
| 76 | .Pp | ||
| 77 | OpenSSL will by default identify recipient certificates using issuer | ||
| 78 | name and serial number. | ||
| 79 | If | ||
| 80 | .Dv CMS_USE_KEYID | ||
| 81 | is set, it will use the subject key identifier value instead. | ||
| 82 | An error occurs if all recipient certificates do not have a subject key | ||
| 83 | identifier extension. | ||
| 84 | .Pp | ||
| 85 | Currently only AES based key wrapping algorithms are supported for | ||
| 86 | .Fa nid , | ||
| 87 | specifically: | ||
| 88 | .Dv NID_id_aes128_wrap , | ||
| 89 | .Dv NID_id_aes192_wrap , | ||
| 90 | and | ||
| 91 | .Dv NID_id_aes256_wrap . | ||
| 92 | If | ||
| 93 | .Fa nid | ||
| 94 | is set to | ||
| 95 | .Dv NID_undef , | ||
| 96 | then an AES wrap algorithm will be used consistent with | ||
| 97 | .Fa keylen . | ||
| 98 | .Sh RETURN VALUES | ||
| 99 | .Fn CMS_add1_recipient_cert | ||
| 100 | and | ||
| 101 | .Fn CMS_add0_recipient_key | ||
| 102 | return an internal pointer to the | ||
| 103 | .Vt CMS_RecipientInfo | ||
| 104 | structure just added or | ||
| 105 | .Dv NULL | ||
| 106 | if an error occurs. | ||
| 107 | .Sh SEE ALSO | ||
| 108 | .Xr CMS_decrypt 3 , | ||
| 109 | .Xr CMS_final 3 , | ||
| 110 | .Xr ERR_get_error 3 | ||
| 111 | .Sh HISTORY | ||
| 112 | .Fn CMS_add1_recipient_cert | ||
| 113 | and | ||
| 114 | .Fn CMS_add0_recipient_key | ||
| 115 | were added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_add1_signer.3 b/src/lib/libcrypto/man/CMS_add1_signer.3 new file mode 100644 index 0000000000..403ec5b8e3 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_add1_signer.3 | |||
| @@ -0,0 +1,161 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_SIGN_ADD1_SIGNER 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_add1_signer , | ||
| 6 | .Nm CMS_SignerInfo_sign | ||
| 7 | .Nd add a signer to a CMS_ContentInfo signed data structure | ||
| 8 | .Sh SYNOPSIS | ||
| 9 | .In openssl/cms.h | ||
| 10 | .Ft CMS_SignerInfo * | ||
| 11 | .Fo CMS_add1_signer | ||
| 12 | .Fa "CMS_ContentInfo *cms" | ||
| 13 | .Fa "X509 *signcert" | ||
| 14 | .Fa "EVP_PKEY *pkey" | ||
| 15 | .Fa "const EVP_MD *md" | ||
| 16 | .Fa "unsigned int flags" | ||
| 17 | .Fc | ||
| 18 | .Ft int | ||
| 19 | .Fo CMS_SignerInfo_sign | ||
| 20 | .Fa "CMS_SignerInfo *si" | ||
| 21 | .Fc | ||
| 22 | .Sh DESCRIPTION | ||
| 23 | .Fn CMS_add1_signer | ||
| 24 | adds a signer with certificate | ||
| 25 | .Fa signcert | ||
| 26 | and private key | ||
| 27 | .Fa pkey | ||
| 28 | using message digest | ||
| 29 | .Fa md | ||
| 30 | to the | ||
| 31 | .Vt CMS_ContentInfo | ||
| 32 | SignedData structure | ||
| 33 | .Fa cms . | ||
| 34 | .Pp | ||
| 35 | The | ||
| 36 | .Vt CMS_ContentInfo | ||
| 37 | structure should be obtained from an initial call to | ||
| 38 | .Xr CMS_sign 3 | ||
| 39 | with the flag | ||
| 40 | .Dv CMS_PARTIAL | ||
| 41 | set or in the case or re-signing a valid | ||
| 42 | .Vt CMS_ContentInfo | ||
| 43 | SignedData structure. | ||
| 44 | .Pp | ||
| 45 | If the | ||
| 46 | .Fa md | ||
| 47 | parameter is | ||
| 48 | .Dv NULL , | ||
| 49 | then the default digest for the public key algorithm will be used. | ||
| 50 | .Pp | ||
| 51 | Unless the | ||
| 52 | .Dv CMS_REUSE_DIGEST | ||
| 53 | flag is set, the returned | ||
| 54 | .Vt CMS_ContentInfo | ||
| 55 | structure is not complete and must be finalized either by streaming | ||
| 56 | (if applicable) or a call to | ||
| 57 | .Xr CMS_final 3 . | ||
| 58 | .Pp | ||
| 59 | The | ||
| 60 | .Fn CMS_SignerInfo_sign | ||
| 61 | function will explicitly sign a | ||
| 62 | .Vt CMS_SignerInfo | ||
| 63 | structure, its main use is when | ||
| 64 | .Dv CMS_REUSE_DIGEST | ||
| 65 | and | ||
| 66 | .Dv CMS_PARTIAL | ||
| 67 | flags are both set. | ||
| 68 | .Sh NOTES | ||
| 69 | The main purpose of | ||
| 70 | .Fn CMS_add1_signer | ||
| 71 | is to provide finer control over a CMS signed data structure where the | ||
| 72 | simpler | ||
| 73 | .Xr CMS_sign 3 | ||
| 74 | function defaults are not appropriate. | ||
| 75 | For example if multiple signers or non default digest algorithms are | ||
| 76 | needed. | ||
| 77 | New attributes can also be added using the returned | ||
| 78 | .Vt CMS_SignerInfo | ||
| 79 | structure and the CMS attribute utility functions or the CMS signed | ||
| 80 | receipt request functions. | ||
| 81 | .Pp | ||
| 82 | Any of the following flags (OR'ed together) can be passed in the | ||
| 83 | .Fa flags | ||
| 84 | parameter. | ||
| 85 | .Pp | ||
| 86 | If | ||
| 87 | .Dv CMS_REUSE_DIGEST | ||
| 88 | is set, then an attempt is made to copy the content digest value from the | ||
| 89 | .Dv CMS_ContentInfo | ||
| 90 | structure: to add a signer to an existing structure. | ||
| 91 | An error occurs if a matching digest value cannot be found to copy. | ||
| 92 | The returned | ||
| 93 | .Dv CMS_ContentInfo | ||
| 94 | structure will be valid and finalized when this flag is set. | ||
| 95 | .Pp | ||
| 96 | If | ||
| 97 | .Dv CMS_PARTIAL | ||
| 98 | is set in addition to | ||
| 99 | .Dv CMS_REUSE_DIGEST | ||
| 100 | then the | ||
| 101 | .Vt CMS_SignerInfo | ||
| 102 | structure will not be finalized so additional attributes can be added. | ||
| 103 | In this case an explicit call to | ||
| 104 | .Fn CMS_SignerInfo_sign | ||
| 105 | is needed to finalize it. | ||
| 106 | .Pp | ||
| 107 | If | ||
| 108 | .Dv CMS_NOCERTS | ||
| 109 | is set, the signer's certificate will not be included in the | ||
| 110 | .Vt CMS_ContentInfo | ||
| 111 | structure, the signer's certificate must still be supplied in the | ||
| 112 | .Fa signcert | ||
| 113 | parameter though. | ||
| 114 | This can reduce the size of the signature if the signers certificate can | ||
| 115 | be obtained by other means: for example a previously signed message. | ||
| 116 | .Pp | ||
| 117 | The SignedData structure includes several CMS signedAttributes including | ||
| 118 | the signing time, the CMS content type and the supported list of ciphers | ||
| 119 | in an SMIMECapabilities attribute. | ||
| 120 | If | ||
| 121 | .Dv CMS_NOATTR | ||
| 122 | is set, then no signedAttributes will be used. | ||
| 123 | If | ||
| 124 | .Dv CMS_NOSMIMECAP | ||
| 125 | is set, then just the SMIMECapabilities are omitted. | ||
| 126 | .Pp | ||
| 127 | OpenSSL will by default identify signing certificates using issuer name | ||
| 128 | and serial number. | ||
| 129 | If | ||
| 130 | .Dv CMS_USE_KEYID | ||
| 131 | is set, it will use the subject key identifier value instead. | ||
| 132 | An error occurs if the signing certificate does not have a subject key | ||
| 133 | identifier extension. | ||
| 134 | .Pp | ||
| 135 | If present, the SMIMECapabilities attribute indicates support for the | ||
| 136 | following algorithms in preference order: 256 bit AES, Gost R3411-94, | ||
| 137 | Gost 28147-89, 192 bit AES, 128 bit AES, triple DES, 128 bit RC2, 64 bit | ||
| 138 | RC2, DES and 40 bit RC2. | ||
| 139 | If any of these algorithms is not available then it will not be | ||
| 140 | included: for example the GOST algorithms will not be included if | ||
| 141 | the GOST ENGINE is not loaded. | ||
| 142 | .Pp | ||
| 143 | .Fn CMS_add1_signer | ||
| 144 | returns an internal pointer to the | ||
| 145 | .Dv CMS_SignerInfo | ||
| 146 | structure just added. | ||
| 147 | This can be used to set additional attributes before it is finalized. | ||
| 148 | .Sh RETURN VALUES | ||
| 149 | .Fn CMS_add1_signer | ||
| 150 | returns an internal pointer to the | ||
| 151 | .Vt CMS_SignerInfo | ||
| 152 | structure just added or | ||
| 153 | .Dv NULL | ||
| 154 | if an error occurs. | ||
| 155 | .Sh SEE ALSO | ||
| 156 | .Xr CMS_final 3 , | ||
| 157 | .Xr CMS_sign 3 , | ||
| 158 | .Xr ERR_get_error 3 | ||
| 159 | .Sh HISTORY | ||
| 160 | .Fn CMS_add1_signer | ||
| 161 | was added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_compress.3 b/src/lib/libcrypto/man/CMS_compress.3 new file mode 100644 index 0000000000..1330464441 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_compress.3 | |||
| @@ -0,0 +1,110 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_COMPRESS 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_compress | ||
| 6 | .Nd create a CMS CompressedData structure | ||
| 7 | .Sh SYNOPSIS | ||
| 8 | .In openssl/cms.h | ||
| 9 | .Ft CMS_ContentInfo * | ||
| 10 | .Fo CMS_compress | ||
| 11 | .Fa "BIO *in" | ||
| 12 | .Fa "int comp_nid" | ||
| 13 | .Fa "unsigned int flags" | ||
| 14 | .Fc | ||
| 15 | .Sh DESCRIPTION | ||
| 16 | .Fn CMS_compress | ||
| 17 | creates and returns a CMS CompressedData structure. | ||
| 18 | .Fa comp_nid | ||
| 19 | is the compression algorithm to use or | ||
| 20 | .Dv NID_undef | ||
| 21 | to use the default algorithm (zlib compression). | ||
| 22 | .Fa in | ||
| 23 | is the content to be compressed. | ||
| 24 | .Fa flags | ||
| 25 | is an optional set of flags. | ||
| 26 | .Sh NOTES | ||
| 27 | The only currently supported compression algorithm is zlib using the NID | ||
| 28 | .Dv NID_zlib_compression . | ||
| 29 | .Pp | ||
| 30 | If zlib support is not compiled into OpenSSL then | ||
| 31 | .Fn CMS_compress | ||
| 32 | will return an error. | ||
| 33 | .Pp | ||
| 34 | If the | ||
| 35 | .Dv CMS_TEXT | ||
| 36 | flag is set, MIME headers for type | ||
| 37 | .Sy text/plain | ||
| 38 | are prepended to the data. | ||
| 39 | .Pp | ||
| 40 | Normally the supplied content is translated into MIME canonical format | ||
| 41 | (as required by the S/MIME specifications); if | ||
| 42 | .Dv CMS_BINARY | ||
| 43 | is set, no translation occurs. | ||
| 44 | This option should be used if the supplied data is in binary format; | ||
| 45 | otherwise the translation will corrupt it. | ||
| 46 | If | ||
| 47 | .Dv CMS_BINARY | ||
| 48 | is set then | ||
| 49 | .Dv CMS_TEXT | ||
| 50 | is ignored. | ||
| 51 | .Pp | ||
| 52 | If the | ||
| 53 | .Dv CMS_STREAM | ||
| 54 | flag is set a partial | ||
| 55 | .Vt CMS_ContentInfo | ||
| 56 | structure is returned suitable for streaming I/O: no data is read from | ||
| 57 | the | ||
| 58 | .Vt BIO | ||
| 59 | .Fa in . | ||
| 60 | .Pp | ||
| 61 | The compressed data is included in the | ||
| 62 | .Vt CMS_ContentInfo | ||
| 63 | structure, unless | ||
| 64 | .Dv CMS_DETACHED | ||
| 65 | is set, in which case it is omitted. | ||
| 66 | This is rarely used in practice and is not supported by | ||
| 67 | .Xr SMIME_write_CMS 3 . | ||
| 68 | .Sh NOTES | ||
| 69 | If the flag | ||
| 70 | .Dv CMS_STREAM | ||
| 71 | is set, the returned | ||
| 72 | .Vt CMS_ContentInfo | ||
| 73 | structure is | ||
| 74 | .Em not | ||
| 75 | complete and outputting its contents via a function that does not | ||
| 76 | properly finalize the | ||
| 77 | .Vt CMS_ContentInfo | ||
| 78 | structure will give unpredictable results. | ||
| 79 | .Pp | ||
| 80 | Several functions including | ||
| 81 | .Xr SMIME_write_CMS 3 , | ||
| 82 | .Xr i2d_CMS_bio_stream 3 , | ||
| 83 | .Xr PEM_write_bio_CMS_stream 3 | ||
| 84 | finalize the structure. | ||
| 85 | Alternatively finalization can be performed by obtaining the streaming | ||
| 86 | ASN1 | ||
| 87 | .Vt BIO | ||
| 88 | directly using | ||
| 89 | .Xr BIO_new_CMS 3 . | ||
| 90 | .Pp | ||
| 91 | Additional compression parameters such as the zlib compression level | ||
| 92 | cannot currently be set. | ||
| 93 | .Sh RETURN VALUES | ||
| 94 | .Fn CMS_compress | ||
| 95 | returns either a | ||
| 96 | .Vt CMS_ContentInfo | ||
| 97 | structure or | ||
| 98 | .Dv NULL | ||
| 99 | if an error occurred. | ||
| 100 | The error can be obtained from | ||
| 101 | .Xr ERR_get_error 3 . | ||
| 102 | .Sh SEE ALSO | ||
| 103 | .Xr CMS_uncompress 3 , | ||
| 104 | .Xr ERR_get_error 3 | ||
| 105 | .Sh HISTORY | ||
| 106 | .Fn CMS_compress | ||
| 107 | was added to OpenSSL 0.9.8. | ||
| 108 | The | ||
| 109 | .Dv CMS_STREAM | ||
| 110 | flag was first supported in OpenSSL 1.0.0. | ||
diff --git a/src/lib/libcrypto/man/CMS_decrypt.3 b/src/lib/libcrypto/man/CMS_decrypt.3 new file mode 100644 index 0000000000..3a34f10783 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_decrypt.3 | |||
| @@ -0,0 +1,127 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_DECRYPT 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_decrypt | ||
| 6 | .Nd decrypt content from a CMS envelopedData structure | ||
| 7 | .Sh SYNOPSIS | ||
| 8 | .In openssl/cms.h | ||
| 9 | .Ft int | ||
| 10 | .Fo CMS_decrypt | ||
| 11 | .Fa "CMS_ContentInfo *cms" | ||
| 12 | .Fa "EVP_PKEY *pkey" | ||
| 13 | .Fa "X509 *cert" | ||
| 14 | .Fa "BIO *dcont" | ||
| 15 | .Fa "BIO *out" | ||
| 16 | .Fa "unsigned int flags" | ||
| 17 | .Fc | ||
| 18 | .Sh DESCRIPTION | ||
| 19 | .Fn CMS_decrypt | ||
| 20 | extracts and decrypts the content from a CMS EnvelopedData structure. | ||
| 21 | .Fa pkey | ||
| 22 | is the private key of the recipient, | ||
| 23 | .Fa cert | ||
| 24 | is the recipient's certificate, | ||
| 25 | .Fa out | ||
| 26 | is a | ||
| 27 | .Vt BIO | ||
| 28 | to write the content to and | ||
| 29 | .Fa flags | ||
| 30 | is an optional set of flags. | ||
| 31 | .Pp | ||
| 32 | The | ||
| 33 | .Fa dcont | ||
| 34 | parameter is used in the rare case where the encrypted content is | ||
| 35 | detached. | ||
| 36 | It will normally be set to | ||
| 37 | .Dv NULL . | ||
| 38 | .Sh NOTES | ||
| 39 | .Xr OpenSSL_add_all_algorithms 3 | ||
| 40 | (or equivalent) should be called before using this function or errors | ||
| 41 | about unknown algorithms will occur. | ||
| 42 | .Pp | ||
| 43 | Although the recipients certificate is not needed to decrypt the data it | ||
| 44 | is needed to locate the appropriate (of possible several) recipients in | ||
| 45 | the CMS structure. | ||
| 46 | .Pp | ||
| 47 | If | ||
| 48 | .Fa cert | ||
| 49 | is set to | ||
| 50 | .Dv NULL , | ||
| 51 | all possible recipients are tried. | ||
| 52 | This case however is problematic. | ||
| 53 | To thwart the MMA attack (Bleichenbacher's attack on PKCS #1 v1.5 RSA | ||
| 54 | padding) all recipients are tried whether they succeed or not. | ||
| 55 | If no recipient succeeds then a random symmetric key is used to decrypt | ||
| 56 | the content: this will typically output garbage and may (but is not | ||
| 57 | guaranteed to) ultimately return a padding error only. | ||
| 58 | If | ||
| 59 | .Fn CMS_decrypt | ||
| 60 | just returned an error when all recipient encrypted keys failed to | ||
| 61 | decrypt an attacker could use this in a timing attack. | ||
| 62 | If the special flag | ||
| 63 | .Dv CMS_DEBUG_DECRYPT | ||
| 64 | is set then the above behaviour is modified and an error | ||
| 65 | .Em is | ||
| 66 | returned if no recipient encrypted key can be decrypted | ||
| 67 | .Em without | ||
| 68 | generating a random content encryption key. | ||
| 69 | Applications should use this flag with | ||
| 70 | .Sy extreme caution | ||
| 71 | especially in automated gateways as it can leave them open to attack. | ||
| 72 | .Pp | ||
| 73 | It is possible to determine the correct recipient key by other means | ||
| 74 | (for example looking them up in a database) and setting them in the CMS | ||
| 75 | structure in advance using the CMS utility functions such as | ||
| 76 | .Xr CMS_set1_pkey 3 . | ||
| 77 | In this case both | ||
| 78 | .Fa cert | ||
| 79 | and | ||
| 80 | .Fa pkey | ||
| 81 | should be set to | ||
| 82 | .Dv NULL . | ||
| 83 | .Pp | ||
| 84 | To process KEKRecipientInfo types | ||
| 85 | .Xr CMS_set1_key 3 | ||
| 86 | or | ||
| 87 | .Xr CMS_RecipientInfo_set0_key 3 | ||
| 88 | and | ||
| 89 | .Xr CMS_ReceipientInfo_decrypt 3 | ||
| 90 | should be called before | ||
| 91 | .Fn CMS_decrypt | ||
| 92 | and | ||
| 93 | .Fa cert | ||
| 94 | and | ||
| 95 | .Fa pkey | ||
| 96 | set to | ||
| 97 | .Dv NULL . | ||
| 98 | .Pp | ||
| 99 | The following flags can be passed in the | ||
| 100 | .Fa flags | ||
| 101 | parameter: | ||
| 102 | .Pp | ||
| 103 | If the | ||
| 104 | .Dv CMS_TEXT | ||
| 105 | flag is set MIME headers for type | ||
| 106 | .Sy text/plain | ||
| 107 | are deleted from the content. | ||
| 108 | If the content is not of type | ||
| 109 | .Sy text/plain | ||
| 110 | then an error is returned. | ||
| 111 | .Sh RETURN VALUES | ||
| 112 | .Fn CMS_decrypt | ||
| 113 | returns either 1 for success or 0 for failure. | ||
| 114 | The error can be obtained from | ||
| 115 | .Xr ERR_get_error 3 . | ||
| 116 | .Sh BUGS | ||
| 117 | The lack of single pass processing and the need to hold all data in | ||
| 118 | memory as mentioned in | ||
| 119 | .Xr CMS_verify 3 | ||
| 120 | also applies to | ||
| 121 | .Fn CMS_decrypt . | ||
| 122 | .Sh SEE ALSO | ||
| 123 | .Xr CMS_encrypt 3 , | ||
| 124 | .Xr ERR_get_error 3 | ||
| 125 | .Sh HISTORY | ||
| 126 | .Fn CMS_decrypt | ||
| 127 | was added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_encrypt.3 b/src/lib/libcrypto/man/CMS_encrypt.3 new file mode 100644 index 0000000000..5d7b0bf470 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_encrypt.3 | |||
| @@ -0,0 +1,152 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_ENCRYPT 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_encrypt | ||
| 6 | .Nd create a CMS envelopedData structure | ||
| 7 | .Sh SYNOPSIS | ||
| 8 | .In openssl/cms.h | ||
| 9 | .Ft CMS_ContentInfo * | ||
| 10 | .Fo CMS_encrypt | ||
| 11 | .Fa "STACK_OF(X509) *certs" | ||
| 12 | .Fa "BIO *in" | ||
| 13 | .Fa "const EVP_CIPHER *cipher" | ||
| 14 | .Fa "unsigned int flags" | ||
| 15 | .Fc | ||
| 16 | .Sh DESCRIPTION | ||
| 17 | .Fn CMS_encrypt | ||
| 18 | creates and returns a CMS EnvelopedData structure. | ||
| 19 | .Fa certs | ||
| 20 | is a list of recipient certificates. | ||
| 21 | .Fa in | ||
| 22 | is the content to be encrypted. | ||
| 23 | .Fa cipher | ||
| 24 | is the symmetric cipher to use. | ||
| 25 | .Fa flags | ||
| 26 | is an optional set of flags. | ||
| 27 | .Sh NOTES | ||
| 28 | Only certificates carrying RSA keys are supported so the recipient | ||
| 29 | certificates supplied to this function must all contain RSA public keys, | ||
| 30 | though they do not have to be signed using the RSA algorithm. | ||
| 31 | .Pp | ||
| 32 | The algorithm passed in the | ||
| 33 | .Fa cipher | ||
| 34 | parameter must support ASN1 encoding of its parameters. | ||
| 35 | .Pp | ||
| 36 | Many browsers implement a "sign and encrypt" option which is simply an | ||
| 37 | S/MIME envelopedData containing an S/MIME signed message. | ||
| 38 | This can be readily produced by storing the S/MIME signed message in a | ||
| 39 | memory BIO and passing it to | ||
| 40 | .Fn CMS_encrypt . | ||
| 41 | .Pp | ||
| 42 | The following flags can be passed in the | ||
| 43 | .Fa flags | ||
| 44 | parameter: | ||
| 45 | .Pp | ||
| 46 | If the | ||
| 47 | .Dv CMS_TEXT | ||
| 48 | flag is set, MIME headers for type | ||
| 49 | .Sy text/plain | ||
| 50 | are prepended to the data. | ||
| 51 | .Pp | ||
| 52 | Normally the supplied content is translated into MIME canonical format | ||
| 53 | (as required by the S/MIME specifications); if | ||
| 54 | .Dv CMS_BINARY | ||
| 55 | is set, no translation occurs. | ||
| 56 | This option should be used if the supplied data is in binary format; | ||
| 57 | otherwise the translation will corrupt it. | ||
| 58 | If | ||
| 59 | .Dv CMS_BINARY | ||
| 60 | is set then | ||
| 61 | .Dv CMS_TEXT | ||
| 62 | is ignored. | ||
| 63 | .Pp | ||
| 64 | OpenSSL will by default identify recipient certificates using issuer | ||
| 65 | name and serial number. | ||
| 66 | If | ||
| 67 | .Dv CMS_USE_KEYID | ||
| 68 | is set, it will use the subject key identifier value instead. | ||
| 69 | An error occurs if all recipient certificates do not have a subject key | ||
| 70 | identifier extension. | ||
| 71 | .Pp | ||
| 72 | If the | ||
| 73 | .Dv CMS_STREAM | ||
| 74 | flag is set, a partial | ||
| 75 | .Vt CMS_ContentInfo | ||
| 76 | structure is returned suitable for streaming I/O: no data is read from the | ||
| 77 | .Vt BIO | ||
| 78 | .Fa in . | ||
| 79 | .Pp | ||
| 80 | If the | ||
| 81 | .Dv CMS_PARTIAL | ||
| 82 | flag is set, a partial | ||
| 83 | .Vt CMS_ContentInfo | ||
| 84 | structure is returned to which additional recipients and attributes can | ||
| 85 | be added before finalization. | ||
| 86 | .Pp | ||
| 87 | The data being encrypted is included in the | ||
| 88 | .Vt CMS_ContentInfo | ||
| 89 | structure, unless | ||
| 90 | .Dv CMS_DETACHED | ||
| 91 | is set, in which case it is omitted. | ||
| 92 | This is rarely used in practice and is not supported by | ||
| 93 | .Xr SMIME_write_CMS 3 . | ||
| 94 | .Pp | ||
| 95 | If the flag | ||
| 96 | .Dv CMS_STREAM | ||
| 97 | is set, the returned | ||
| 98 | .Vt CMS_ContentInfo | ||
| 99 | structure is | ||
| 100 | .Em not | ||
| 101 | complete and outputting its contents via a function that does not | ||
| 102 | properly finalize the | ||
| 103 | .Vt CMS_ContentInfo | ||
| 104 | structure will give unpredictable results. | ||
| 105 | .Pp | ||
| 106 | Several functions including | ||
| 107 | .Xr SMIME_write_CMS 3 , | ||
| 108 | .Xr i2d_CMS_bio_stream 3 , | ||
| 109 | .Xr PEM_write_bio_CMS_stream 3 | ||
| 110 | finalize the structure. | ||
| 111 | Alternatively finalization can be performed by obtaining the streaming | ||
| 112 | ASN1 | ||
| 113 | .Vt BIO | ||
| 114 | directly using | ||
| 115 | .Xr BIO_new_CMS 3 . | ||
| 116 | .Pp | ||
| 117 | The recipients specified in | ||
| 118 | .Fa certs | ||
| 119 | use a CMS KeyTransRecipientInfo info structure. | ||
| 120 | KEKRecipientInfo is also supported using the flag | ||
| 121 | .Dv CMS_PARTIAL | ||
| 122 | and | ||
| 123 | .Xr CMS_add0_recipient_key 3 . | ||
| 124 | .Pp | ||
| 125 | The parameter | ||
| 126 | .Fa certs | ||
| 127 | may be | ||
| 128 | .Dv NULL | ||
| 129 | if | ||
| 130 | .Dv CMS_PARTIAL | ||
| 131 | is set and recipients are added later using | ||
| 132 | .Xr CMS_add1_recipient_cert 3 | ||
| 133 | or | ||
| 134 | .Xr CMS_add0_recipient_key 3 . | ||
| 135 | .Sh RETURN VALUES | ||
| 136 | .Fn CMS_encrypt | ||
| 137 | returns either a | ||
| 138 | .Vt CMS_ContentInfo | ||
| 139 | structure or | ||
| 140 | .Dv NULL | ||
| 141 | if an error occurred. | ||
| 142 | The error can be obtained from | ||
| 143 | .Xr ERR_get_error 3 . | ||
| 144 | .Sh SEE ALSO | ||
| 145 | .Xr CMS_decrypt 3 , | ||
| 146 | .Xr ERR_get_error 3 | ||
| 147 | .Sh HISTORY | ||
| 148 | .Fn CMS_encrypt | ||
| 149 | was added to OpenSSL 0.9.8. | ||
| 150 | The | ||
| 151 | .Dv CMS_STREAM | ||
| 152 | flag was first supported in OpenSSL 1.0.0. | ||
diff --git a/src/lib/libcrypto/man/CMS_final.3 b/src/lib/libcrypto/man/CMS_final.3 new file mode 100644 index 0000000000..4e7912a4e0 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_final.3 | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_FINAL 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_final | ||
| 6 | .Nd finalise a CMS_ContentInfo structure | ||
| 7 | .Sh SYNOPSIS | ||
| 8 | .In openssl/cms.h | ||
| 9 | .Ft int | ||
| 10 | .Fo CMS_final | ||
| 11 | .Fa "CMS_ContentInfo *cms" | ||
| 12 | .Fa "BIO *data" | ||
| 13 | .Fa "BIO *dcont" | ||
| 14 | .Fa "unsigned int flags" | ||
| 15 | .Fc | ||
| 16 | .Sh DESCRIPTION | ||
| 17 | .Fn CMS_final | ||
| 18 | finalises the structure | ||
| 19 | .Fa cms . | ||
| 20 | Its purpose is to perform any operations necessary on | ||
| 21 | .Fa cms | ||
| 22 | (digest computation for example) and set the appropriate fields. | ||
| 23 | The parameter | ||
| 24 | .Fa data | ||
| 25 | contains the content to be processed. | ||
| 26 | The | ||
| 27 | .Fa dcont | ||
| 28 | parameter contains a | ||
| 29 | .Vt BIO | ||
| 30 | to write content to after processing: this is | ||
| 31 | only used with detached data and will usually be set to | ||
| 32 | .Dv NULL . | ||
| 33 | .Sh NOTES | ||
| 34 | This function will normally be called when the | ||
| 35 | .Dv CMS_PARTIAL | ||
| 36 | flag is used. | ||
| 37 | It should only be used when streaming is not performed because the | ||
| 38 | streaming I/O functions perform finalisation operations internally. | ||
| 39 | .Sh RETURN VALUES | ||
| 40 | .Fn CMS_final | ||
| 41 | returns 1 for success or 0 for failure. | ||
| 42 | .Sh SEE ALSO | ||
| 43 | .Xr CMS_encrypt 3 , | ||
| 44 | .Xr CMS_sign 3 , | ||
| 45 | .Xr ERR_get_error 3 | ||
| 46 | .Sh HISTORY | ||
| 47 | .Fn CMS_final | ||
| 48 | was added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_get0_RecipientInfos.3 b/src/lib/libcrypto/man/CMS_get0_RecipientInfos.3 new file mode 100644 index 0000000000..4db69b57b8 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_get0_RecipientInfos.3 | |||
| @@ -0,0 +1,251 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_GET0_RECIPIENTINFOS 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_get0_RecipientInfos , | ||
| 6 | .Nm CMS_RecipientInfo_type , | ||
| 7 | .Nm CMS_RecipientInfo_ktri_get0_signer_id , | ||
| 8 | .Nm CMS_RecipientInfo_ktri_cert_cmp , | ||
| 9 | .Nm CMS_RecipientInfo_set0_pkey , | ||
| 10 | .Nm CMS_RecipientInfo_kekri_get0_id , | ||
| 11 | .Nm CMS_RecipientInfo_kekri_id_cmp , | ||
| 12 | .Nm CMS_RecipientInfo_set0_key , | ||
| 13 | .Nm CMS_RecipientInfo_decrypt , | ||
| 14 | .Nm CMS_RecipientInfo_encrypt | ||
| 15 | .Nd CMS envelopedData RecipientInfo routines | ||
| 16 | .Sh SYNOPSIS | ||
| 17 | .In openssl/cms.h | ||
| 18 | .Ft STACK_OF(CMS_RecipientInfo) * | ||
| 19 | .Fo CMS_get0_RecipientInfos | ||
| 20 | .Fa "CMS_ContentInfo *cms" | ||
| 21 | .Fc | ||
| 22 | .Ft int | ||
| 23 | .Fo CMS_RecipientInfo_type | ||
| 24 | .Fa "CMS_RecipientInfo *ri" | ||
| 25 | .Fc | ||
| 26 | .Ft int | ||
| 27 | .Fo CMS_RecipientInfo_ktri_get0_signer_id | ||
| 28 | .Fa "CMS_RecipientInfo *ri" | ||
| 29 | .Fa "ASN1_OCTET_STRING **keyid" | ||
| 30 | .Fa "X509_NAME **issuer" | ||
| 31 | .Fa "ASN1_INTEGER **sno" | ||
| 32 | .Fc | ||
| 33 | .Ft int | ||
| 34 | .Fo CMS_RecipientInfo_ktri_cert_cmp | ||
| 35 | .Fa "CMS_RecipientInfo *ri" | ||
| 36 | .Fa "X509 *cert" | ||
| 37 | .Fc | ||
| 38 | .Ft int | ||
| 39 | .Fo CMS_RecipientInfo_set0_pkey | ||
| 40 | .Fa "CMS_RecipientInfo *ri" | ||
| 41 | .Fa "EVP_PKEY *pkey" | ||
| 42 | .Fc | ||
| 43 | .Ft int | ||
| 44 | .Fo CMS_RecipientInfo_kekri_get0_id | ||
| 45 | .Fa "CMS_RecipientInfo *ri" | ||
| 46 | .Fa "X509_ALGOR **palg" | ||
| 47 | .Fa "ASN1_OCTET_STRING **pid" | ||
| 48 | .Fa "ASN1_GENERALIZEDTIME **pdate" | ||
| 49 | .Fa "ASN1_OBJECT **potherid" | ||
| 50 | .Fa "ASN1_TYPE **pothertype" | ||
| 51 | .Fc | ||
| 52 | .Ft int | ||
| 53 | .Fo CMS_RecipientInfo_kekri_id_cmp | ||
| 54 | .Fa "CMS_RecipientInfo *ri" | ||
| 55 | .Fa "const unsigned char *id" | ||
| 56 | .Fa "size_t idlen" | ||
| 57 | .Fc | ||
| 58 | .Ft int | ||
| 59 | .Fo CMS_RecipientInfo_set0_key | ||
| 60 | .Fa "CMS_RecipientInfo *ri" | ||
| 61 | .Fa "unsigned char *key" | ||
| 62 | .Fa "size_t keylen" | ||
| 63 | .Fc | ||
| 64 | .Ft int | ||
| 65 | .Fo CMS_RecipientInfo_decrypt | ||
| 66 | .Fa "CMS_ContentInfo *cms" | ||
| 67 | .Fa "CMS_RecipientInfo *ri" | ||
| 68 | .Fc | ||
| 69 | .Sh DESCRIPTION | ||
| 70 | The function | ||
| 71 | .Fn CMS_get0_RecipientInfos | ||
| 72 | returns all the | ||
| 73 | .Vt CMS_RecipientInfo | ||
| 74 | structures associated with a CMS EnvelopedData structure. | ||
| 75 | .Pp | ||
| 76 | .Fn CMS_RecipientInfo_type | ||
| 77 | returns the type of the | ||
| 78 | .Vt CMS_RecipientInfo | ||
| 79 | structure | ||
| 80 | .Fa ri . | ||
| 81 | It will currently return | ||
| 82 | .Dv CMS_RECIPINFO_TRANS , | ||
| 83 | .Dv CMS_RECIPINFO_AGREE , | ||
| 84 | .Dv CMS_RECIPINFO_KEK , | ||
| 85 | .Dv CMS_RECIPINFO_PASS , | ||
| 86 | or | ||
| 87 | .Dv CMS_RECIPINFO_OTHER . | ||
| 88 | .Pp | ||
| 89 | .Fn CMS_RecipientInfo_ktri_get0_signer_id | ||
| 90 | retrieves the certificate recipient identifier associated with a | ||
| 91 | specific | ||
| 92 | .Vt CMS_RecipientInfo | ||
| 93 | structure | ||
| 94 | .Fa ri , | ||
| 95 | which must be of type | ||
| 96 | .Dv CMS_RECIPINFO_TRANS . | ||
| 97 | Either the keyidentifier will be set in | ||
| 98 | .Fa keyid | ||
| 99 | or | ||
| 100 | .Em both | ||
| 101 | issuer name and serial number in | ||
| 102 | .Fa issuer | ||
| 103 | and | ||
| 104 | .Fa sno . | ||
| 105 | .Pp | ||
| 106 | .Fn CMS_RecipientInfo_ktri_cert_cmp | ||
| 107 | compares the certificate | ||
| 108 | .Fa cert | ||
| 109 | against the | ||
| 110 | .Vt CMS_RecipientInfo | ||
| 111 | structure | ||
| 112 | .Fa ri , | ||
| 113 | which must be of type | ||
| 114 | .Dv CMS_RECIPINFO_TRANS . | ||
| 115 | It returns zero if the | ||
| 116 | comparison is successful and non zero if not. | ||
| 117 | .Pp | ||
| 118 | .Fn CMS_RecipientInfo_set0_pkey | ||
| 119 | associates the private key | ||
| 120 | .Fa pkey | ||
| 121 | with the | ||
| 122 | .Vt CMS_RecipientInfo | ||
| 123 | structure | ||
| 124 | .Fa ri , | ||
| 125 | which must be of type | ||
| 126 | .Dv CMS_RECIPINFO_TRANS . | ||
| 127 | .Pp | ||
| 128 | .Fn CMS_RecipientInfo_kekri_get0_id | ||
| 129 | retrieves the key information from the | ||
| 130 | .Vt CMS_RecipientInfo | ||
| 131 | structure | ||
| 132 | .Fa ri | ||
| 133 | which must be of type | ||
| 134 | .Dv CMS_RECIPINFO_KEK . | ||
| 135 | Any of the remaining parameters can be | ||
| 136 | .Dv NULL | ||
| 137 | if the application is not interested in the value of a field. | ||
| 138 | Where a field is optional and absent, | ||
| 139 | .Dv NULL | ||
| 140 | will be written to the corresponding parameter. | ||
| 141 | The | ||
| 142 | .Sy keyEncryptionAlgorithm | ||
| 143 | field is written to | ||
| 144 | .Fa palg , | ||
| 145 | the | ||
| 146 | .Sy keyIdentifier | ||
| 147 | field is written to | ||
| 148 | .Fa pid , | ||
| 149 | the | ||
| 150 | .Sy date | ||
| 151 | field if present is written to | ||
| 152 | .Fa pdate , | ||
| 153 | if the | ||
| 154 | .Sy other | ||
| 155 | field is present the components | ||
| 156 | .Sy keyAttrId | ||
| 157 | and | ||
| 158 | .Sy keyAttr | ||
| 159 | are written to the parameters | ||
| 160 | .Fa potherid | ||
| 161 | and | ||
| 162 | .Fa pothertype . | ||
| 163 | .Pp | ||
| 164 | .Fn CMS_RecipientInfo_kekri_id_cmp | ||
| 165 | compares the ID in the | ||
| 166 | .Fa id | ||
| 167 | and | ||
| 168 | .Fa idlen | ||
| 169 | parameters against the | ||
| 170 | .Sy keyIdentifier | ||
| 171 | .Vt CMS_RecipientInfo | ||
| 172 | structure | ||
| 173 | .Fa ri , | ||
| 174 | which must be of type | ||
| 175 | .Dv CMS_RECIPINFO_KEK . | ||
| 176 | It returns zero if the comparison is successful and non zero if not. | ||
| 177 | .Pp | ||
| 178 | .Fn CMS_RecipientInfo_set0_key | ||
| 179 | associates the symmetric key | ||
| 180 | .Fa key | ||
| 181 | of length | ||
| 182 | .Fa keylen | ||
| 183 | with the | ||
| 184 | .Vt CMS_RecipientInfo | ||
| 185 | structure | ||
| 186 | .Fa ri , | ||
| 187 | which must be of type | ||
| 188 | .Dv CMS_RECIPINFO_KEK . | ||
| 189 | .Pp | ||
| 190 | .Fn CMS_RecipientInfo_decrypt | ||
| 191 | attempts to decrypt the | ||
| 192 | .Vt CMS_RecipientInfo | ||
| 193 | structure | ||
| 194 | .Fa ri | ||
| 195 | in structure | ||
| 196 | .Fa cms . | ||
| 197 | A key must have been associated with the structure first. | ||
| 198 | .Sh NOTES | ||
| 199 | The main purpose of these functions is to enable an application to | ||
| 200 | lookup recipient keys using any appropriate technique when the simpler | ||
| 201 | method of | ||
| 202 | .Xr CMS_decrypt 3 | ||
| 203 | is not appropriate. | ||
| 204 | .Pp | ||
| 205 | In typical usage, an application will retrieve all | ||
| 206 | .Vt CMS_RecipientInfo | ||
| 207 | structures using | ||
| 208 | .Fn CMS_get0_RecipientInfos | ||
| 209 | and check the type of each using | ||
| 210 | .Fn CMS_RecipientInfo_type . | ||
| 211 | Depending on the type, the | ||
| 212 | .Vt CMS_RecipientInfo | ||
| 213 | structure can be ignored or its key identifier data retrieved using | ||
| 214 | an appropriate function. | ||
| 215 | Then if the corresponding secret or private key can be obtained by any | ||
| 216 | appropriate means it can then associated with the structure and | ||
| 217 | .Xr CMS_RecpientInfo_decrypt 3 | ||
| 218 | called. | ||
| 219 | If successful, | ||
| 220 | .Xr CMS_decrypt 3 | ||
| 221 | can be called with a | ||
| 222 | .Dv NULL | ||
| 223 | key to decrypt the enveloped content. | ||
| 224 | .Sh RETURN VALUES | ||
| 225 | .Fn CMS_get0_RecipientInfos | ||
| 226 | returns all | ||
| 227 | .Vt CMS_RecipientInfo | ||
| 228 | structures, or | ||
| 229 | .Dv NULL | ||
| 230 | if an error occurs. | ||
| 231 | .Pp | ||
| 232 | .Fn CMS_RecipientInfo_ktri_get0_signer_id , | ||
| 233 | .Fn CMS_RecipientInfo_set0_pkey , | ||
| 234 | .Fn CMS_RecipientInfo_kekri_get0_id , | ||
| 235 | .Fn CMS_RecipientInfo_set0_key , | ||
| 236 | and | ||
| 237 | .Fn CMS_RecipientInfo_decrypt | ||
| 238 | return 1 for success or 0 if an error occurs. | ||
| 239 | .Pp | ||
| 240 | .Fn CMS_RecipientInfo_ktri_cert_cmp | ||
| 241 | and | ||
| 242 | .Fn CMS_RecipientInfo_kekri_id_cmp | ||
| 243 | return 0 for a successful comparison and non zero otherwise. | ||
| 244 | .Pp | ||
| 245 | Any error can be obtained from | ||
| 246 | .Xr ERR_get_error 3 . | ||
| 247 | .Sh SEE ALSO | ||
| 248 | .Xr CMS_decrypt 3 , | ||
| 249 | .Xr ERR_get_error 3 | ||
| 250 | .Sh HISTORY | ||
| 251 | These functions were first was added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_get0_SignerInfos.3 b/src/lib/libcrypto/man/CMS_get0_SignerInfos.3 new file mode 100644 index 0000000000..99aab48193 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_get0_SignerInfos.3 | |||
| @@ -0,0 +1,119 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_GET0_SIGNERINFOS 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_get0_SignerInfos , | ||
| 6 | .Nm CMS_SignerInfo_get0_signer_id , | ||
| 7 | .Nm CMS_SignerInfo_cert_cmp , | ||
| 8 | .Nm CMS_set1_signer_certs | ||
| 9 | .Nd CMS signedData signer functions | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/cms.h | ||
| 12 | .Ft STACK_OF(CMS_SignerInfo) * | ||
| 13 | .Fo CMS_get0_SignerInfos | ||
| 14 | .Fa "CMS_ContentInfo *cms" | ||
| 15 | .Fc | ||
| 16 | .Ft int | ||
| 17 | .Fo CMS_SignerInfo_get0_signer_id | ||
| 18 | .Fa "CMS_SignerInfo *si" | ||
| 19 | .Fa "ASN1_OCTET_STRING **keyid" | ||
| 20 | .Fa "X509_NAME **issuer" | ||
| 21 | .Fa "ASN1_INTEGER **sno" | ||
| 22 | .Fc | ||
| 23 | .Ft int | ||
| 24 | .Fo CMS_SignerInfo_cert_cmp | ||
| 25 | .Fa "CMS_SignerInfo *si" | ||
| 26 | .Fa "X509 *cert" | ||
| 27 | .Fc | ||
| 28 | .Ft void | ||
| 29 | .Fo CMS_SignerInfo_set1_signer_cert | ||
| 30 | .Fa "CMS_SignerInfo *si" | ||
| 31 | .Fa "X509 *signer" | ||
| 32 | .Fc | ||
| 33 | .Sh DESCRIPTION | ||
| 34 | The function | ||
| 35 | .Fn CMS_get0_SignerInfos | ||
| 36 | returns all the | ||
| 37 | .Vt CMS_SignerInfo | ||
| 38 | structures associated with a CMS signedData structure. | ||
| 39 | .Pp | ||
| 40 | .Fn CMS_SignerInfo_get0_signer_id | ||
| 41 | retrieves the certificate signer identifier associated with a specific | ||
| 42 | .Vt CMS_SignerInfo | ||
| 43 | structure | ||
| 44 | .Fa si . | ||
| 45 | Either the keyidentifier will be set in | ||
| 46 | .Fa keyid | ||
| 47 | or | ||
| 48 | .Em both | ||
| 49 | issuer name and serial number in | ||
| 50 | .Fa issuer | ||
| 51 | and | ||
| 52 | .Fa sno . | ||
| 53 | .Pp | ||
| 54 | .Fn CMS_SignerInfo_cert_cmp | ||
| 55 | compares the certificate | ||
| 56 | .Fa cert | ||
| 57 | against the signer identifier | ||
| 58 | .Fa si . | ||
| 59 | It returns zero if the comparison is successful and non zero if not. | ||
| 60 | .Pp | ||
| 61 | .Fn CMS_SignerInfo_set1_signer_cert | ||
| 62 | sets the signers certificate of | ||
| 63 | .Fa si | ||
| 64 | to | ||
| 65 | .Fa signer . | ||
| 66 | .Sh NOTES | ||
| 67 | The main purpose of these functions is to enable an application to | ||
| 68 | lookup signers certificates using any appropriate technique when the | ||
| 69 | simpler method of | ||
| 70 | .Xr CMS_verify 3 | ||
| 71 | is not appropriate. | ||
| 72 | .Pp | ||
| 73 | In typical usage and application will retrieve all | ||
| 74 | .Vt CMS_SignerInfo | ||
| 75 | structures using | ||
| 76 | .Fn CMS_get0_SignerInfo | ||
| 77 | and retrieve the identifier information using CMS. | ||
| 78 | It will then obtain the signer certificate by some unspecified means | ||
| 79 | (or return and error if it cannot be found) and set it using | ||
| 80 | .Fn CMS_SignerInfo_set1_signer_cert . | ||
| 81 | .Pp | ||
| 82 | Once all signer certificates have been set, | ||
| 83 | .Xr CMS_verify 3 | ||
| 84 | can be used. | ||
| 85 | .Pp | ||
| 86 | Although | ||
| 87 | .Fn CMS_get0_SignerInfos | ||
| 88 | can return | ||
| 89 | .Dv NULL | ||
| 90 | if an error occur | ||
| 91 | .Em or | ||
| 92 | if there are no signers, this is not a problem in practice because the | ||
| 93 | only error which can occur is if the | ||
| 94 | .Fa cms | ||
| 95 | structure is not of type signedData due to application error. | ||
| 96 | .Sh RETURN VALUES | ||
| 97 | .Fn CMS_get0_SignerInfos | ||
| 98 | returns all | ||
| 99 | .Vt CMS_SignerInfo | ||
| 100 | structures, or | ||
| 101 | .Dv NULL | ||
| 102 | if there are no signers or an error occurs. | ||
| 103 | .Pp | ||
| 104 | .Fn CMS_SignerInfo_get0_signer_id | ||
| 105 | returns 1 for success and 0 for failure. | ||
| 106 | .Pp | ||
| 107 | .Fn CMS_SignerInfo_cert_cmp | ||
| 108 | returns 0 for a successful comparison and non zero otherwise. | ||
| 109 | .Pp | ||
| 110 | .Fn CMS_SignerInfo_set1_signer_cert | ||
| 111 | does not return a value. | ||
| 112 | .Pp | ||
| 113 | Any error can be obtained from | ||
| 114 | .Xr ERR_get_error 3 . | ||
| 115 | .Sh SEE ALSO | ||
| 116 | .Xr CMS_verify 3 , | ||
| 117 | .Xr ERR_get_error 3 | ||
| 118 | .Sh HISTORY | ||
| 119 | These functions were first was added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_get0_type.3 b/src/lib/libcrypto/man/CMS_get0_type.3 new file mode 100644 index 0000000000..e77dd655e6 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_get0_type.3 | |||
| @@ -0,0 +1,95 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_GET0_TYPE 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_get0_type , | ||
| 6 | .Nm CMS_set1_eContentType , | ||
| 7 | .Nm CMS_get0_eContentType | ||
| 8 | .Nd get and set CMS content types | ||
| 9 | .Sh SYNOPSIS | ||
| 10 | .In openssl/cms.h | ||
| 11 | .Ft const ASN1_OBJECT * | ||
| 12 | .Fo CMS_get0_type | ||
| 13 | .Fa "CMS_ContentInfo *cms" | ||
| 14 | .Fc | ||
| 15 | .Ft int | ||
| 16 | .Fo CMS_set1_eContentType | ||
| 17 | .Fa "CMS_ContentInfo *cms" | ||
| 18 | .Fa "const ASN1_OBJECT *oid" | ||
| 19 | .Fc | ||
| 20 | .Ft const ASN1_OBJECT * | ||
| 21 | .Fo CMS_get0_eContentType | ||
| 22 | .Fa "CMS_ContentInfo *cms" | ||
| 23 | .Fc | ||
| 24 | .Sh DESCRIPTION | ||
| 25 | .Fn CMS_get0_type | ||
| 26 | returns the content type of a | ||
| 27 | .Vt CMS_ContentInfo | ||
| 28 | structure as an | ||
| 29 | .Vt ASN1_OBJECT | ||
| 30 | pointer. | ||
| 31 | An application can then decide how to process the | ||
| 32 | .Vt CMS_ContentInfo | ||
| 33 | structure based on this value. | ||
| 34 | .Pp | ||
| 35 | .Fn CMS_set1_eContentType | ||
| 36 | sets the embedded content type of a | ||
| 37 | .Vt CMS_ContentInfo | ||
| 38 | structure. | ||
| 39 | It should be called with CMS functions with the | ||
| 40 | .Dv CMS_PARTIAL | ||
| 41 | flag and | ||
| 42 | .Em before | ||
| 43 | the structure is finalised, otherwise the results are undefined. | ||
| 44 | .Pp | ||
| 45 | .Fn CMS_get0_eContentType | ||
| 46 | returns a pointer to the embedded content type. | ||
| 47 | .Sh NOTES | ||
| 48 | As the | ||
| 49 | .Sq 0 | ||
| 50 | implies, | ||
| 51 | .Fn CMS_get0_type | ||
| 52 | and | ||
| 53 | .Fn CMS_get0_eContentType | ||
| 54 | return internal pointers which should | ||
| 55 | .Em not | ||
| 56 | be freed up. | ||
| 57 | .Fn CMS_set1_eContentType | ||
| 58 | copies the supplied OID and it | ||
| 59 | .Em should | ||
| 60 | be freed up after use. | ||
| 61 | .Pp | ||
| 62 | The | ||
| 63 | .Vt ASN1_OBJECT | ||
| 64 | values returned can be converted to an integer NID value using | ||
| 65 | .Xr OBJ_obj2nid 3 . | ||
| 66 | For the currently supported content types the following values are | ||
| 67 | returned: | ||
| 68 | .Bd -unfilled -offset indent | ||
| 69 | .Dv NID_pkcs7_data | ||
| 70 | .Dv NID_pkcs7_signed | ||
| 71 | .Dv NID_pkcs7_digest | ||
| 72 | .Dv NID_id_smime_ct_compressedData | ||
| 73 | .Dv NID_pkcs7_encrypted | ||
| 74 | .Dv NID_pkcs7_enveloped | ||
| 75 | .Ed | ||
| 76 | .Sh RETURN VALUES | ||
| 77 | .Fn CMS_get0_type | ||
| 78 | and | ||
| 79 | .Fn CMS_get0_eContentType | ||
| 80 | return an | ||
| 81 | .Vt ASN1_OBJECT | ||
| 82 | structure. | ||
| 83 | .Pp | ||
| 84 | .Fn CMS_set1_eContentType | ||
| 85 | returns 1 for success or 0 if an error occurred. | ||
| 86 | The error can be obtained from | ||
| 87 | .Xr ERR_get_error 3 . | ||
| 88 | .Sh SEE ALSO | ||
| 89 | .Xr ERR_get_error 3 | ||
| 90 | .Sh HISTORY | ||
| 91 | .Fn CMS_get0_type , | ||
| 92 | .Fn CMS_set1_eContentType , | ||
| 93 | and | ||
| 94 | .Fn CMS_get0_eContentType | ||
| 95 | were all first added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 b/src/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 new file mode 100644 index 0000000000..ab19f87fab --- /dev/null +++ b/src/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 | |||
| @@ -0,0 +1,143 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_GET1_RECEIPTREQUEST 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_ReceiptRequest_create0 , | ||
| 6 | .Nm CMS_add1_ReceiptRequest , | ||
| 7 | .Nm CMS_get1_ReceiptRequest , | ||
| 8 | .Nm CMS_ReceiptRequest_get0_values | ||
| 9 | .Nd CMS signed receipt request functions | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/cms.h | ||
| 12 | .Ft CMS_ReceiptRequest * | ||
| 13 | .Fo CMS_ReceiptRequest_create0 | ||
| 14 | .Fa "unsigned char *id" | ||
| 15 | .Fa "int idlen" | ||
| 16 | .Fa "int allorfirst" | ||
| 17 | .Fa "STACK_OF(GENERAL_NAMES) *receiptList" | ||
| 18 | .Fa "STACK_OF(GENERAL_NAMES) *receiptsTo" | ||
| 19 | .Fc | ||
| 20 | .Ft int | ||
| 21 | .Fo CMS_add1_ReceiptRequest | ||
| 22 | .Fa "CMS_SignerInfo *si" | ||
| 23 | .Fa "CMS_ReceiptRequest *rr" | ||
| 24 | .Fc | ||
| 25 | .Ft int | ||
| 26 | .Fo CMS_get1_ReceiptRequest | ||
| 27 | .Fa "CMS_SignerInfo *si" | ||
| 28 | .Fa "CMS_ReceiptRequest **prr" | ||
| 29 | .Fc | ||
| 30 | .Ft void | ||
| 31 | .Fo CMS_ReceiptRequest_get0_values | ||
| 32 | .Fa "CMS_ReceiptRequest *rr" | ||
| 33 | .Fa "ASN1_STRING **pcid" | ||
| 34 | .Fa "int *pallorfirst" | ||
| 35 | .Fa "STACK_OF(GENERAL_NAMES) **plist" | ||
| 36 | .Fa "STACK_OF(GENERAL_NAMES) **prto" | ||
| 37 | .Fc | ||
| 38 | .Sh DESCRIPTION | ||
| 39 | .Fn CMS_ReceiptRequest_create0 | ||
| 40 | creates a signed receipt request structure. | ||
| 41 | The | ||
| 42 | .Sy signedContentIdentifier | ||
| 43 | field is set using | ||
| 44 | .Fa id | ||
| 45 | and | ||
| 46 | .Fa idlen , | ||
| 47 | or it is set to 32 bytes of pseudo random data if | ||
| 48 | .Fa id | ||
| 49 | is | ||
| 50 | .Dv NULL . | ||
| 51 | If | ||
| 52 | .Fa receiptList | ||
| 53 | is | ||
| 54 | .Dv NULL , | ||
| 55 | the | ||
| 56 | .Sy allOrFirstTier | ||
| 57 | option in | ||
| 58 | .Sy receiptsFrom | ||
| 59 | is used and set to the value of the | ||
| 60 | .Fa allorfirst | ||
| 61 | parameter. | ||
| 62 | If | ||
| 63 | .Fa receiptList | ||
| 64 | is not | ||
| 65 | .Dv NULL , | ||
| 66 | the | ||
| 67 | .Sy receiptList | ||
| 68 | option in | ||
| 69 | .Sy receiptsFrom | ||
| 70 | is used. | ||
| 71 | The | ||
| 72 | .Fa receiptsTo | ||
| 73 | parameter specifies the | ||
| 74 | .Sy receiptsTo | ||
| 75 | field value. | ||
| 76 | .Pp | ||
| 77 | The | ||
| 78 | .Fn CMS_add1_ReceiptRequest | ||
| 79 | function adds a signed receipt request | ||
| 80 | .Fa rr | ||
| 81 | to the | ||
| 82 | .Vt CMS_SignerInfo | ||
| 83 | structure | ||
| 84 | .Fa si . | ||
| 85 | .Pp | ||
| 86 | .Fn CMS_get1_ReceiptRequest | ||
| 87 | looks for a signed receipt request in | ||
| 88 | .Fa si . | ||
| 89 | If any is found, it is decoded and written to | ||
| 90 | .Fa prr . | ||
| 91 | .Pp | ||
| 92 | .Fn CMS_ReceiptRequest_get0_values | ||
| 93 | retrieves the values of a receipt request. | ||
| 94 | The signedContentIdentifier is copied to | ||
| 95 | .Fa pcid . | ||
| 96 | If the | ||
| 97 | .Sy allOrFirstTier | ||
| 98 | option of | ||
| 99 | .Sy receiptsFrom | ||
| 100 | is used, its value is copied to | ||
| 101 | .Fa pallorfirst ; | ||
| 102 | otherwise the | ||
| 103 | .Sy receiptList | ||
| 104 | field is copied to | ||
| 105 | .Fa plist . | ||
| 106 | The | ||
| 107 | .Sy receiptsTo | ||
| 108 | parameter is copied to | ||
| 109 | .Fa prto . | ||
| 110 | .Sh NOTES | ||
| 111 | For more details of the meaning of the fields see RFC2634. | ||
| 112 | .Pp | ||
| 113 | The contents of a signed receipt should only be considered meaningful if | ||
| 114 | the corresponding | ||
| 115 | .Vt CMS_ContentInfo | ||
| 116 | structure can be successfully verified using | ||
| 117 | .Xr CMS_verify 3 . | ||
| 118 | .Sh RETURN VALUES | ||
| 119 | .Fn CMS_ReceiptRequest_create0 | ||
| 120 | returns a signed receipt request structure or | ||
| 121 | .Dv NULL | ||
| 122 | if an error occurred. | ||
| 123 | .Pp | ||
| 124 | .Fn CMS_add1_ReceiptRequest | ||
| 125 | returns 1 for success or 0 is an error occurred. | ||
| 126 | .Pp | ||
| 127 | .Fn CMS_get1_ReceiptRequest | ||
| 128 | returns 1 is a signed receipt request is found and decoded. | ||
| 129 | It returns 0 if a signed receipt request is not present and -1 if it is | ||
| 130 | present but malformed. | ||
| 131 | .Sh SEE ALSO | ||
| 132 | .Xr CMS_sign 3 , | ||
| 133 | .Xr CMS_sign_receipt 3 , | ||
| 134 | .Xr CMS_verify 3 , | ||
| 135 | .Xr CMS_verify_receipt 3 , | ||
| 136 | .Xr ERR_get_error 3 | ||
| 137 | .Sh HISTORY | ||
| 138 | .Fn CMS_ReceiptRequest_create0 , | ||
| 139 | .Fn CMS_add1_ReceiptRequest , | ||
| 140 | .Fn CMS_get1_ReceiptRequest , | ||
| 141 | and | ||
| 142 | .Fn CMS_ReceiptRequest_get0_values | ||
| 143 | were added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_sign.3 b/src/lib/libcrypto/man/CMS_sign.3 new file mode 100644 index 0000000000..af75a20d6b --- /dev/null +++ b/src/lib/libcrypto/man/CMS_sign.3 | |||
| @@ -0,0 +1,199 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_SIGN 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_sign | ||
| 6 | .Nd create a CMS SignedData structure | ||
| 7 | .Sh SYNOPSIS | ||
| 8 | .In openssl/cms.h | ||
| 9 | .Ft CMS_ContentInfo * | ||
| 10 | .Fo CMS_sign | ||
| 11 | .Fa "X509 *signcert" | ||
| 12 | .Fa "EVP_PKEY *pkey" | ||
| 13 | .Fa "STACK_OF(X509) *certs" | ||
| 14 | .Fa "BIO *data" | ||
| 15 | .Fa "unsigned int flags" | ||
| 16 | .Fc | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn CMS_sign | ||
| 19 | creates and returns a CMS SignedData structure. | ||
| 20 | .Fa signcert | ||
| 21 | is the certificate to sign with, | ||
| 22 | .Fa pkey | ||
| 23 | is the corresponding private key. | ||
| 24 | .Fa certs | ||
| 25 | is an optional additional set of certificates to include in the CMS | ||
| 26 | structure (for example any intermediate CAs in the chain). | ||
| 27 | Any or all of these parameters can be | ||
| 28 | .Dv NULL , | ||
| 29 | see | ||
| 30 | .Sx NOTES | ||
| 31 | below. | ||
| 32 | .Pp | ||
| 33 | The data to be signed is read from | ||
| 34 | .Fa data . | ||
| 35 | .Pp | ||
| 36 | .Fa flags | ||
| 37 | is an optional set of flags. | ||
| 38 | .Sh NOTES | ||
| 39 | Any of the following flags (OR'ed together) can be passed in the | ||
| 40 | .Fa flags | ||
| 41 | parameter. | ||
| 42 | .Pp | ||
| 43 | Many S/MIME clients expect the signed content to include valid MIME | ||
| 44 | headers. | ||
| 45 | If the | ||
| 46 | .Dv CMS_TEXT | ||
| 47 | flag is set, MIME headers for type | ||
| 48 | .Sy text/plain | ||
| 49 | are prepended to the data. | ||
| 50 | .Pp | ||
| 51 | If | ||
| 52 | .Dv CMS_NOCERTS | ||
| 53 | is set, the signer's certificate will not be included in the | ||
| 54 | .Vt CMS_ContentInfo | ||
| 55 | structure, the signer's certificate must still be supplied in the | ||
| 56 | .Fa signcert | ||
| 57 | parameter though. | ||
| 58 | This can reduce the size of the signature if the signers certificate can | ||
| 59 | be obtained by other means: for example a previously signed message. | ||
| 60 | .Pp | ||
| 61 | The data being signed is included in the | ||
| 62 | .Vt CMS_ContentInfo | ||
| 63 | structure, unless | ||
| 64 | .Dv CMS_DETACHED | ||
| 65 | is set, in which case it is omitted. | ||
| 66 | This is used for | ||
| 67 | .Vt CMS_ContentInfo | ||
| 68 | detached signatures which are used in S/MIME plaintext signed | ||
| 69 | messages for example. | ||
| 70 | .Pp | ||
| 71 | Normally the supplied content is translated into MIME canonical format | ||
| 72 | (as required by the S/MIME specifications); if | ||
| 73 | .Dv CMS_BINARY | ||
| 74 | is set, no translation occurs. | ||
| 75 | This option should be used if the supplied data is in binary format; | ||
| 76 | otherwise the translation will corrupt it. | ||
| 77 | .Pp | ||
| 78 | The SignedData structure includes several CMS signedAttributes including | ||
| 79 | the signing time, the CMS content type and the supported list of ciphers | ||
| 80 | in an SMIMECapabilities attribute. | ||
| 81 | If | ||
| 82 | .Dv CMS_NOATTR | ||
| 83 | is set, then no signedAttributes will be used. | ||
| 84 | If | ||
| 85 | .Dv CMS_NOSMIMECAP | ||
| 86 | is set, then just the SMIMECapabilities are omitted. | ||
| 87 | .Pp | ||
| 88 | If present, the SMIMECapabilities attribute indicates support for the | ||
| 89 | following algorithms in preference order: 256 bit AES, Gost R3411-94, | ||
| 90 | Gost 28147-89, 192 bit AES, 128 bit AES, triple DES, 128 bit RC2, 64 bit | ||
| 91 | RC2, DES and 40 bit RC2. | ||
| 92 | If any of these algorithms is not available, then it will not be | ||
| 93 | included: for example the GOST algorithms will not be included if | ||
| 94 | the GOST ENGINE is not loaded. | ||
| 95 | .Pp | ||
| 96 | OpenSSL will by default identify signing certificates using issuer name | ||
| 97 | and serial number. | ||
| 98 | If | ||
| 99 | .Dv CMS_USE_KEYID | ||
| 100 | is set, it will use the subject key identifier value instead. | ||
| 101 | An error occurs if the signing certificate does not have a subject key | ||
| 102 | identifier extension. | ||
| 103 | .Pp | ||
| 104 | If the flag | ||
| 105 | .Dv CMS_STREAM | ||
| 106 | is set, then the returned | ||
| 107 | .Vt CMS_ContentInfo | ||
| 108 | structure is just initialized ready to perform the signing operation. | ||
| 109 | The signing is however | ||
| 110 | .Em not | ||
| 111 | performed and the data to be signed is not read from the | ||
| 112 | .Fa data | ||
| 113 | parameter. | ||
| 114 | Signing is deferred until after the data has been written. | ||
| 115 | In this way, data can be signed in a single pass. | ||
| 116 | .Pp | ||
| 117 | If the | ||
| 118 | .Dv CMS_PARTIAL | ||
| 119 | flag is set, a partial | ||
| 120 | .Vt CMS_ContentInfo | ||
| 121 | structure is output to which additional signers and capabilities can be | ||
| 122 | added before finalization. | ||
| 123 | .Pp | ||
| 124 | If the flag | ||
| 125 | .Dv CMS_STREAM | ||
| 126 | is set, the returned | ||
| 127 | .Vt CMS_ContentInfo | ||
| 128 | structure is | ||
| 129 | .Em not | ||
| 130 | complete and outputting its contents via a function that does not | ||
| 131 | properly finalize the | ||
| 132 | .Vt CMS_ContentInfo | ||
| 133 | structure will give unpredictable results. | ||
| 134 | .Pp | ||
| 135 | Several functions including | ||
| 136 | .Xr SMIME_write_CMS 3 , | ||
| 137 | .Xr i2d_CMS_bio_stream 3 , | ||
| 138 | .Xr PEM_write_bio_CMS_stream 3 | ||
| 139 | finalize the structure. | ||
| 140 | Alternatively finalization can be performed by obtaining the streaming | ||
| 141 | ASN1 | ||
| 142 | .Vt BIO | ||
| 143 | directly using | ||
| 144 | .Xr BIO_new_CMS 3 . | ||
| 145 | .Pp | ||
| 146 | If a signer is specified, it will use the default digest for the signing | ||
| 147 | algorithm. | ||
| 148 | This is SHA1 for both RSA and DSA keys. | ||
| 149 | .Pp | ||
| 150 | If | ||
| 151 | .Fa signcert | ||
| 152 | and | ||
| 153 | .Fa pkey | ||
| 154 | are | ||
| 155 | .Dv NULL , | ||
| 156 | then a certificates only CMS structure is output. | ||
| 157 | .Pp | ||
| 158 | The function | ||
| 159 | .Fn CMS_sign | ||
| 160 | is a basic CMS signing function whose output will be suitable for many | ||
| 161 | purposes. | ||
| 162 | For finer control of the output format the | ||
| 163 | .Fa certs , | ||
| 164 | .Fa signcert | ||
| 165 | and | ||
| 166 | .Fa pkey | ||
| 167 | parameters can all be | ||
| 168 | .Dv NULL | ||
| 169 | and the | ||
| 170 | .Dv CMS_PARTIAL | ||
| 171 | flag set. | ||
| 172 | Then one or more signers can be added using the function | ||
| 173 | .Xr CMS_sign_add1_signer 3 , | ||
| 174 | non default digests can be used and custom attributes added. | ||
| 175 | .Xr CMS_final 3 | ||
| 176 | must then be called to finalize the structure if streaming is not | ||
| 177 | enabled. | ||
| 178 | .Sh RETURN VALUES | ||
| 179 | .Fn CMS_sign | ||
| 180 | returns either a valid | ||
| 181 | .Vt CMS_ContentInfo | ||
| 182 | structure or | ||
| 183 | .Dv NULL | ||
| 184 | if an error occurred. | ||
| 185 | The error can be obtained from | ||
| 186 | .Xr ERR_get_error 3 . | ||
| 187 | .Sh SEE ALSO | ||
| 188 | .Xr CMS_verify 3 , | ||
| 189 | .Xr ERR_get_error 3 | ||
| 190 | .Sh HISTORY | ||
| 191 | .Fn CMS_sign | ||
| 192 | was added to OpenSSL 0.9.8. | ||
| 193 | .Pp | ||
| 194 | The | ||
| 195 | .Dv CMS_STREAM | ||
| 196 | flag is only supported for detached data in OpenSSL 0.9.8. | ||
| 197 | It is supported for embedded data in OpenSSL 1.0.0 and later. | ||
| 198 | .Sh BUGS | ||
| 199 | Some attributes such as counter signatures are not supported. | ||
diff --git a/src/lib/libcrypto/man/CMS_sign_receipt.3 b/src/lib/libcrypto/man/CMS_sign_receipt.3 new file mode 100644 index 0000000000..de7a8c0e10 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_sign_receipt.3 | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_SIGN_RECEIPT 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_sign_receipt | ||
| 6 | .Nd create a CMS signed receipt | ||
| 7 | .Sh SYNOPSIS | ||
| 8 | .In openssl/cms.h | ||
| 9 | .Ft CMS_ContentInfo * | ||
| 10 | .Fo CMS_sign_receipt | ||
| 11 | .Fa "CMS_SignerInfo *si" | ||
| 12 | .Fa "X509 *signcert" | ||
| 13 | .Fa "EVP_PKEY *pkey" | ||
| 14 | .Fa "STACK_OF(X509) *certs" | ||
| 15 | .Fa "unsigned int flags" | ||
| 16 | .Fc | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn CMS_sign_receipt | ||
| 19 | creates and returns a CMS signed receipt structure. | ||
| 20 | .Fa si | ||
| 21 | is the | ||
| 22 | .Vt CMS_SignerInfo | ||
| 23 | structure containing the signed receipt request. | ||
| 24 | .Fa signcert | ||
| 25 | is the certificate to sign with, | ||
| 26 | .Fa pkey | ||
| 27 | is the corresponding private key. | ||
| 28 | .Fa certs | ||
| 29 | is an optional additional set of certificates to include in the CMS | ||
| 30 | structure (for example any intermediate CAs in the chain). | ||
| 31 | .Pp | ||
| 32 | .Fa flags | ||
| 33 | is an optional set of flags. | ||
| 34 | .Sh NOTES | ||
| 35 | This functions behaves in a similar way to | ||
| 36 | .Xr CMS_sign 3 | ||
| 37 | except the flag values | ||
| 38 | .Dv CMS_DETACHED , | ||
| 39 | .Dv CMS_BINARY , | ||
| 40 | .Dv CMS_NOATTR , | ||
| 41 | .Dv CMS_TEXT , | ||
| 42 | and | ||
| 43 | .Dv CMS_STREAM | ||
| 44 | are not supported, since they do not make sense in the context of | ||
| 45 | signed receipts. | ||
| 46 | .Sh RETURN VALUES | ||
| 47 | .Fn CMS_sign_receipt | ||
| 48 | returns either a valid | ||
| 49 | .Vt CMS_ContentInfo | ||
| 50 | structure or | ||
| 51 | .Dv NULL | ||
| 52 | if an error occurred. | ||
| 53 | The error can be obtained from | ||
| 54 | .Xr ERR_get_error 3 . | ||
| 55 | .Sh SEE ALSO | ||
| 56 | .Xr CMS_sign 3 , | ||
| 57 | .Xr CMS_verify_receipt 3 , | ||
| 58 | .Xr ERR_get_error 3 | ||
| 59 | .Sh HISTORY | ||
| 60 | .Fn CMS_sign_receipt | ||
| 61 | was added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/CMS_uncompress.3 b/src/lib/libcrypto/man/CMS_uncompress.3 new file mode 100644 index 0000000000..c651f24de2 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_uncompress.3 | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_UNCOMPRESS 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_uncompress | ||
| 6 | .Nd uncompress a CMS CompressedData structure | ||
| 7 | .Sh SYNOPSIS | ||
| 8 | .In openssl/cms.h | ||
| 9 | .Ft int | ||
| 10 | .Fo CMS_uncompress | ||
| 11 | .Fa "CMS_ContentInfo *cms" | ||
| 12 | .Fa "BIO *dcont" | ||
| 13 | .Fa "BIO *out" | ||
| 14 | .Fa "unsigned int flags" | ||
| 15 | .Fc | ||
| 16 | .Sh DESCRIPTION | ||
| 17 | .Fn CMS_uncompress | ||
| 18 | extracts and uncompresses the content from a CMS CompressedData | ||
| 19 | structure | ||
| 20 | .Fa cms . | ||
| 21 | .Fa data | ||
| 22 | is a | ||
| 23 | .Vt BIO | ||
| 24 | to write the content to and | ||
| 25 | .Fa flags | ||
| 26 | is an optional set of flags. | ||
| 27 | .Pp | ||
| 28 | The | ||
| 29 | .Fa dcont | ||
| 30 | parameter is used in the rare case where the compressed content is | ||
| 31 | detached. | ||
| 32 | It will normally be set to | ||
| 33 | .Dv NULL . | ||
| 34 | .Sh NOTES | ||
| 35 | The only currently supported compression algorithm is zlib: if the | ||
| 36 | structure indicates the use of any other algorithm, an error is returned. | ||
| 37 | .Pp | ||
| 38 | If zlib support is not compiled into OpenSSL, then | ||
| 39 | .Fn CMS_uncompress | ||
| 40 | will always return an error. | ||
| 41 | .Pp | ||
| 42 | The following flags can be passed in the | ||
| 43 | .Fa flags | ||
| 44 | parameter: | ||
| 45 | .Pp | ||
| 46 | If the | ||
| 47 | .Dv CMS_TEXT | ||
| 48 | flag is set, MIME headers for type | ||
| 49 | .Sy text/plain | ||
| 50 | are deleted from the content. | ||
| 51 | If the content is not of type | ||
| 52 | .Sy text/plain , | ||
| 53 | then an error is returned. | ||
| 54 | .Sh RETURN VALUES | ||
| 55 | .Fn CMS_uncompress | ||
| 56 | returns either 1 for success or 0 for failure. | ||
| 57 | The error can be obtained from | ||
| 58 | .Xr ERR_get_error 3 . | ||
| 59 | .Sh SEE ALSO | ||
| 60 | .Xr CMS_compress 3 , | ||
| 61 | .Xr ERR_get_error 3 | ||
| 62 | .Sh HISTORY | ||
| 63 | .Fn CMS_uncompress | ||
| 64 | was added to OpenSSL 0.9.8. | ||
| 65 | .Sh BUGS | ||
| 66 | The lack of single pass processing and the need to hold all data in | ||
| 67 | memory as mentioned in | ||
| 68 | .Xr CMS_verify 3 | ||
| 69 | also applies to | ||
| 70 | .Xr CMS_decompress 3 . | ||
diff --git a/src/lib/libcrypto/man/CMS_verify.3 b/src/lib/libcrypto/man/CMS_verify.3 new file mode 100644 index 0000000000..0ab1baf6b3 --- /dev/null +++ b/src/lib/libcrypto/man/CMS_verify.3 | |||
| @@ -0,0 +1,188 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_VERIFY 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_verify , | ||
| 6 | .Nm CMS_get0_signers | ||
| 7 | .Nd verify a CMS SignedData structure | ||
| 8 | .Sh SYNOPSIS | ||
| 9 | .In openssl/cms.h | ||
| 10 | .Ft int | ||
| 11 | .Fo CMS_verify | ||
| 12 | .Fa "CMS_ContentInfo *cms" | ||
| 13 | .Fa "STACK_OF(X509) *certs" | ||
| 14 | .Fa "X509_STORE *store" | ||
| 15 | .Fa "BIO *indata" | ||
| 16 | .Fa "BIO *out" | ||
| 17 | .Fa "unsigned int flags" | ||
| 18 | .Fc | ||
| 19 | .Ft STACK_OF(X509) * | ||
| 20 | .Fo CMS_get0_signers | ||
| 21 | .Fa "CMS_ContentInfo *cms" | ||
| 22 | .Fc | ||
| 23 | .Sh DESCRIPTION | ||
| 24 | .Fn CMS_verify | ||
| 25 | verifies a CMS SignedData structure. | ||
| 26 | .Fa cms | ||
| 27 | is the | ||
| 28 | .Vt CMS_ContentInfo | ||
| 29 | structure to verify. | ||
| 30 | .Fa certs | ||
| 31 | is a set of certificates in which to search for the signing | ||
| 32 | certificate(s). | ||
| 33 | .Fa store | ||
| 34 | is a trusted certificate store used for chain verification. | ||
| 35 | .Fa indata | ||
| 36 | is the detached content if the content is not present in | ||
| 37 | .Fa cms . | ||
| 38 | The content is written to | ||
| 39 | .Fa out | ||
| 40 | if it is not | ||
| 41 | .Dv NULL . | ||
| 42 | .Pp | ||
| 43 | .Fa flags | ||
| 44 | is an optional set of flags, which can be used to modify the verify | ||
| 45 | operation. | ||
| 46 | .Pp | ||
| 47 | .Fn CMS_get0_signers | ||
| 48 | retrieves the signing certificate(s) from | ||
| 49 | .Fa cms , | ||
| 50 | it must be called after a successful | ||
| 51 | .Fn CMS_verify | ||
| 52 | operation. | ||
| 53 | .Sh VERIFY PROCESS | ||
| 54 | Normally the verify process proceeds as follows. | ||
| 55 | .Pp | ||
| 56 | Initially some sanity checks are performed on | ||
| 57 | .Fa cms . | ||
| 58 | The type of | ||
| 59 | .Fa cms | ||
| 60 | must be SignedData. | ||
| 61 | There must be at least one signature on the data and if the content is | ||
| 62 | detached | ||
| 63 | .Fa indata | ||
| 64 | cannot be | ||
| 65 | .Dv NULL . | ||
| 66 | .Pp | ||
| 67 | An attempt is made to locate all the signing certificate(s), first | ||
| 68 | looking in the | ||
| 69 | .Fa certs | ||
| 70 | parameter (if it is not | ||
| 71 | .Dv NULL ) | ||
| 72 | and then looking in any certificates contained in the | ||
| 73 | .Fa cms | ||
| 74 | structure itself. | ||
| 75 | If no signing certificate can be located, the operation fails. | ||
| 76 | .Pp | ||
| 77 | Each signing certificate is chain verified using the | ||
| 78 | .Sy smimesign | ||
| 79 | purpose and the supplied trusted certificate store. | ||
| 80 | Any internal certificates in the message are used as untrusted CAs. | ||
| 81 | If CRL checking is enabled in | ||
| 82 | .Fa store , | ||
| 83 | any internal CRLs are used in addition to attempting to look them up in | ||
| 84 | .Fa store . | ||
| 85 | If any chain verify fails, an error code is returned. | ||
| 86 | .Pp | ||
| 87 | Finally the signed content is read (and written to | ||
| 88 | .Fa out | ||
| 89 | is it is not | ||
| 90 | .Dv NULL ) | ||
| 91 | and the signature is checked. | ||
| 92 | .Pp | ||
| 93 | If all signatures verify correctly, then the function is successful. | ||
| 94 | .Pp | ||
| 95 | Any of the following flags (OR'ed together) can be passed in the | ||
| 96 | .Fa flags | ||
| 97 | parameter to change the default verify behaviour. | ||
| 98 | .Pp | ||
| 99 | If | ||
| 100 | .Dv CMS_NOINTERN | ||
| 101 | is set, the certificates in the message itself are not searched when | ||
| 102 | locating the signing certificate(s). | ||
| 103 | This means that all the signing certificates must be in the | ||
| 104 | .Fa certs | ||
| 105 | parameter. | ||
| 106 | .Pp | ||
| 107 | If | ||
| 108 | .Dv CMS_NOCRL | ||
| 109 | is set, and CRL checking is enabled in | ||
| 110 | .Fa store , | ||
| 111 | then any CRLs in the message itself are ignored. | ||
| 112 | .Pp | ||
| 113 | If the | ||
| 114 | .Dv CMS_TEXT | ||
| 115 | flag is set, MIME headers for type | ||
| 116 | .Sy text/plain | ||
| 117 | are deleted from the content. | ||
| 118 | If the content is not of type | ||
| 119 | .Sy text/plain , | ||
| 120 | then an error is returned. | ||
| 121 | .Pp | ||
| 122 | If | ||
| 123 | .Dv CMS_NO_SIGNER_CERT_VERIFY | ||
| 124 | is set, the signing certificates are not verified. | ||
| 125 | .Pp | ||
| 126 | If | ||
| 127 | .Dv CMS_NO_ATTR_VERIFY | ||
| 128 | is set, the signed attributes signature is not verified. | ||
| 129 | .Pp | ||
| 130 | If | ||
| 131 | .Dv CMS_NO_CONTENT_VERIFY | ||
| 132 | is set, then the content digest is not checked. | ||
| 133 | .Sh NOTES | ||
| 134 | One application of | ||
| 135 | .Dv CMS_NOINTERN | ||
| 136 | is to only accept messages signed by a small number of certificates. | ||
| 137 | The acceptable certificates would be passed in the | ||
| 138 | .Fa certs | ||
| 139 | parameter. | ||
| 140 | In this case, if the signer is not one of the certificates supplied in | ||
| 141 | .Fa certs , | ||
| 142 | then the verify will fail because the signer cannot be found. | ||
| 143 | .Pp | ||
| 144 | In some cases the standard techniques for looking up and validating | ||
| 145 | certificates are not appropriate: for example an application may wish to | ||
| 146 | lookup certificates in a database or perform customised verification. | ||
| 147 | This can be achieved by setting and verifying the signers certificates | ||
| 148 | manually using the signed data utility functions. | ||
| 149 | .Pp | ||
| 150 | Care should be taken when modifying the default verify behaviour, for | ||
| 151 | example setting | ||
| 152 | .Dv CMS_NO_CONTENT_VERIFY | ||
| 153 | will totally disable all content verification and any modified content | ||
| 154 | will be considered valid. | ||
| 155 | This combination is however useful if one merely wishes to write the | ||
| 156 | content to | ||
| 157 | .Fa out | ||
| 158 | and its validity is not considered important. | ||
| 159 | .Pp | ||
| 160 | Chain verification should arguably be performed using the signing time | ||
| 161 | rather than the current time. | ||
| 162 | However since the signing time is supplied by the signer it cannot be | ||
| 163 | trusted without additional evidence (such as a trusted timestamp). | ||
| 164 | .Sh RETURN VALUES | ||
| 165 | .Fn CMS_verify | ||
| 166 | returns 1 for a successful verification and zero if an error occurred. | ||
| 167 | .Pp | ||
| 168 | .Fn CMS_get0_signers | ||
| 169 | returns all signers or | ||
| 170 | .Dv NULL | ||
| 171 | if an error occurred. | ||
| 172 | .Pp | ||
| 173 | The error can be obtained from | ||
| 174 | .Xr ERR_get_error 3 . | ||
| 175 | .Sh SEE ALSO | ||
| 176 | .Xr CMS_sign 3 , | ||
| 177 | .Xr ERR_get_error 3 | ||
| 178 | .Sh HISTORY | ||
| 179 | .Fn CMS_verify | ||
| 180 | was added to OpenSSL 0.9.8. | ||
| 181 | .Sh BUGS | ||
| 182 | The trusted certificate store is not searched for the signing | ||
| 183 | certificate, this is primarily due to the inadequacies of the current | ||
| 184 | .Vt X509_STORE | ||
| 185 | functionality. | ||
| 186 | .Pp | ||
| 187 | The lack of single pass processing means that the signed content must | ||
| 188 | all be held in memory if it is not detached. | ||
diff --git a/src/lib/libcrypto/man/CMS_verify_receipt.3 b/src/lib/libcrypto/man/CMS_verify_receipt.3 new file mode 100644 index 0000000000..0977f267bc --- /dev/null +++ b/src/lib/libcrypto/man/CMS_verify_receipt.3 | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | .Dd $Mdocdate: November 11 2015 $ | ||
| 2 | .Dt CMS_VERIFY_RECEIPT 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm CMS_verify_receipt | ||
| 6 | .Nd verify a CMS signed receipt | ||
| 7 | .Sh SYNOPSIS | ||
| 8 | .In openssl/cms.h | ||
| 9 | .Ft int | ||
| 10 | .Fo CMS_verify_receipt | ||
| 11 | .Fa "CMS_ContentInfo *rcms" | ||
| 12 | .Fa "CMS_ContentInfo *ocms" | ||
| 13 | .Fa "STACK_OF(X509) *certs" | ||
| 14 | .Fa "X509_STORE *store" | ||
| 15 | .Fa "unsigned int flags" | ||
| 16 | .Fc | ||
| 17 | .Sh DESCRIPTION | ||
| 18 | .Fn CMS_verify_receipt | ||
| 19 | verifies a CMS signed receipt. | ||
| 20 | .Fa rcms | ||
| 21 | is the signed receipt to verify. | ||
| 22 | .Fa ocms | ||
| 23 | is the original SignedData structure containing the receipt request. | ||
| 24 | .Fa certs | ||
| 25 | is a set of certificates in which to search for the signing certificate. | ||
| 26 | .Fa store | ||
| 27 | is a trusted certificate store (used for chain verification). | ||
| 28 | .Pp | ||
| 29 | .Fa flags | ||
| 30 | is an optional set of flags, which can be used to modify the verify | ||
| 31 | operation. | ||
| 32 | .Sh NOTES | ||
| 33 | This functions behaves in a similar way to | ||
| 34 | .Xr CMS_verify 3 | ||
| 35 | except the flag values | ||
| 36 | .Dv CMS_DETACHED , | ||
| 37 | .Dv CMS_BINARY , | ||
| 38 | .Dv CMS_TEXT , | ||
| 39 | and | ||
| 40 | .Dv CMS_STREAM | ||
| 41 | are not supported since they do not make sense in the context of signed | ||
| 42 | receipts. | ||
| 43 | .Sh RETURN VALUES | ||
| 44 | .Fn CMS_verify_receipt | ||
| 45 | returns 1 for a successful verification and zero if an error occurred. | ||
| 46 | .Pp | ||
| 47 | The error can be obtained from | ||
| 48 | .Xr ERR_get_error 3 . | ||
| 49 | .Sh SEE ALSO | ||
| 50 | .Xr CMS_sign_receipt 3 , | ||
| 51 | .Xr CMS_verify 3 , | ||
| 52 | .Xr ERR_get_error 3 | ||
| 53 | .Sh HISTORY | ||
| 54 | .Fn CMS_verify_receipt | ||
| 55 | was added to OpenSSL 0.9.8. | ||
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index d896f436bc..2c5ffbb8e4 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.25 2015/10/14 07:41:28 reyk Exp $ | 1 | # $OpenBSD: Makefile,v 1.26 2015/11/11 18:36:48 schwarze Exp $ |
| 2 | 2 | ||
| 3 | .include <bsd.own.mk> # for NOMAN | 3 | .include <bsd.own.mk> # for NOMAN |
| 4 | 4 | ||
| @@ -21,6 +21,7 @@ MAN= \ | |||
| 21 | BIO_f_null.3 \ | 21 | BIO_f_null.3 \ |
| 22 | BIO_find_type.3 \ | 22 | BIO_find_type.3 \ |
| 23 | BIO_new.3 \ | 23 | BIO_new.3 \ |
| 24 | BIO_new_CMS.3 \ | ||
| 24 | BIO_push.3 \ | 25 | BIO_push.3 \ |
| 25 | BIO_read.3 \ | 26 | BIO_read.3 \ |
| 26 | BIO_s_accept.3 \ | 27 | BIO_s_accept.3 \ |
| @@ -52,6 +53,22 @@ MAN= \ | |||
| 52 | BN_swap.3 \ | 53 | BN_swap.3 \ |
| 53 | BN_zero.3 \ | 54 | BN_zero.3 \ |
| 54 | BUF_MEM_new.3 \ | 55 | BUF_MEM_new.3 \ |
| 56 | CMS_add0_cert.3 \ | ||
| 57 | CMS_add1_recipient_cert.3 \ | ||
| 58 | CMS_add1_signer.3 \ | ||
| 59 | CMS_compress.3 \ | ||
| 60 | CMS_decrypt.3 \ | ||
| 61 | CMS_encrypt.3 \ | ||
| 62 | CMS_final.3 \ | ||
| 63 | CMS_get0_RecipientInfos.3 \ | ||
| 64 | CMS_get0_SignerInfos.3 \ | ||
| 65 | CMS_get0_type.3 \ | ||
| 66 | CMS_get1_ReceiptRequest.3 \ | ||
| 67 | CMS_sign.3 \ | ||
| 68 | CMS_sign_receipt.3 \ | ||
| 69 | CMS_uncompress.3 \ | ||
| 70 | CMS_verify.3 \ | ||
| 71 | CMS_verify_receipt.3 \ | ||
| 55 | EVP_AEAD_CTX_init.3 \ | 72 | EVP_AEAD_CTX_init.3 \ |
| 56 | 73 | ||
| 57 | GENMAN= \ | 74 | GENMAN= \ |
| @@ -200,24 +217,7 @@ GENMAN= \ | |||
| 200 | 217 | ||
| 201 | MAN+= ${GENMAN} | 218 | MAN+= ${GENMAN} |
| 202 | 219 | ||
| 203 | #MAN+= BIO_new_CMS.3 \ | 220 | #MAM+= PEM_write_bio_CMS_stream.3 \ |
| 204 | # CMS_add0_cert.3 \ | ||
| 205 | # CMS_add1_recipient_cert.3 \ | ||
| 206 | # CMS_compress.3 \ | ||
| 207 | # CMS_decrypt.3 \ | ||
| 208 | # CMS_encrypt.3 \ | ||
| 209 | # CMS_final.3 \ | ||
| 210 | # CMS_get0_RecipientInfos.3 \ | ||
| 211 | # CMS_get0_SignerInfos.3 \ | ||
| 212 | # CMS_get0_type.3 \ | ||
| 213 | # CMS_get1_ReceiptRequest.3 \ | ||
| 214 | # CMS_sign.3 \ | ||
| 215 | # CMS_sign_add1_signer.3 \ | ||
| 216 | # CMS_sign_receipt.3 \ | ||
| 217 | # CMS_uncompress.3 \ | ||
| 218 | # CMS_verify.3 \ | ||
| 219 | # CMS_verify_receipt.3 \ | ||
| 220 | # PEM_write_bio_CMS_stream.3 \ | ||
| 221 | # SMIME_read_CMS.3 \ | 221 | # SMIME_read_CMS.3 \ |
| 222 | # SMIME_write_CMS.3 \ | 222 | # SMIME_write_CMS.3 \ |
| 223 | # i2d_CMS_bio_stream.3 \ | 223 | # i2d_CMS_bio_stream.3 \ |
diff --git a/src/lib/libssl/src/doc/crypto/CMS_add0_cert.pod b/src/lib/libssl/src/doc/crypto/CMS_add0_cert.pod deleted file mode 100644 index b289237ec2..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_add0_cert.pod +++ /dev/null | |||
| @@ -1,67 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_add0_cert, CMS_add1_cert, CMS_get1_certs, CMS_add0_crl, CMS_add1_crl, | ||
| 6 | CMS_get1_crls - CMS certificate and CRL utility functions | ||
| 7 | |||
| 8 | =head1 SYNOPSIS | ||
| 9 | |||
| 10 | #include <openssl/cms.h> | ||
| 11 | |||
| 12 | int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert); | ||
| 13 | int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert); | ||
| 14 | STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms); | ||
| 15 | |||
| 16 | int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl); | ||
| 17 | int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl); | ||
| 18 | STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); | ||
| 19 | |||
| 20 | |||
| 21 | =head1 DESCRIPTION | ||
| 22 | |||
| 23 | CMS_add0_cert() and CMS_add1_cert() add certificate B<cert> to B<cms>. | ||
| 24 | must be of type signed data or enveloped data. | ||
| 25 | |||
| 26 | CMS_get1_certs() returns all certificates in B<cms>. | ||
| 27 | |||
| 28 | CMS_add0_crl() and CMS_add1_crl() add CRL B<crl> to B<cms>. CMS_get1_crls() | ||
| 29 | returns any CRLs in B<cms>. | ||
| 30 | |||
| 31 | =head1 NOTES | ||
| 32 | |||
| 33 | The CMS_ContentInfo structure B<cms> must be of type signed data or enveloped | ||
| 34 | data or an error will be returned. | ||
| 35 | |||
| 36 | For signed data certificates and CRLs are added to the B<certificates> and | ||
| 37 | B<crls> fields of SignedData structure. For enveloped data they are added to | ||
| 38 | B<OriginatorInfo>. | ||
| 39 | |||
| 40 | As the B<0> implies CMS_add0_cert() adds B<cert> internally to B<cms> and it | ||
| 41 | must not be freed up after the call as opposed to CMS_add1_cert() where B<cert> | ||
| 42 | must be freed up. | ||
| 43 | |||
| 44 | The same certificate or CRL must not be added to the same cms structure more | ||
| 45 | than once. | ||
| 46 | |||
| 47 | =head1 RETURN VALUES | ||
| 48 | |||
| 49 | CMS_add0_cert(), CMS_add1_cert() and CMS_add0_crl() and CMS_add1_crl() return | ||
| 50 | 1 for success and 0 for failure. | ||
| 51 | |||
| 52 | CMS_get1_certs() and CMS_get1_crls() return the STACK of certificates or CRLs | ||
| 53 | or NULL if there are none or an error occurs. The only error which will occur | ||
| 54 | in practice is if the B<cms> type is invalid. | ||
| 55 | |||
| 56 | =head1 SEE ALSO | ||
| 57 | |||
| 58 | L<ERR_get_error(3)|ERR_get_error(3)>, | ||
| 59 | L<CMS_sign(3)|CMS_sign(3)>, | ||
| 60 | L<CMS_encrypt(3)|CMS_encrypt(3)> | ||
| 61 | |||
| 62 | =head1 HISTORY | ||
| 63 | |||
| 64 | CMS_add0_cert(), CMS_add1_cert(), CMS_get1_certs(), CMS_add0_crl() | ||
| 65 | and CMS_get1_crls() were all first added to OpenSSL 0.9.8 | ||
| 66 | |||
| 67 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_add1_recipient_cert.pod b/src/lib/libssl/src/doc/crypto/CMS_add1_recipient_cert.pod deleted file mode 100644 index 8a39391aa4..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_add1_recipient_cert.pod +++ /dev/null | |||
| @@ -1,63 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_add1_recipient_cert, CMS_add0_recipient_key - add recipients to a CMS | ||
| 6 | enveloped data structure | ||
| 7 | |||
| 8 | =head1 SYNOPSIS | ||
| 9 | |||
| 10 | #include <openssl/cms.h> | ||
| 11 | |||
| 12 | CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, X509 *recip, unsigned int flags); | ||
| 13 | |||
| 14 | CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid, unsigned char *key, size_t keylen, unsigned char *id, size_t idlen, ASN1_GENERALIZEDTIME *date, ASN1_OBJECT *otherTypeId, ASN1_TYPE *otherType); | ||
| 15 | |||
| 16 | =head1 DESCRIPTION | ||
| 17 | |||
| 18 | CMS_add1_recipient_cert() adds recipient B<recip> to CMS_ContentInfo enveloped | ||
| 19 | data structure B<cms> as a KeyTransRecipientInfo structure. | ||
| 20 | |||
| 21 | CMS_add0_recipient_key() adds symmetric key B<key> of length B<keylen> using | ||
| 22 | wrapping algorithm B<nid>, identifier B<id> of length B<idlen> and optional | ||
| 23 | values B<date>, B<otherTypeId> and B<otherType> to CMS_ContentInfo enveloped | ||
| 24 | data structure B<cms> as a KEKRecipientInfo structure. | ||
| 25 | |||
| 26 | The CMS_ContentInfo structure should be obtained from an initial call to | ||
| 27 | CMS_encrypt() with the flag B<CMS_PARTIAL> set. | ||
| 28 | |||
| 29 | =head1 NOTES | ||
| 30 | |||
| 31 | The main purpose of this function is to provide finer control over a CMS | ||
| 32 | enveloped data structure where the simpler CMS_encrypt() function defaults are | ||
| 33 | not appropriate. For example if one or more KEKRecipientInfo structures | ||
| 34 | need to be added. New attributes can also be added using the returned | ||
| 35 | CMS_RecipientInfo structure and the CMS attribute utility functions. | ||
| 36 | |||
| 37 | OpenSSL will by default identify recipient certificates using issuer name | ||
| 38 | and serial number. If B<CMS_USE_KEYID> is set it will use the subject key | ||
| 39 | identifier value instead. An error occurs if all recipient certificates do not | ||
| 40 | have a subject key identifier extension. | ||
| 41 | |||
| 42 | Currently only AES based key wrapping algorithms are supported for B<nid>, | ||
| 43 | specifically: NID_id_aes128_wrap, NID_id_aes192_wrap and NID_id_aes256_wrap. | ||
| 44 | If B<nid> is set to B<NID_undef> then an AES wrap algorithm will be used | ||
| 45 | consistent with B<keylen>. | ||
| 46 | |||
| 47 | =head1 RETURN VALUES | ||
| 48 | |||
| 49 | CMS_add1_recipient_cert() and CMS_add0_recipient_key() return an internal | ||
| 50 | pointer to the CMS_RecipientInfo structure just added or NULL if an error | ||
| 51 | occurs. | ||
| 52 | |||
| 53 | =head1 SEE ALSO | ||
| 54 | |||
| 55 | L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_decrypt(3)|CMS_decrypt(3)>, | ||
| 56 | L<CMS_final(3)|CMS_final(3)>, | ||
| 57 | |||
| 58 | =head1 HISTORY | ||
| 59 | |||
| 60 | CMS_add1_recipient_cert() and CMS_add0_recipient_key() were added to OpenSSL | ||
| 61 | 0.9.8 | ||
| 62 | |||
| 63 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_compress.pod b/src/lib/libssl/src/doc/crypto/CMS_compress.pod deleted file mode 100644 index 0a0715271d..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_compress.pod +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_compress - create a CMS CompressedData structure | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | #include <openssl/cms.h> | ||
| 10 | |||
| 11 | CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags); | ||
| 12 | |||
| 13 | =head1 DESCRIPTION | ||
| 14 | |||
| 15 | CMS_compress() creates and returns a CMS CompressedData structure. B<comp_nid> | ||
| 16 | is the compression algorithm to use or B<NID_undef> to use the default | ||
| 17 | algorithm (zlib compression). B<in> is the content to be compressed. | ||
| 18 | B<flags> is an optional set of flags. | ||
| 19 | |||
| 20 | =head1 NOTES | ||
| 21 | |||
| 22 | The only currently supported compression algorithm is zlib using the NID | ||
| 23 | NID_zlib_compression. | ||
| 24 | |||
| 25 | If zlib support is not compiled into OpenSSL then CMS_compress() will return | ||
| 26 | an error. | ||
| 27 | |||
| 28 | If the B<CMS_TEXT> flag is set MIME headers for type B<text/plain> are | ||
| 29 | prepended to the data. | ||
| 30 | |||
| 31 | Normally the supplied content is translated into MIME canonical format (as | ||
| 32 | required by the S/MIME specifications) if B<CMS_BINARY> is set no translation | ||
| 33 | occurs. This option should be used if the supplied data is in binary format | ||
| 34 | otherwise the translation will corrupt it. If B<CMS_BINARY> is set then | ||
| 35 | B<CMS_TEXT> is ignored. | ||
| 36 | |||
| 37 | If the B<CMS_STREAM> flag is set a partial B<CMS_ContentInfo> structure is | ||
| 38 | returned suitable for streaming I/O: no data is read from the BIO B<in>. | ||
| 39 | |||
| 40 | The compressed data is included in the CMS_ContentInfo structure, unless | ||
| 41 | B<CMS_DETACHED> is set in which case it is omitted. This is rarely used in | ||
| 42 | practice and is not supported by SMIME_write_CMS(). | ||
| 43 | |||
| 44 | =head1 NOTES | ||
| 45 | |||
| 46 | If the flag B<CMS_STREAM> is set the returned B<CMS_ContentInfo> structure is | ||
| 47 | B<not> complete and outputting its contents via a function that does not | ||
| 48 | properly finalize the B<CMS_ContentInfo> structure will give unpredictable | ||
| 49 | results. | ||
| 50 | |||
| 51 | Several functions including SMIME_write_CMS(), i2d_CMS_bio_stream(), | ||
| 52 | PEM_write_bio_CMS_stream() finalize the structure. Alternatively finalization | ||
| 53 | can be performed by obtaining the streaming ASN1 B<BIO> directly using | ||
| 54 | BIO_new_CMS(). | ||
| 55 | |||
| 56 | Additional compression parameters such as the zlib compression level cannot | ||
| 57 | currently be set. | ||
| 58 | |||
| 59 | =head1 RETURN VALUES | ||
| 60 | |||
| 61 | CMS_compress() returns either a CMS_ContentInfo structure or NULL if an error | ||
| 62 | occurred. The error can be obtained from ERR_get_error(3). | ||
| 63 | |||
| 64 | =head1 SEE ALSO | ||
| 65 | |||
| 66 | L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_uncompress(3)|CMS_uncompress(3)> | ||
| 67 | |||
| 68 | =head1 HISTORY | ||
| 69 | |||
| 70 | CMS_compress() was added to OpenSSL 0.9.8 | ||
| 71 | The B<CMS_STREAM> flag was first supported in OpenSSL 1.0.0. | ||
| 72 | |||
| 73 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_decrypt.pod b/src/lib/libssl/src/doc/crypto/CMS_decrypt.pod deleted file mode 100644 index 3b44cec603..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_decrypt.pod +++ /dev/null | |||
| @@ -1,79 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_decrypt - decrypt content from a CMS envelopedData structure | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | #include <openssl/cms.h> | ||
| 10 | |||
| 11 | int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert, BIO *dcont, BIO *out, unsigned int flags); | ||
| 12 | |||
| 13 | =head1 DESCRIPTION | ||
| 14 | |||
| 15 | CMS_decrypt() extracts and decrypts the content from a CMS EnvelopedData | ||
| 16 | structure. B<pkey> is the private key of the recipient, B<cert> is the | ||
| 17 | recipient's certificate, B<out> is a BIO to write the content to and | ||
| 18 | B<flags> is an optional set of flags. | ||
| 19 | |||
| 20 | The B<dcont> parameter is used in the rare case where the encrypted content | ||
| 21 | is detached. It will normally be set to NULL. | ||
| 22 | |||
| 23 | =head1 NOTES | ||
| 24 | |||
| 25 | OpenSSL_add_all_algorithms() (or equivalent) should be called before using this | ||
| 26 | function or errors about unknown algorithms will occur. | ||
| 27 | |||
| 28 | Although the recipients certificate is not needed to decrypt the data it is | ||
| 29 | needed to locate the appropriate (of possible several) recipients in the CMS | ||
| 30 | structure. | ||
| 31 | |||
| 32 | If B<cert> is set to NULL all possible recipients are tried. This case however | ||
| 33 | is problematic. To thwart the MMA attack (Bleichenbacher's attack on | ||
| 34 | PKCS #1 v1.5 RSA padding) all recipients are tried whether they succeed or | ||
| 35 | not. If no recipient succeeds then a random symmetric key is used to decrypt | ||
| 36 | the content: this will typically output garbage and may (but is not guaranteed | ||
| 37 | to) ultimately return a padding error only. If CMS_decrypt() just returned an | ||
| 38 | error when all recipient encrypted keys failed to decrypt an attacker could | ||
| 39 | use this in a timing attack. If the special flag B<CMS_DEBUG_DECRYPT> is set | ||
| 40 | then the above behaviour is modified and an error B<is> returned if no | ||
| 41 | recipient encrypted key can be decrypted B<without> generating a random | ||
| 42 | content encryption key. Applications should use this flag with | ||
| 43 | B<extreme caution> especially in automated gateways as it can leave them | ||
| 44 | open to attack. | ||
| 45 | |||
| 46 | It is possible to determine the correct recipient key by other means (for | ||
| 47 | example looking them up in a database) and setting them in the CMS structure | ||
| 48 | in advance using the CMS utility functions such as CMS_set1_pkey(). In this | ||
| 49 | case both B<cert> and B<pkey> should be set to NULL. | ||
| 50 | |||
| 51 | To process KEKRecipientInfo types CMS_set1_key() or CMS_RecipientInfo_set0_key() | ||
| 52 | and CMS_ReceipientInfo_decrypt() should be called before CMS_decrypt() and | ||
| 53 | B<cert> and B<pkey> set to NULL. | ||
| 54 | |||
| 55 | The following flags can be passed in the B<flags> parameter. | ||
| 56 | |||
| 57 | If the B<CMS_TEXT> flag is set MIME headers for type B<text/plain> are deleted | ||
| 58 | from the content. If the content is not of type B<text/plain> then an error is | ||
| 59 | returned. | ||
| 60 | |||
| 61 | =head1 RETURN VALUES | ||
| 62 | |||
| 63 | CMS_decrypt() returns either 1 for success or 0 for failure. | ||
| 64 | The error can be obtained from ERR_get_error(3) | ||
| 65 | |||
| 66 | =head1 BUGS | ||
| 67 | |||
| 68 | The lack of single pass processing and the need to hold all data in memory as | ||
| 69 | mentioned in CMS_verify() also applies to CMS_decrypt(). | ||
| 70 | |||
| 71 | =head1 SEE ALSO | ||
| 72 | |||
| 73 | L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_encrypt(3)|CMS_encrypt(3)> | ||
| 74 | |||
| 75 | =head1 HISTORY | ||
| 76 | |||
| 77 | CMS_decrypt() was added to OpenSSL 0.9.8 | ||
| 78 | |||
| 79 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_encrypt.pod b/src/lib/libssl/src/doc/crypto/CMS_encrypt.pod deleted file mode 100644 index f697e87e2b..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_encrypt.pod +++ /dev/null | |||
| @@ -1,93 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_encrypt - create a CMS envelopedData structure | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | #include <openssl/cms.h> | ||
| 10 | |||
| 11 | CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, unsigned int flags); | ||
| 12 | |||
| 13 | =head1 DESCRIPTION | ||
| 14 | |||
| 15 | CMS_encrypt() creates and returns a CMS EnvelopedData structure. B<certs> | ||
| 16 | is a list of recipient certificates. B<in> is the content to be encrypted. | ||
| 17 | B<cipher> is the symmetric cipher to use. B<flags> is an optional set of flags. | ||
| 18 | |||
| 19 | =head1 NOTES | ||
| 20 | |||
| 21 | Only certificates carrying RSA keys are supported so the recipient certificates | ||
| 22 | supplied to this function must all contain RSA public keys, though they do not | ||
| 23 | have to be signed using the RSA algorithm. | ||
| 24 | |||
| 25 | The algorithm passed in the B<cipher> parameter must support ASN1 encoding of | ||
| 26 | its parameters. | ||
| 27 | |||
| 28 | Many browsers implement a "sign and encrypt" option which is simply an S/MIME | ||
| 29 | envelopedData containing an S/MIME signed message. This can be readily produced | ||
| 30 | by storing the S/MIME signed message in a memory BIO and passing it to | ||
| 31 | CMS_encrypt(). | ||
| 32 | |||
| 33 | The following flags can be passed in the B<flags> parameter. | ||
| 34 | |||
| 35 | If the B<CMS_TEXT> flag is set MIME headers for type B<text/plain> are | ||
| 36 | prepended to the data. | ||
| 37 | |||
| 38 | Normally the supplied content is translated into MIME canonical format (as | ||
| 39 | required by the S/MIME specifications) if B<CMS_BINARY> is set no translation | ||
| 40 | occurs. This option should be used if the supplied data is in binary format | ||
| 41 | otherwise the translation will corrupt it. If B<CMS_BINARY> is set then | ||
| 42 | B<CMS_TEXT> is ignored. | ||
| 43 | |||
| 44 | OpenSSL will by default identify recipient certificates using issuer name | ||
| 45 | and serial number. If B<CMS_USE_KEYID> is set it will use the subject key | ||
| 46 | identifier value instead. An error occurs if all recipient certificates do not | ||
| 47 | have a subject key identifier extension. | ||
| 48 | |||
| 49 | If the B<CMS_STREAM> flag is set a partial B<CMS_ContentInfo> structure is | ||
| 50 | returned suitable for streaming I/O: no data is read from the BIO B<in>. | ||
| 51 | |||
| 52 | If the B<CMS_PARTIAL> flag is set a partial B<CMS_ContentInfo> structure is | ||
| 53 | returned to which additional recipients and attributes can be added before | ||
| 54 | finalization. | ||
| 55 | |||
| 56 | The data being encrypted is included in the CMS_ContentInfo structure, unless | ||
| 57 | B<CMS_DETACHED> is set in which case it is omitted. This is rarely used in | ||
| 58 | practice and is not supported by SMIME_write_CMS(). | ||
| 59 | |||
| 60 | =head1 NOTES | ||
| 61 | |||
| 62 | If the flag B<CMS_STREAM> is set the returned B<CMS_ContentInfo> structure is | ||
| 63 | B<not> complete and outputting its contents via a function that does not | ||
| 64 | properly finalize the B<CMS_ContentInfo> structure will give unpredictable | ||
| 65 | results. | ||
| 66 | |||
| 67 | Several functions including SMIME_write_CMS(), i2d_CMS_bio_stream(), | ||
| 68 | PEM_write_bio_CMS_stream() finalize the structure. Alternatively finalization | ||
| 69 | can be performed by obtaining the streaming ASN1 B<BIO> directly using | ||
| 70 | BIO_new_CMS(). | ||
| 71 | |||
| 72 | The recipients specified in B<certs> use a CMS KeyTransRecipientInfo info | ||
| 73 | structure. KEKRecipientInfo is also supported using the flag B<CMS_PARTIAL> | ||
| 74 | and CMS_add0_recipient_key(). | ||
| 75 | |||
| 76 | The parameter B<certs> may be NULL if B<CMS_PARTIAL> is set and recipients | ||
| 77 | added later using CMS_add1_recipient_cert() or CMS_add0_recipient_key(). | ||
| 78 | |||
| 79 | =head1 RETURN VALUES | ||
| 80 | |||
| 81 | CMS_encrypt() returns either a CMS_ContentInfo structure or NULL if an error | ||
| 82 | occurred. The error can be obtained from ERR_get_error(3). | ||
| 83 | |||
| 84 | =head1 SEE ALSO | ||
| 85 | |||
| 86 | L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_decrypt(3)|CMS_decrypt(3)> | ||
| 87 | |||
| 88 | =head1 HISTORY | ||
| 89 | |||
| 90 | CMS_decrypt() was added to OpenSSL 0.9.8 | ||
| 91 | The B<CMS_STREAM> flag was first supported in OpenSSL 1.0.0. | ||
| 92 | |||
| 93 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_final.pod b/src/lib/libssl/src/doc/crypto/CMS_final.pod deleted file mode 100644 index c5f1722aaf..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_final.pod +++ /dev/null | |||
| @@ -1,41 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_final - finalise a CMS_ContentInfo structure | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | #include <openssl/cms.h> | ||
| 10 | |||
| 11 | int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags); | ||
| 12 | |||
| 13 | =head1 DESCRIPTION | ||
| 14 | |||
| 15 | CMS_final() finalises the structure B<cms>. It's purpose is to perform any | ||
| 16 | operations necessary on B<cms> (digest computation for example) and set the | ||
| 17 | appropriate fields. The parameter B<data> contains the content to be | ||
| 18 | processed. The B<dcont> parameter contains a BIO to write content to after | ||
| 19 | processing: this is only used with detached data and will usually be set to | ||
| 20 | NULL. | ||
| 21 | |||
| 22 | =head1 NOTES | ||
| 23 | |||
| 24 | This function will normally be called when the B<CMS_PARTIAL> flag is used. It | ||
| 25 | should only be used when streaming is not performed because the streaming | ||
| 26 | I/O functions perform finalisation operations internally. | ||
| 27 | |||
| 28 | =head1 RETURN VALUES | ||
| 29 | |||
| 30 | CMS_final() returns 1 for success or 0 for failure. | ||
| 31 | |||
| 32 | =head1 SEE ALSO | ||
| 33 | |||
| 34 | L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_sign(3)|CMS_sign(3)>, | ||
| 35 | L<CMS_encrypt(3)|CMS_encrypt(3)> | ||
| 36 | |||
| 37 | =head1 HISTORY | ||
| 38 | |||
| 39 | CMS_final() was added to OpenSSL 0.9.8 | ||
| 40 | |||
| 41 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_get0_RecipientInfos.pod b/src/lib/libssl/src/doc/crypto/CMS_get0_RecipientInfos.pod deleted file mode 100644 index da3914c0c0..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_get0_RecipientInfos.pod +++ /dev/null | |||
| @@ -1,111 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_get0_RecipientInfos, CMS_RecipientInfo_type, | ||
| 6 | CMS_RecipientInfo_ktri_get0_signer_id,CMS_RecipientInfo_ktri_cert_cmp, | ||
| 7 | CMS_RecipientInfo_set0_pkey, CMS_RecipientInfo_kekri_get0_id, | ||
| 8 | CMS_RecipientInfo_kekri_id_cmp, CMS_RecipientInfo_set0_key, | ||
| 9 | CMS_RecipientInfo_decrypt, | ||
| 10 | CMS_RecipientInfo_encrypt - CMS envelopedData RecipientInfo routines | ||
| 11 | |||
| 12 | =head1 SYNOPSIS | ||
| 13 | |||
| 14 | #include <openssl/cms.h> | ||
| 15 | |||
| 16 | STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms); | ||
| 17 | int CMS_RecipientInfo_type(CMS_RecipientInfo *ri); | ||
| 18 | |||
| 19 | int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri, ASN1_OCTET_STRING **keyid, X509_NAME **issuer, ASN1_INTEGER **sno); | ||
| 20 | int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert); | ||
| 21 | int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey); | ||
| 22 | |||
| 23 | int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri, X509_ALGOR **palg, ASN1_OCTET_STRING **pid, ASN1_GENERALIZEDTIME **pdate, ASN1_OBJECT **potherid, ASN1_TYPE **pothertype); | ||
| 24 | int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri, const unsigned char *id, size_t idlen); | ||
| 25 | int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri, unsigned char *key, size_t keylen); | ||
| 26 | |||
| 27 | int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri); | ||
| 28 | |||
| 29 | =head1 DESCRIPTION | ||
| 30 | |||
| 31 | The function CMS_get0_RecipientInfos() returns all the CMS_RecipientInfo | ||
| 32 | structures associated with a CMS EnvelopedData structure. | ||
| 33 | |||
| 34 | CMS_RecipientInfo_type() returns the type of CMS_RecipientInfo structure B<ri>. | ||
| 35 | It will currently return CMS_RECIPINFO_TRANS, CMS_RECIPINFO_AGREE, | ||
| 36 | CMS_RECIPINFO_KEK, CMS_RECIPINFO_PASS, or CMS_RECIPINFO_OTHER. | ||
| 37 | |||
| 38 | CMS_RecipientInfo_ktri_get0_signer_id() retrieves the certificate recipient | ||
| 39 | identifier associated with a specific CMS_RecipientInfo structure B<ri>, which | ||
| 40 | must be of type CMS_RECIPINFO_TRANS. Either the keyidentifier will be set in | ||
| 41 | B<keyid> or B<both> issuer name and serial number in B<issuer> and B<sno>. | ||
| 42 | |||
| 43 | CMS_RecipientInfo_ktri_cert_cmp() compares the certificate B<cert> against the | ||
| 44 | CMS_RecipientInfo structure B<ri>, which must be of type CMS_RECIPINFO_TRANS. | ||
| 45 | It returns zero if the comparison is successful and non zero if not. | ||
| 46 | |||
| 47 | CMS_RecipientInfo_set0_pkey() associates the private key B<pkey> with | ||
| 48 | the CMS_RecipientInfo structure B<ri>, which must be of type | ||
| 49 | CMS_RECIPINFO_TRANS. | ||
| 50 | |||
| 51 | CMS_RecipientInfo_kekri_get0_id() retrieves the key information from the | ||
| 52 | CMS_RecipientInfo structure B<ri> which must be of type CMS_RECIPINFO_KEK. Any | ||
| 53 | of the remaining parameters can be NULL if the application is not interested in | ||
| 54 | the value of a field. Where a field is optional and absent NULL will be written | ||
| 55 | to the corresponding parameter. The keyEncryptionAlgorithm field is written to | ||
| 56 | B<palg>, the B<keyIdentifier> field is written to B<pid>, the B<date> field if | ||
| 57 | present is written to B<pdate>, if the B<other> field is present the components | ||
| 58 | B<keyAttrId> and B<keyAttr> are written to parameters B<potherid> and | ||
| 59 | B<pothertype>. | ||
| 60 | |||
| 61 | CMS_RecipientInfo_kekri_id_cmp() compares the ID in the B<id> and B<idlen> | ||
| 62 | parameters against the B<keyIdentifier> CMS_RecipientInfo structure B<ri>, | ||
| 63 | which must be of type CMS_RECIPINFO_KEK. It returns zero if the comparison is | ||
| 64 | successful and non zero if not. | ||
| 65 | |||
| 66 | CMS_RecipientInfo_set0_key() associates the symmetric key B<key> of length | ||
| 67 | B<keylen> with the CMS_RecipientInfo structure B<ri>, which must be of type | ||
| 68 | CMS_RECIPINFO_KEK. | ||
| 69 | |||
| 70 | CMS_RecipientInfo_decrypt() attempts to decrypt CMS_RecipientInfo structure | ||
| 71 | B<ri> in structure B<cms>. A key must have been associated with the structure | ||
| 72 | first. | ||
| 73 | |||
| 74 | =head1 NOTES | ||
| 75 | |||
| 76 | The main purpose of these functions is to enable an application to lookup | ||
| 77 | recipient keys using any appropriate technique when the simpler method | ||
| 78 | of CMS_decrypt() is not appropriate. | ||
| 79 | |||
| 80 | In typical usage and application will retrieve all CMS_RecipientInfo structures | ||
| 81 | using CMS_get0_RecipientInfos() and check the type of each using | ||
| 82 | CMS_RecpientInfo_type(). Depending on the type the CMS_RecipientInfo structure | ||
| 83 | can be ignored or its key identifier data retrieved using an appropriate | ||
| 84 | function. Then if the corresponding secret or private key can be obtained by | ||
| 85 | any appropriate means it can then associated with the structure and | ||
| 86 | CMS_RecpientInfo_decrypt() called. If successful CMS_decrypt() can be called | ||
| 87 | with a NULL key to decrypt the enveloped content. | ||
| 88 | |||
| 89 | =head1 RETURN VALUES | ||
| 90 | |||
| 91 | CMS_get0_RecipientInfos() returns all CMS_RecipientInfo structures, or NULL if | ||
| 92 | an error occurs. | ||
| 93 | |||
| 94 | CMS_RecipientInfo_ktri_get0_signer_id(), CMS_RecipientInfo_set0_pkey(), | ||
| 95 | CMS_RecipientInfo_kekri_get0_id(), CMS_RecipientInfo_set0_key() and | ||
| 96 | CMS_RecipientInfo_decrypt() return 1 for success or 0 if an error occurs. | ||
| 97 | |||
| 98 | CMS_RecipientInfo_ktri_cert_cmp() and CMS_RecipientInfo_kekri_cmp() return 0 | ||
| 99 | for a successful comparison and non zero otherwise. | ||
| 100 | |||
| 101 | Any error can be obtained from L<ERR_get_error(3)|ERR_get_error(3)>. | ||
| 102 | |||
| 103 | =head1 SEE ALSO | ||
| 104 | |||
| 105 | L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_decrypt(3)|CMS_decrypt(3)> | ||
| 106 | |||
| 107 | =head1 HISTORY | ||
| 108 | |||
| 109 | These functions were first was added to OpenSSL 0.9.8 | ||
| 110 | |||
| 111 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_get0_SignerInfos.pod b/src/lib/libssl/src/doc/crypto/CMS_get0_SignerInfos.pod deleted file mode 100644 index 557cda6c3e..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_get0_SignerInfos.pod +++ /dev/null | |||
| @@ -1,76 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_get0_SignerInfos, CMS_SignerInfo_get0_signer_id, CMS_SignerInfo_cert_cmp, | ||
| 6 | CMS_set1_signer_certs - CMS signedData signer functions. | ||
| 7 | |||
| 8 | =head1 SYNOPSIS | ||
| 9 | |||
| 10 | #include <openssl/cms.h> | ||
| 11 | |||
| 12 | STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms); | ||
| 13 | |||
| 14 | int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, ASN1_OCTET_STRING **keyid, X509_NAME **issuer, ASN1_INTEGER **sno); | ||
| 15 | int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert); | ||
| 16 | void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer); | ||
| 17 | |||
| 18 | =head1 DESCRIPTION | ||
| 19 | |||
| 20 | The function CMS_get0_SignerInfos() returns all the CMS_SignerInfo structures | ||
| 21 | associated with a CMS signedData structure. | ||
| 22 | |||
| 23 | CMS_SignerInfo_get0_signer_id() retrieves the certificate signer identifier | ||
| 24 | associated with a specific CMS_SignerInfo structure B<si>. Either the | ||
| 25 | keyidentifier will be set in B<keyid> or B<both> issuer name and serial number | ||
| 26 | in B<issuer> and B<sno>. | ||
| 27 | |||
| 28 | CMS_SignerInfo_cert_cmp() compares the certificate B<cert> against the signer | ||
| 29 | identifier B<si>. It returns zero if the comparison is successful and non zero | ||
| 30 | if not. | ||
| 31 | |||
| 32 | CMS_SignerInfo_set1_signer_cert() sets the signers certificate of B<si> to | ||
| 33 | B<signer>. | ||
| 34 | |||
| 35 | =head1 NOTES | ||
| 36 | |||
| 37 | The main purpose of these functions is to enable an application to lookup | ||
| 38 | signers certificates using any appropriate technique when the simpler method | ||
| 39 | of CMS_verify() is not appropriate. | ||
| 40 | |||
| 41 | In typical usage and application will retrieve all CMS_SignerInfo structures | ||
| 42 | using CMS_get0_SignerInfo() and retrieve the identifier information using | ||
| 43 | CMS. It will then obtain the signer certificate by some unspecified means | ||
| 44 | (or return and error if it cannot be found) and set it using | ||
| 45 | CMS_SignerInfo_set1_signer_cert(). | ||
| 46 | |||
| 47 | Once all signer certificates have been set CMS_verify() can be used. | ||
| 48 | |||
| 49 | Although CMS_get0_SignerInfos() can return NULL is an error occur B<or> if | ||
| 50 | there are no signers this is not a problem in practice because the only | ||
| 51 | error which can occur is if the B<cms> structure is not of type signedData | ||
| 52 | due to application error. | ||
| 53 | |||
| 54 | =head1 RETURN VALUES | ||
| 55 | |||
| 56 | CMS_get0_SignerInfos() returns all CMS_SignerInfo structures, or NULL there | ||
| 57 | are no signers or an error occurs. | ||
| 58 | |||
| 59 | CMS_SignerInfo_get0_signer_id() returns 1 for success and 0 for failure. | ||
| 60 | |||
| 61 | CMS_SignerInfo_cert_cmp() returns 0 for a successful comparison and non | ||
| 62 | zero otherwise. | ||
| 63 | |||
| 64 | CMS_SignerInfo_set1_signer_cert() does not return a value. | ||
| 65 | |||
| 66 | Any error can be obtained from L<ERR_get_error(3)|ERR_get_error(3)> | ||
| 67 | |||
| 68 | =head1 SEE ALSO | ||
| 69 | |||
| 70 | L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_verify(3)|CMS_verify(3)> | ||
| 71 | |||
| 72 | =head1 HISTORY | ||
| 73 | |||
| 74 | These functions were first was added to OpenSSL 0.9.8 | ||
| 75 | |||
| 76 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_get0_type.pod b/src/lib/libssl/src/doc/crypto/CMS_get0_type.pod deleted file mode 100644 index bc2690ee1a..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_get0_type.pod +++ /dev/null | |||
| @@ -1,64 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_get0_type, CMS_set1_eContentType, CMS_get0_eContentType - get and set CMS | ||
| 6 | content types | ||
| 7 | |||
| 8 | =head1 SYNOPSIS | ||
| 9 | |||
| 10 | #include <openssl/cms.h> | ||
| 11 | |||
| 12 | const ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms); | ||
| 13 | int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid); | ||
| 14 | const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms); | ||
| 15 | |||
| 16 | =head1 DESCRIPTION | ||
| 17 | |||
| 18 | CMS_get0_type() returns the content type of a CMS_ContentInfo structure as | ||
| 19 | and ASN1_OBJECT pointer. An application can then decide how to process the | ||
| 20 | CMS_ContentInfo structure based on this value. | ||
| 21 | |||
| 22 | CMS_set1_eContentType() sets the embedded content type of a CMS_ContentInfo | ||
| 23 | structure. It should be called with CMS functions with the B<CMS_PARTIAL> | ||
| 24 | flag and B<before> the structure is finalised, otherwise the results are | ||
| 25 | undefined. | ||
| 26 | |||
| 27 | ASN1_OBJECT *CMS_get0_eContentType() returns a pointer to the embedded | ||
| 28 | content type. | ||
| 29 | |||
| 30 | =head1 NOTES | ||
| 31 | |||
| 32 | As the B<0> implies CMS_get0_type() and CMS_get0_eContentType() return internal | ||
| 33 | pointers which should B<not> be freed up. CMS_set1_eContentType() copies the | ||
| 34 | supplied OID and it B<should> be freed up after use. | ||
| 35 | |||
| 36 | The B<ASN1_OBJECT> values returned can be converted to an integer B<NID> value | ||
| 37 | using OBJ_obj2nid(). For the currently supported content types the following | ||
| 38 | values are returned: | ||
| 39 | |||
| 40 | NID_pkcs7_data | ||
| 41 | NID_pkcs7_signed | ||
| 42 | NID_pkcs7_digest | ||
| 43 | NID_id_smime_ct_compressedData: | ||
| 44 | NID_pkcs7_encrypted | ||
| 45 | NID_pkcs7_enveloped | ||
| 46 | |||
| 47 | |||
| 48 | =head1 RETURN VALUES | ||
| 49 | |||
| 50 | CMS_get0_type() and CMS_get0_eContentType() return and ASN1_OBJECT structure. | ||
| 51 | |||
| 52 | CMS_set1_eContentType() returns 1 for success or 0 if an error occurred. The | ||
| 53 | error can be obtained from ERR_get_error(3). | ||
| 54 | |||
| 55 | =head1 SEE ALSO | ||
| 56 | |||
| 57 | L<ERR_get_error(3)|ERR_get_error(3)> | ||
| 58 | |||
| 59 | =head1 HISTORY | ||
| 60 | |||
| 61 | CMS_get0_type(), CMS_set1_eContentType() and CMS_get0_eContentType() were all | ||
| 62 | first added to OpenSSL 0.9.8 | ||
| 63 | |||
| 64 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_get1_ReceiptRequest.pod b/src/lib/libssl/src/doc/crypto/CMS_get1_ReceiptRequest.pod deleted file mode 100644 index a7babb1a6e..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_get1_ReceiptRequest.pod +++ /dev/null | |||
| @@ -1,70 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_ReceiptRequest_create0, CMS_add1_ReceiptRequest, CMS_get1_ReceiptRequest, | ||
| 6 | CMS_ReceiptRequest_get0_values - CMS signed receipt request functions. | ||
| 7 | |||
| 8 | =head1 SYNOPSIS | ||
| 9 | |||
| 10 | #include <openssl/cms.h> | ||
| 11 | |||
| 12 | CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen, int allorfirst, STACK_OF(GENERAL_NAMES) *receiptList, STACK_OF(GENERAL_NAMES) *receiptsTo); | ||
| 13 | int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr); | ||
| 14 | int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr); | ||
| 15 | void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr, ASN1_STRING **pcid, int *pallorfirst, STACK_OF(GENERAL_NAMES) **plist, STACK_OF(GENERAL_NAMES) **prto); | ||
| 16 | |||
| 17 | =head1 DESCRIPTION | ||
| 18 | |||
| 19 | CMS_ReceiptRequest_create0() creates a signed receipt request structure. The | ||
| 20 | B<signedContentIdentifier> field is set using B<id> and B<idlen>, or it is set | ||
| 21 | to 32 bytes of pseudo random data if B<id> is NULL. If B<receiptList> is NULL | ||
| 22 | the allOrFirstTier option in B<receiptsFrom> is used and set to the value of | ||
| 23 | the B<allorfirst> parameter. If B<receiptList> is not NULL the B<receiptList> | ||
| 24 | option in B<receiptsFrom> is used. The B<receiptsTo> parameter specifies the | ||
| 25 | B<receiptsTo> field value. | ||
| 26 | |||
| 27 | The CMS_add1_ReceiptRequest() function adds a signed receipt request B<rr> | ||
| 28 | to SignerInfo structure B<si>. | ||
| 29 | |||
| 30 | int CMS_get1_ReceiptRequest() looks for a signed receipt request in B<si>, if | ||
| 31 | any is found it is decoded and written to B<prr>. | ||
| 32 | |||
| 33 | CMS_ReceiptRequest_get0_values() retrieves the values of a receipt request. | ||
| 34 | The signedContentIdentifier is copied to B<pcid>. If the B<allOrFirstTier> | ||
| 35 | option of B<receiptsFrom> is used its value is copied to B<pallorfirst> | ||
| 36 | otherwise the B<receiptList> field is copied to B<plist>. The B<receiptsTo> | ||
| 37 | parameter is copied to B<prto>. | ||
| 38 | |||
| 39 | =head1 NOTES | ||
| 40 | |||
| 41 | For more details of the meaning of the fields see RFC2634. | ||
| 42 | |||
| 43 | The contents of a signed receipt should only be considered meaningful if the | ||
| 44 | corresponding CMS_ContentInfo structure can be successfully verified using | ||
| 45 | CMS_verify(). | ||
| 46 | |||
| 47 | =head1 RETURN VALUES | ||
| 48 | |||
| 49 | CMS_ReceiptRequest_create0() returns a signed receipt request structure or | ||
| 50 | NULL if an error occurred. | ||
| 51 | |||
| 52 | CMS_add1_ReceiptRequest() returns 1 for success or 0 is an error occurred. | ||
| 53 | |||
| 54 | CMS_get1_ReceiptRequest() returns 1 is a signed receipt request is found and | ||
| 55 | decoded. It returns 0 if a signed receipt request is not present and -1 if | ||
| 56 | it is present but malformed. | ||
| 57 | |||
| 58 | =head1 SEE ALSO | ||
| 59 | |||
| 60 | L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_sign(3)|CMS_sign(3)>, | ||
| 61 | L<CMS_sign_receipt(3)|CMS_sign_receipt(3)>, L<CMS_verify(3)|CMS_verify(3)> | ||
| 62 | L<CMS_verify_receipt(3)|CMS_verify_receipt(3)> | ||
| 63 | |||
| 64 | =head1 HISTORY | ||
| 65 | |||
| 66 | CMS_ReceiptRequest_create0(), CMS_add1_ReceiptRequest(), | ||
| 67 | CMS_get1_ReceiptRequest() and CMS_ReceiptRequest_get0_values() were added to | ||
| 68 | OpenSSL 0.9.8 | ||
| 69 | |||
| 70 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_sign.pod b/src/lib/libssl/src/doc/crypto/CMS_sign.pod deleted file mode 100644 index cc6d17faf6..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_sign.pod +++ /dev/null | |||
| @@ -1,122 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_sign - create a CMS SignedData structure | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | #include <openssl/cms.h> | ||
| 10 | |||
| 11 | CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, BIO *data, unsigned int flags); | ||
| 12 | |||
| 13 | =head1 DESCRIPTION | ||
| 14 | |||
| 15 | CMS_sign() creates and returns a CMS SignedData structure. B<signcert> is | ||
| 16 | the certificate to sign with, B<pkey> is the corresponding private key. | ||
| 17 | B<certs> is an optional additional set of certificates to include in the CMS | ||
| 18 | structure (for example any intermediate CAs in the chain). Any or all of | ||
| 19 | these parameters can be B<NULL>, see B<NOTES> below. | ||
| 20 | |||
| 21 | The data to be signed is read from BIO B<data>. | ||
| 22 | |||
| 23 | B<flags> is an optional set of flags. | ||
| 24 | |||
| 25 | =head1 NOTES | ||
| 26 | |||
| 27 | Any of the following flags (ored together) can be passed in the B<flags> | ||
| 28 | parameter. | ||
| 29 | |||
| 30 | Many S/MIME clients expect the signed content to include valid MIME headers. If | ||
| 31 | the B<CMS_TEXT> flag is set MIME headers for type B<text/plain> are prepended | ||
| 32 | to the data. | ||
| 33 | |||
| 34 | If B<CMS_NOCERTS> is set the signer's certificate will not be included in the | ||
| 35 | CMS_ContentInfo structure, the signer's certificate must still be supplied in | ||
| 36 | the B<signcert> parameter though. This can reduce the size of the signature if | ||
| 37 | the signers certificate can be obtained by other means: for example a | ||
| 38 | previously signed message. | ||
| 39 | |||
| 40 | The data being signed is included in the CMS_ContentInfo structure, unless | ||
| 41 | B<CMS_DETACHED> is set in which case it is omitted. This is used for | ||
| 42 | CMS_ContentInfo detached signatures which are used in S/MIME plaintext signed | ||
| 43 | messages for example. | ||
| 44 | |||
| 45 | Normally the supplied content is translated into MIME canonical format (as | ||
| 46 | required by the S/MIME specifications) if B<CMS_BINARY> is set no translation | ||
| 47 | occurs. This option should be used if the supplied data is in binary format | ||
| 48 | otherwise the translation will corrupt it. | ||
| 49 | |||
| 50 | The SignedData structure includes several CMS signedAttributes including the | ||
| 51 | signing time, the CMS content type and the supported list of ciphers in an | ||
| 52 | SMIMECapabilities attribute. If B<CMS_NOATTR> is set then no signedAttributes | ||
| 53 | will be used. If B<CMS_NOSMIMECAP> is set then just the SMIMECapabilities are | ||
| 54 | omitted. | ||
| 55 | |||
| 56 | If present the SMIMECapabilities attribute indicates support for the following | ||
| 57 | algorithms in preference order: 256 bit AES, Gost R3411-94, Gost 28147-89, 192 | ||
| 58 | bit AES, 128 bit AES, triple DES, 128 bit RC2, 64 bit RC2, DES and 40 bit RC2. | ||
| 59 | If any of these algorithms is not available then it will not be included: for | ||
| 60 | example the GOST algorithms will not be included if the GOST ENGINE is not | ||
| 61 | loaded. | ||
| 62 | |||
| 63 | OpenSSL will by default identify signing certificates using issuer name | ||
| 64 | and serial number. If B<CMS_USE_KEYID> is set it will use the subject key | ||
| 65 | identifier value instead. An error occurs if the signing certificate does not | ||
| 66 | have a subject key identifier extension. | ||
| 67 | |||
| 68 | If the flags B<CMS_STREAM> is set then the returned B<CMS_ContentInfo> | ||
| 69 | structure is just initialized ready to perform the signing operation. The | ||
| 70 | signing is however B<not> performed and the data to be signed is not read from | ||
| 71 | the B<data> parameter. Signing is deferred until after the data has been | ||
| 72 | written. In this way data can be signed in a single pass. | ||
| 73 | |||
| 74 | If the B<CMS_PARTIAL> flag is set a partial B<CMS_ContentInfo> structure is | ||
| 75 | output to which additional signers and capabilities can be added before | ||
| 76 | finalization. | ||
| 77 | |||
| 78 | If the flag B<CMS_STREAM> is set the returned B<CMS_ContentInfo> structure is | ||
| 79 | B<not> complete and outputting its contents via a function that does not | ||
| 80 | properly finalize the B<CMS_ContentInfo> structure will give unpredictable | ||
| 81 | results. | ||
| 82 | |||
| 83 | Several functions including SMIME_write_CMS(), i2d_CMS_bio_stream(), | ||
| 84 | PEM_write_bio_CMS_stream() finalize the structure. Alternatively finalization | ||
| 85 | can be performed by obtaining the streaming ASN1 B<BIO> directly using | ||
| 86 | BIO_new_CMS(). | ||
| 87 | |||
| 88 | If a signer is specified it will use the default digest for the signing | ||
| 89 | algorithm. This is B<SHA1> for both RSA and DSA keys. | ||
| 90 | |||
| 91 | If B<signcert> and B<pkey> are NULL then a certificates only CMS structure is | ||
| 92 | output. | ||
| 93 | |||
| 94 | The function CMS_sign() is a basic CMS signing function whose output will be | ||
| 95 | suitable for many purposes. For finer control of the output format the | ||
| 96 | B<certs>, B<signcert> and B<pkey> parameters can all be B<NULL> and the | ||
| 97 | B<CMS_PARTIAL> flag set. Then one or more signers can be added using the | ||
| 98 | function CMS_sign_add1_signer(), non default digests can be used and custom | ||
| 99 | attributes added. B<CMS_final()> must then be called to finalize the | ||
| 100 | structure if streaming is not enabled. | ||
| 101 | |||
| 102 | =head1 BUGS | ||
| 103 | |||
| 104 | Some attributes such as counter signatures are not supported. | ||
| 105 | |||
| 106 | =head1 RETURN VALUES | ||
| 107 | |||
| 108 | CMS_sign() returns either a valid CMS_ContentInfo structure or NULL if an error | ||
| 109 | occurred. The error can be obtained from ERR_get_error(3). | ||
| 110 | |||
| 111 | =head1 SEE ALSO | ||
| 112 | |||
| 113 | L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_verify(3)|CMS_verify(3)> | ||
| 114 | |||
| 115 | =head1 HISTORY | ||
| 116 | |||
| 117 | CMS_sign() was added to OpenSSL 0.9.8 | ||
| 118 | |||
| 119 | The B<CMS_STREAM> flag is only supported for detached data in OpenSSL 0.9.8, | ||
| 120 | it is supported for embedded data in OpenSSL 1.0.0 and later. | ||
| 121 | |||
| 122 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_sign_add1_signer.pod b/src/lib/libssl/src/doc/crypto/CMS_sign_add1_signer.pod deleted file mode 100644 index ed4d9a9234..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_sign_add1_signer.pod +++ /dev/null | |||
| @@ -1,103 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_sign_add1_signer, CMS_SignerInfo_sign - add a signer to a CMS_ContentInfo | ||
| 6 | signed data structure. | ||
| 7 | |||
| 8 | =head1 SYNOPSIS | ||
| 9 | |||
| 10 | #include <openssl/cms.h> | ||
| 11 | |||
| 12 | CMS_SignerInfo *CMS_sign_add1_signer(CMS_ContentInfo *cms, X509 *signcert, EVP_PKEY *pkey, const EVP_MD *md, unsigned int flags); | ||
| 13 | |||
| 14 | int CMS_SignerInfo_sign(CMS_SignerInfo *si); | ||
| 15 | |||
| 16 | |||
| 17 | =head1 DESCRIPTION | ||
| 18 | |||
| 19 | CMS_sign_add1_signer() adds a signer with certificate B<signcert> and private | ||
| 20 | key B<pkey> using message digest B<md> to CMS_ContentInfo SignedData | ||
| 21 | structure B<cms>. | ||
| 22 | |||
| 23 | The CMS_ContentInfo structure should be obtained from an initial call to | ||
| 24 | CMS_sign() with the flag B<CMS_PARTIAL> set or in the case or re-signing a | ||
| 25 | valid CMS_ContentInfo SignedData structure. | ||
| 26 | |||
| 27 | If the B<md> parameter is B<NULL> then the default digest for the public | ||
| 28 | key algorithm will be used. | ||
| 29 | |||
| 30 | Unless the B<CMS_REUSE_DIGEST> flag is set the returned CMS_ContentInfo | ||
| 31 | structure is not complete and must be finalized either by streaming (if | ||
| 32 | applicable) or a call to CMS_final(). | ||
| 33 | |||
| 34 | The CMS_SignerInfo_sign() function will explicitly sign a CMS_SignerInfo | ||
| 35 | structure, its main use is when B<CMS_REUSE_DIGEST> and B<CMS_PARTIAL> flags | ||
| 36 | are both set. | ||
| 37 | |||
| 38 | =head1 NOTES | ||
| 39 | |||
| 40 | The main purpose of CMS_sign_add1_signer() is to provide finer control | ||
| 41 | over a CMS signed data structure where the simpler CMS_sign() function defaults | ||
| 42 | are not appropriate. For example if multiple signers or non default digest | ||
| 43 | algorithms are needed. New attributes can also be added using the returned | ||
| 44 | CMS_SignerInfo structure and the CMS attribute utility functions or the | ||
| 45 | CMS signed receipt request functions. | ||
| 46 | |||
| 47 | Any of the following flags (ored together) can be passed in the B<flags> | ||
| 48 | parameter. | ||
| 49 | |||
| 50 | If B<CMS_REUSE_DIGEST> is set then an attempt is made to copy the content | ||
| 51 | digest value from the CMS_ContentInfo structure: to add a signer to an existing | ||
| 52 | structure. An error occurs if a matching digest value cannot be found to copy. | ||
| 53 | The returned CMS_ContentInfo structure will be valid and finalized when this | ||
| 54 | flag is set. | ||
| 55 | |||
| 56 | If B<CMS_PARTIAL> is set in addition to B<CMS_REUSE_DIGEST> then the | ||
| 57 | CMS_SignerInfo structure will not be finalized so additional attributes | ||
| 58 | can be added. In this case an explicit call to CMS_SignerInfo_sign() is | ||
| 59 | needed to finalize it. | ||
| 60 | |||
| 61 | If B<CMS_NOCERTS> is set the signer's certificate will not be included in the | ||
| 62 | CMS_ContentInfo structure, the signer's certificate must still be supplied in | ||
| 63 | the B<signcert> parameter though. This can reduce the size of the signature if | ||
| 64 | the signers certificate can be obtained by other means: for example a | ||
| 65 | previously signed message. | ||
| 66 | |||
| 67 | The SignedData structure includes several CMS signedAttributes including the | ||
| 68 | signing time, the CMS content type and the supported list of ciphers in an | ||
| 69 | SMIMECapabilities attribute. If B<CMS_NOATTR> is set then no signedAttributes | ||
| 70 | will be used. If B<CMS_NOSMIMECAP> is set then just the SMIMECapabilities are | ||
| 71 | omitted. | ||
| 72 | |||
| 73 | OpenSSL will by default identify signing certificates using issuer name | ||
| 74 | and serial number. If B<CMS_USE_KEYID> is set it will use the subject key | ||
| 75 | identifier value instead. An error occurs if the signing certificate does not | ||
| 76 | have a subject key identifier extension. | ||
| 77 | |||
| 78 | If present the SMIMECapabilities attribute indicates support for the following | ||
| 79 | algorithms in preference order: 256 bit AES, Gost R3411-94, Gost 28147-89, 192 | ||
| 80 | bit AES, 128 bit AES, triple DES, 128 bit RC2, 64 bit RC2, DES and 40 bit RC2. | ||
| 81 | If any of these algorithms is not available then it will not be included: for | ||
| 82 | example the GOST algorithms will not be included if the GOST ENGINE is not | ||
| 83 | loaded. | ||
| 84 | |||
| 85 | CMS_sign_add1_signer() returns an internal pointer to the CMS_SignerInfo | ||
| 86 | structure just added, this can be used to set additional attributes | ||
| 87 | before it is finalized. | ||
| 88 | |||
| 89 | =head1 RETURN VALUES | ||
| 90 | |||
| 91 | CMS_sign1_add_signers() returns an internal pointer to the CMS_SignerInfo | ||
| 92 | structure just added or NULL if an error occurs. | ||
| 93 | |||
| 94 | =head1 SEE ALSO | ||
| 95 | |||
| 96 | L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_sign(3)|CMS_sign(3)>, | ||
| 97 | L<CMS_final(3)|CMS_final(3)>, | ||
| 98 | |||
| 99 | =head1 HISTORY | ||
| 100 | |||
| 101 | CMS_sign_add1_signer() was added to OpenSSL 0.9.8 | ||
| 102 | |||
| 103 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_sign_receipt.pod b/src/lib/libssl/src/doc/crypto/CMS_sign_receipt.pod deleted file mode 100644 index f603ab66f0..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_sign_receipt.pod +++ /dev/null | |||
| @@ -1,45 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_sign_receipt - create a CMS signed receipt | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | #include <openssl/cms.h> | ||
| 10 | |||
| 11 | CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, unsigned int flags); | ||
| 12 | |||
| 13 | =head1 DESCRIPTION | ||
| 14 | |||
| 15 | CMS_sign_receipt() creates and returns a CMS signed receipt structure. B<si> is | ||
| 16 | the B<CMS_SignerInfo> structure containing the signed receipt request. | ||
| 17 | B<signcert> is the certificate to sign with, B<pkey> is the corresponding | ||
| 18 | private key. B<certs> is an optional additional set of certificates to include | ||
| 19 | in the CMS structure (for example any intermediate CAs in the chain). | ||
| 20 | |||
| 21 | B<flags> is an optional set of flags. | ||
| 22 | |||
| 23 | =head1 NOTES | ||
| 24 | |||
| 25 | This functions behaves in a similar way to CMS_sign() except the flag values | ||
| 26 | B<CMS_DETACHED>, B<CMS_BINARY>, B<CMS_NOATTR>, B<CMS_TEXT> and B<CMS_STREAM> | ||
| 27 | are not supported since they do not make sense in the context of signed | ||
| 28 | receipts. | ||
| 29 | |||
| 30 | =head1 RETURN VALUES | ||
| 31 | |||
| 32 | CMS_sign_receipt() returns either a valid CMS_ContentInfo structure or NULL if | ||
| 33 | an error occurred. The error can be obtained from ERR_get_error(3). | ||
| 34 | |||
| 35 | =head1 SEE ALSO | ||
| 36 | |||
| 37 | L<ERR_get_error(3)|ERR_get_error(3)>, | ||
| 38 | L<CMS_verify_receipt(3)|CMS_verify_receipt(3)>, | ||
| 39 | L<CMS_sign(3)|CMS_sign(3)> | ||
| 40 | |||
| 41 | =head1 HISTORY | ||
| 42 | |||
| 43 | CMS_sign_receipt() was added to OpenSSL 0.9.8 | ||
| 44 | |||
| 45 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_uncompress.pod b/src/lib/libssl/src/doc/crypto/CMS_uncompress.pod deleted file mode 100644 index fcbfec128a..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_uncompress.pod +++ /dev/null | |||
| @@ -1,54 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_uncompress - uncompress a CMS CompressedData structure | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | #include <openssl/cms.h> | ||
| 10 | |||
| 11 | int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, unsigned int flags); | ||
| 12 | |||
| 13 | =head1 DESCRIPTION | ||
| 14 | |||
| 15 | CMS_uncompress() extracts and uncompresses the content from a CMS | ||
| 16 | CompressedData structure B<cms>. B<data> is a BIO to write the content to and | ||
| 17 | B<flags> is an optional set of flags. | ||
| 18 | |||
| 19 | The B<dcont> parameter is used in the rare case where the compressed content | ||
| 20 | is detached. It will normally be set to NULL. | ||
| 21 | |||
| 22 | =head1 NOTES | ||
| 23 | |||
| 24 | The only currently supported compression algorithm is zlib: if the structure | ||
| 25 | indicates the use of any other algorithm an error is returned. | ||
| 26 | |||
| 27 | If zlib support is not compiled into OpenSSL then CMS_uncompress() will always | ||
| 28 | return an error. | ||
| 29 | |||
| 30 | The following flags can be passed in the B<flags> parameter. | ||
| 31 | |||
| 32 | If the B<CMS_TEXT> flag is set MIME headers for type B<text/plain> are deleted | ||
| 33 | from the content. If the content is not of type B<text/plain> then an error is | ||
| 34 | returned. | ||
| 35 | |||
| 36 | =head1 RETURN VALUES | ||
| 37 | |||
| 38 | CMS_uncompress() returns either 1 for success or 0 for failure. The error can | ||
| 39 | be obtained from ERR_get_error(3) | ||
| 40 | |||
| 41 | =head1 BUGS | ||
| 42 | |||
| 43 | The lack of single pass processing and the need to hold all data in memory as | ||
| 44 | mentioned in CMS_verify() also applies to CMS_decompress(). | ||
| 45 | |||
| 46 | =head1 SEE ALSO | ||
| 47 | |||
| 48 | L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_compress(3)|CMS_compress(3)> | ||
| 49 | |||
| 50 | =head1 HISTORY | ||
| 51 | |||
| 52 | CMS_uncompress() was added to OpenSSL 0.9.8 | ||
| 53 | |||
| 54 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_verify.pod b/src/lib/libssl/src/doc/crypto/CMS_verify.pod deleted file mode 100644 index 69425008aa..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_verify.pod +++ /dev/null | |||
| @@ -1,126 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_verify, CMS_get0_signers - verify a CMS SignedData structure | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | #include <openssl/cms.h> | ||
| 10 | |||
| 11 | int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, X509_STORE *store, BIO *indata, BIO *out, unsigned int flags); | ||
| 12 | |||
| 13 | STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms); | ||
| 14 | |||
| 15 | =head1 DESCRIPTION | ||
| 16 | |||
| 17 | CMS_verify() verifies a CMS SignedData structure. B<cms> is the CMS_ContentInfo | ||
| 18 | structure to verify. B<certs> is a set of certificates in which to search for | ||
| 19 | the signing certificate(s). B<store> is a trusted certificate store used for | ||
| 20 | chain verification. B<indata> is the detached content if the content is not | ||
| 21 | present in B<cms>. The content is written to B<out> if it is not NULL. | ||
| 22 | |||
| 23 | B<flags> is an optional set of flags, which can be used to modify the verify | ||
| 24 | operation. | ||
| 25 | |||
| 26 | CMS_get0_signers() retrieves the signing certificate(s) from B<cms>, it must | ||
| 27 | be called after a successful CMS_verify() operation. | ||
| 28 | |||
| 29 | =head1 VERIFY PROCESS | ||
| 30 | |||
| 31 | Normally the verify process proceeds as follows. | ||
| 32 | |||
| 33 | Initially some sanity checks are performed on B<cms>. The type of B<cms> must | ||
| 34 | be SignedData. There must be at least one signature on the data and if | ||
| 35 | the content is detached B<indata> cannot be B<NULL>. | ||
| 36 | |||
| 37 | An attempt is made to locate all the signing certificate(s), first looking in | ||
| 38 | the B<certs> parameter (if it is not NULL) and then looking in any | ||
| 39 | certificates contained in the B<cms> structure itself. If any signing | ||
| 40 | certificate cannot be located the operation fails. | ||
| 41 | |||
| 42 | Each signing certificate is chain verified using the B<smimesign> purpose and | ||
| 43 | the supplied trusted certificate store. Any internal certificates in the message | ||
| 44 | are used as untrusted CAs. If CRL checking is enabled in B<store> any internal | ||
| 45 | CRLs are used in addition to attempting to look them up in B<store>. If any | ||
| 46 | chain verify fails an error code is returned. | ||
| 47 | |||
| 48 | Finally the signed content is read (and written to B<out> is it is not NULL) | ||
| 49 | and the signature's checked. | ||
| 50 | |||
| 51 | If all signature's verify correctly then the function is successful. | ||
| 52 | |||
| 53 | Any of the following flags (ored together) can be passed in the B<flags> | ||
| 54 | parameter to change the default verify behaviour. | ||
| 55 | |||
| 56 | If B<CMS_NOINTERN> is set the certificates in the message itself are not | ||
| 57 | searched when locating the signing certificate(s). This means that all the | ||
| 58 | signing certificates must be in the B<certs> parameter. | ||
| 59 | |||
| 60 | If B<CMS_NOCRL> is set and CRL checking is enabled in B<store> then any | ||
| 61 | CRLs in the message itself are ignored. | ||
| 62 | |||
| 63 | If the B<CMS_TEXT> flag is set MIME headers for type B<text/plain> are deleted | ||
| 64 | from the content. If the content is not of type B<text/plain> then an error is | ||
| 65 | returned. | ||
| 66 | |||
| 67 | If B<CMS_NO_SIGNER_CERT_VERIFY> is set the signing certificates are not | ||
| 68 | verified. | ||
| 69 | |||
| 70 | If B<CMS_NO_ATTR_VERIFY> is set the signed attributes signature is not | ||
| 71 | verified. | ||
| 72 | |||
| 73 | If B<CMS_NO_CONTENT_VERIFY> is set then the content digest is not checked. | ||
| 74 | |||
| 75 | =head1 NOTES | ||
| 76 | |||
| 77 | One application of B<CMS_NOINTERN> is to only accept messages signed by | ||
| 78 | a small number of certificates. The acceptable certificates would be passed | ||
| 79 | in the B<certs> parameter. In this case if the signer is not one of the | ||
| 80 | certificates supplied in B<certs> then the verify will fail because the | ||
| 81 | signer cannot be found. | ||
| 82 | |||
| 83 | In some cases the standard techniques for looking up and validating | ||
| 84 | certificates are not appropriate: for example an application may wish to | ||
| 85 | lookup certificates in a database or perform customised verification. This | ||
| 86 | can be achieved by setting and verifying the signers certificates manually | ||
| 87 | using the signed data utility functions. | ||
| 88 | |||
| 89 | Care should be taken when modifying the default verify behaviour, for example | ||
| 90 | setting B<CMS_NO_CONTENT_VERIFY> will totally disable all content verification | ||
| 91 | and any modified content will be considered valid. This combination is however | ||
| 92 | useful if one merely wishes to write the content to B<out> and its validity | ||
| 93 | is not considered important. | ||
| 94 | |||
| 95 | Chain verification should arguably be performed using the signing time rather | ||
| 96 | than the current time. However since the signing time is supplied by the | ||
| 97 | signer it cannot be trusted without additional evidence (such as a trusted | ||
| 98 | timestamp). | ||
| 99 | |||
| 100 | =head1 RETURN VALUES | ||
| 101 | |||
| 102 | CMS_verify() returns 1 for a successful verification and zero if an error | ||
| 103 | occurred. | ||
| 104 | |||
| 105 | CMS_get0_signers() returns all signers or NULL if an error occurred. | ||
| 106 | |||
| 107 | The error can be obtained from L<ERR_get_error(3)|ERR_get_error(3)> | ||
| 108 | |||
| 109 | =head1 BUGS | ||
| 110 | |||
| 111 | The trusted certificate store is not searched for the signing certificate, | ||
| 112 | this is primarily due to the inadequacies of the current B<X509_STORE> | ||
| 113 | functionality. | ||
| 114 | |||
| 115 | The lack of single pass processing means that the signed content must all | ||
| 116 | be held in memory if it is not detached. | ||
| 117 | |||
| 118 | =head1 SEE ALSO | ||
| 119 | |||
| 120 | L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_sign(3)|CMS_sign(3)> | ||
| 121 | |||
| 122 | =head1 HISTORY | ||
| 123 | |||
| 124 | CMS_verify() was added to OpenSSL 0.9.8 | ||
| 125 | |||
| 126 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CMS_verify_receipt.pod b/src/lib/libssl/src/doc/crypto/CMS_verify_receipt.pod deleted file mode 100644 index 2beadda129..0000000000 --- a/src/lib/libssl/src/doc/crypto/CMS_verify_receipt.pod +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | =pod | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | CMS_verify_receipt - verify a CMS signed receipt | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | #include <openssl/cms.h> | ||
| 10 | |||
| 11 | int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms, STACK_OF(X509) *certs, X509_STORE *store, unsigned int flags); | ||
| 12 | |||
| 13 | =head1 DESCRIPTION | ||
| 14 | |||
| 15 | CMS_verify_receipt() verifies a CMS signed receipt. B<rcms> is the signed | ||
| 16 | receipt to verify. B<ocms> is the original SignedData structure containing the | ||
| 17 | receipt request. B<certs> is a set of certificates in which to search for the | ||
| 18 | signing certificate. B<store> is a trusted certificate store (used for chain | ||
| 19 | verification). | ||
| 20 | |||
| 21 | B<flags> is an optional set of flags, which can be used to modify the verify | ||
| 22 | operation. | ||
| 23 | |||
| 24 | =head1 NOTES | ||
| 25 | |||
| 26 | This functions behaves in a similar way to CMS_verify() except the flag values | ||
| 27 | B<CMS_DETACHED>, B<CMS_BINARY>, B<CMS_TEXT> and B<CMS_STREAM> are not | ||
| 28 | supported since they do not make sense in the context of signed receipts. | ||
| 29 | |||
| 30 | =head1 RETURN VALUES | ||
| 31 | |||
| 32 | CMS_verify_receipt() returns 1 for a successful verification and zero if an | ||
| 33 | error occurred. | ||
| 34 | |||
| 35 | The error can be obtained from L<ERR_get_error(3)|ERR_get_error(3)> | ||
| 36 | |||
| 37 | =head1 SEE ALSO | ||
| 38 | |||
| 39 | L<ERR_get_error(3)|ERR_get_error(3)>, | ||
| 40 | L<CMS_sign_receipt(3)|CMS_sign_receipt(3)>, | ||
| 41 | L<CMS_verify(3)|CMS_verify(3)>, | ||
| 42 | |||
| 43 | =head1 HISTORY | ||
| 44 | |||
| 45 | CMS_verify_receipt() was added to OpenSSL 0.9.8 | ||
| 46 | |||
| 47 | =cut | ||
