=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/openssl/openssl.1,v retrieving revision 1.75 retrieving revision 1.76 diff -c -r1.75 -r1.76 *** src/usr.bin/openssl/openssl.1 2016/09/17 15:10:50 1.75 --- src/usr.bin/openssl/openssl.1 2016/09/19 12:55:04 1.76 *************** *** 1,4 **** ! .\" $OpenBSD: openssl.1,v 1.75 2016/09/17 15:10:50 deraadt Exp $ .\" ==================================================================== .\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. .\" --- 1,4 ---- ! .\" $OpenBSD: openssl.1,v 1.76 2016/09/19 12:55:04 jmc Exp $ .\" ==================================================================== .\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. .\" *************** *** 112,118 **** .\" .\" OPENSSL .\" ! .Dd $Mdocdate: September 17 2016 $ .Dt OPENSSL 1 .Os .Sh NAME --- 112,118 ---- .\" .\" OPENSSL .\" ! .Dd $Mdocdate: September 19 2016 $ .Dt OPENSSL 1 .Os .Sh NAME *************** *** 4687,4693 **** A previously created time stamp request in DER format that will be printed into the output file. Useful for examining the content of a request in human-readable format. ! .It Fl md4|md5|ripemd160|sha|sha1 The message digest to apply to the data file. It supports all the message digest algorithms that are supported by the .Nm dgst --- 4687,4693 ---- A previously created time stamp request in DER format that will be printed into the output file. Useful for examining the content of a request in human-readable format. ! .It Fl md4 | md5 | ripemd160 | sha | sha1 The message digest to apply to the data file. It supports all the message digest algorithms that are supported by the .Nm dgst *************** *** 5004,5016 **** .It Fl verify Verify the digital signature on the supplied SPKAC. .El - .\" - .\" VERIFY - .\" .Sh VERIFY .nr nS 1 .Nm "openssl verify" - .Bk -words .Op Fl CAfile Ar file .Op Fl CApath Ar directory .Op Fl check_ss_sig --- 5004,5012 ---- *************** *** 5028,5036 **** .Op Fl untrusted Ar file .Op Fl verbose .Op Fl x509_strict - .Op Fl .Op Ar certificates - .Ek .nr nS 0 .Pp The --- 5024,5030 ---- *************** *** 5054,5116 **** A .Ar directory of trusted certificates. ! The certificates should have names of the form ! .Em hash.0 , ! or have symbolic links to them of this form ! ("hash" is the hashed certificate subject name: see the .Fl hash option of the .Nm x509 utility). - The - .Nm c_rehash - script distributed with OpenSSL - will automatically create symbolic links to a directory of certificates. .It Fl crl_check ! Checks end entity certificate validity by attempting to look up a valid CRL. If a valid CRL cannot be found an error occurs. .It Fl crl_check_all ! Checks the validity of all certificates in the chain by attempting to look up valid CRLs. .It Fl explicit_policy ! Set policy variable require-explicit-policy (see RFC 3280 et al). .It Fl extended_crl Enable extended CRL features such as indirect CRLs and alternate CRL signing keys. .It Fl help ! Prints out a usage message. .It Fl ignore_critical ! Normally if an unhandled critical extension is present which is not ! supported by ! .Nm OpenSSL , ! the certificate is rejected (as required by RFC 3280 et al). ! If this option is set, critical extensions are ignored. .It Fl inhibit_any ! Set policy variable inhibit-any-policy (see RFC 3280 et al). .It Fl inhibit_map ! Set policy variable inhibit-policy-mapping (see RFC 3280 et al). .It Fl issuer_checks ! Print out diagnostics relating to searches for the issuer certificate ! of the current certificate. ! This shows why each candidate issuer certificate was rejected. ! However the presence of rejection messages ! does not itself imply that anything is wrong: during the normal ! verify process several rejections may take place. .It Fl policy_check ! Enables certificate policy processing. .It Fl purpose Ar purpose The intended use for the certificate. Without this option no chain verification will be done. Currently accepted uses are ! .Ar sslclient , sslserver , ! .Ar nssslserver , smimesign , ! .Ar smimeencrypt , crlsign , ! .Ar any , and ! .Ar ocsphelper . ! See the ! .Sx VERIFY OPERATION ! section for more information. .It Fl untrusted Ar file A .Ar file --- 5048,5102 ---- A .Ar directory of trusted certificates. ! The certificates, or symbolic links to them, ! should have names of the form ! .Ar hash Ns .0 , ! where ! .Ar hash ! is the hashed certificate subject name ! (see the .Fl hash option of the .Nm x509 utility). .It Fl crl_check ! Check end entity certificate validity by attempting to look up a valid CRL. If a valid CRL cannot be found an error occurs. .It Fl crl_check_all ! Check the validity of all certificates in the chain by attempting to look up valid CRLs. .It Fl explicit_policy ! Set policy variable require-explicit-policy (RFC 3280). .It Fl extended_crl Enable extended CRL features such as indirect CRLs and alternate CRL signing keys. .It Fl help ! Print a usage message. .It Fl ignore_critical ! Ignore critical extensions instead of rejecting the certificate. .It Fl inhibit_any ! Set policy variable inhibit-any-policy (RFC 3280). .It Fl inhibit_map ! Set policy variable inhibit-policy-mapping (RFC 3280). .It Fl issuer_checks ! Print diagnostics relating to searches for the issuer certificate ! of the current certificate ! showing why each candidate issuer certificate was rejected. ! The presence of rejection messages ! does not itself imply that anything is wrong: ! during the normal verify process several rejections may take place. .It Fl policy_check ! Enable certificate policy processing. .It Fl purpose Ar purpose The intended use for the certificate. Without this option no chain verification will be done. Currently accepted uses are ! .Cm sslclient , sslserver , ! .Cm nssslserver , smimesign , ! .Cm smimeencrypt , crlsign , ! .Cm any , and ! .Cm ocsphelper . .It Fl untrusted Ar file A .Ar file *************** *** 5123,5157 **** .It Fl x509_strict Disable workarounds for broken certificates which have to be disabled for strict X.509 compliance. - .It Fl - Marks the last option. - All arguments following this are assumed to be certificate files. - This is useful if the first certificate filename begins with a - .Sq - . .It Ar certificates ! One or more .Ar certificates to verify. If no certificate files are included, an attempt is made to read a certificate from standard input. ! They should all be in PEM format. .El ! .Sh VERIFY OPERATION The .Nm verify program uses the same functions as the internal SSL and S/MIME verification, ! therefore this description applies to these verify operations too. ! .Pp ! There is one crucial difference between the verify operations performed ! by the ! .Nm verify ! program: wherever possible an attempt is made to continue ! after an error, whereas normally the verify operation would halt on the ! first error. This allows all the problems with a certificate chain to be determined. .Pp ! The verify operation consists of a number of separate steps: ! .Pp Firstly a certificate chain is built up starting from the supplied certificate and ending in the root CA. It is an error if the whole chain cannot be built up. --- 5109,5133 ---- .It Fl x509_strict Disable workarounds for broken certificates which have to be disabled for strict X.509 compliance. .It Ar certificates ! One or more PEM .Ar certificates to verify. If no certificate files are included, an attempt is made to read a certificate from standard input. ! If the first certificate filename begins with a dash, ! use a lone dash to mark the last option. .El ! .Pp The .Nm verify program uses the same functions as the internal SSL and S/MIME verification, ! with one crucial difference: ! wherever possible an attempt is made to continue after an error, ! whereas normally the verify operation would halt on the first error. This allows all the problems with a certificate chain to be determined. .Pp ! The verify operation consists of a number of separate steps. Firstly a certificate chain is built up starting from the supplied certificate and ending in the root CA. It is an error if the whole chain cannot be built up. *************** *** 5160,5191 **** If a certificate is found which is its own issuer, it is assumed to be the root CA. .Pp ! The process of ! .Qq looking up the issuer's certificate ! itself involves a number of steps. ! In versions of ! .Nm OpenSSL ! before 0.9.5a the first certificate whose subject name matched the issuer ! of the current certificate was assumed to be the issuer's certificate. ! In ! .Nm OpenSSL ! 0.9.6 and later all certificates whose subject name matches the issuer name of the current certificate are subject to further tests. The relevant authority key identifier components of the current certificate ! .Pq if present ! must match the subject key identifier ! .Pq if present ! and issuer and serial number of the candidate issuer; in addition the ! .Em keyUsage ! extension of the candidate issuer ! .Pq if present ! must permit certificate signing. .Pp The lookup first looks in the list of untrusted certificates and if no match is found the remaining lookups are from the trusted certificates. ! The root CA is always looked up in the trusted certificate list: if the ! certificate to verify is a root certificate, then an exact match must be ! found in the trusted list. .Pp The second operation is to check every untrusted certificate's extensions for consistency with the supplied purpose. --- 5136,5155 ---- If a certificate is found which is its own issuer, it is assumed to be the root CA. .Pp ! All certificates whose subject name matches the issuer name of the current certificate are subject to further tests. The relevant authority key identifier components of the current certificate ! (if present) must match the subject key identifier (if present) ! and issuer and serial number of the candidate issuer; ! in addition the ! .Cm keyUsage ! extension of the candidate issuer (if present) must permit certificate signing. .Pp The lookup first looks in the list of untrusted certificates and if no match is found the remaining lookups are from the trusted certificates. ! The root CA is always looked up in the trusted certificate list: ! if the certificate to verify is a root certificate, ! then an exact match must be found in the trusted list. .Pp The second operation is to check every untrusted certificate's extensions for consistency with the supplied purpose. *************** *** 5198,5232 **** and all other certificates must also be valid CA certificates. The precise extensions required are described in more detail in the ! .Sx X.509 CERTIFICATE EXTENSIONS section below. .Pp The third operation is to check the trust settings on the root CA. The root CA should be trusted for the supplied purpose. ! For compatibility with previous versions of ! .Nm SSLeay ! and ! .Nm OpenSSL , ! a certificate with no trust settings is considered to be valid for all purposes. .Pp The final operation is to check the validity of the certificate chain. The validity period is checked against the current system time and the ! .Em notBefore and ! .Em notAfter dates in the certificate. The certificate signatures are also checked at this point. .Pp If all operations complete successfully, the certificate is considered valid. If any operation fails then the certificate is not valid. - .Sh VERIFY DIAGNOSTICS When a verify operation fails, the output messages can be somewhat cryptic. The general form of the error message is: ! .Bd -unfilled ! \& server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024-bit) ! \& error 24 at 1 depth lookup:invalid CA certificate .Ed .Pp The first line contains the name of the certificate being verified, followed by --- 5162,5191 ---- and all other certificates must also be valid CA certificates. The precise extensions required are described in more detail in the ! .Nm X509 section below. .Pp The third operation is to check the trust settings on the root CA. The root CA should be trusted for the supplied purpose. ! A certificate with no trust settings is considered to be valid for all purposes. .Pp The final operation is to check the validity of the certificate chain. The validity period is checked against the current system time and the ! .Cm notBefore and ! .Cm notAfter dates in the certificate. The certificate signatures are also checked at this point. .Pp If all operations complete successfully, the certificate is considered valid. If any operation fails then the certificate is not valid. When a verify operation fails, the output messages can be somewhat cryptic. The general form of the error message is: ! .Bd -literal ! server.pem: /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024-bit) ! error 24 at 1 depth lookup:invalid CA certificate .Ed .Pp The first line contains the name of the certificate being verified, followed by *************** *** 5240,5380 **** An exhaustive list of the error codes and messages is shown below; this also includes the name of the error code as defined in the header file .In openssl/x509_vfy.h . ! Some of the error codes are defined but never returned: these are described ! as .Qq unused . .Bl -tag -width "XXXX" ! .It Ar "0 X509_V_OK: ok" The operation was successful. ! .It Ar 2 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: unable to get issuer certificate The issuer certificate could not be found: this occurs if the issuer certificate of an untrusted certificate cannot be found. ! .It Ar 3 X509_V_ERR_UNABLE_TO_GET_CRL: unable to get certificate CRL The CRL of a certificate could not be found. ! .It Ar 4 X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: unable to decrypt certificate's signature The certificate signature could not be decrypted. This means that the actual signature value could not be determined rather than it not matching the expected value. This is only meaningful for RSA keys. ! .It Ar 5 X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE: unable to decrypt CRL's signature The CRL signature could not be decrypted: this means that the actual signature value could not be determined rather than it not matching the expected value. Unused. ! .It Ar 6 X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: unable to decode issuer public key The public key in the certificate ! .Em SubjectPublicKeyInfo could not be read. ! .It Ar 7 X509_V_ERR_CERT_SIGNATURE_FAILURE: certificate signature failure The signature of the certificate is invalid. ! .It Ar 8 X509_V_ERR_CRL_SIGNATURE_FAILURE: CRL signature failure The signature of the certificate is invalid. ! .It Ar 9 X509_V_ERR_CERT_NOT_YET_VALID: certificate is not yet valid The certificate is not yet valid: the ! .Em notBefore date is after the current time. ! .It Ar 10 X509_V_ERR_CERT_HAS_EXPIRED: certificate has expired The certificate has expired; that is, the ! .Em notAfter date is before the current time. ! .It Ar 11 X509_V_ERR_CRL_NOT_YET_VALID: CRL is not yet valid The CRL is not yet valid. ! .It Ar 12 X509_V_ERR_CRL_HAS_EXPIRED: CRL has expired The CRL has expired. ! .It Ar 13 X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: format error in certificate's notBefore field The certificate ! .Em notBefore field contains an invalid time. ! .It Ar 14 X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: format error in certificate's notAfter field The certificate ! .Em notAfter field contains an invalid time. ! .It Ar 15 X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: format error in CRL's lastUpdate field The CRL ! .Em lastUpdate field contains an invalid time. ! .It Ar 16 X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: format error in CRL's nextUpdate field The CRL ! .Em nextUpdate field contains an invalid time. ! .It Ar 17 X509_V_ERR_OUT_OF_MEM: out of memory An error occurred trying to allocate memory. This should never happen. ! .It Ar 18 X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: self signed certificate The passed certificate is self-signed and the same certificate cannot be found in the list of trusted certificates. ! .It Ar 19 X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: self signed certificate in certificate chain The certificate chain could be built up using the untrusted certificates but the root could not be found locally. ! .It Ar 20 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: unable to get local issuer certificate The issuer certificate of a locally looked up certificate could not be found. This normally means the list of trusted certificates is not complete. ! .It Ar 21 X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: unable to verify the first certificate No signatures could be verified because the chain contains only one certificate and it is not self-signed. ! .It Ar 22 X509_V_ERR_CERT_CHAIN_TOO_LONG: certificate chain too long The certificate chain length is greater than the supplied maximum depth. Unused. ! .It Ar 23 X509_V_ERR_CERT_REVOKED: certificate revoked The certificate has been revoked. ! .It Ar 24 X509_V_ERR_INVALID_CA: invalid CA certificate A CA certificate is invalid. Either it is not a CA or its extensions are not consistent with the supplied purpose. ! .It Ar 25 X509_V_ERR_PATH_LENGTH_EXCEEDED: path length constraint exceeded The ! .Em basicConstraints pathlength parameter has been exceeded. ! .It Ar 26 X509_V_ERR_INVALID_PURPOSE: unsupported certificate purpose The supplied certificate cannot be used for the specified purpose. ! .It Ar 27 X509_V_ERR_CERT_UNTRUSTED: certificate not trusted The root CA is not marked as trusted for the specified purpose. ! .It Ar 28 X509_V_ERR_CERT_REJECTED: certificate rejected The root CA is marked to reject the specified purpose. ! .It Ar 29 X509_V_ERR_SUBJECT_ISSUER_MISMATCH: subject issuer mismatch The current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate. Only displayed when the .Fl issuer_checks option is set. ! .It Ar 30 X509_V_ERR_AKID_SKID_MISMATCH: authority and subject key identifier mismatch The current candidate issuer certificate was rejected because its subject key identifier was present and did not match the authority key identifier current certificate. Only displayed when the .Fl issuer_checks option is set. ! .It Ar 31 X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH: authority and issuer serial number mismatch The current candidate issuer certificate was rejected because its issuer name and serial number were present and did not match the authority key identifier of the current certificate. Only displayed when the .Fl issuer_checks option is set. ! .It Ar 32 X509_V_ERR_KEYUSAGE_NO_CERTSIGN:key usage does not include certificate signing The current candidate issuer certificate was rejected because its ! .Em keyUsage extension does not permit certificate signing. ! .It Ar 50 X509_V_ERR_APPLICATION_VERIFICATION: application verification failure An application specific error. Unused. .El - .Sh VERIFY BUGS - Although the issuer checks are a considerable improvement over the old - technique, they still suffer from limitations in the underlying - X509_LOOKUP API. - One consequence of this is that trusted certificates with matching subject - name must either appear in a file (as specified by the - .Fl CAfile - option) or a directory (as specified by - .Fl CApath ) . - If they occur in both, only the certificates in the file will - be recognised. - .Pp - Previous versions of - .Nm OpenSSL - assumed certificates with matching subject name were identical and - mishandled them. .\" .\" VERSION .\" --- 5199,5322 ---- An exhaustive list of the error codes and messages is shown below; this also includes the name of the error code as defined in the header file .In openssl/x509_vfy.h . ! Some of the error codes are defined but never returned: these are described as .Qq unused . .Bl -tag -width "XXXX" ! .It "0 X509_V_OK: ok" The operation was successful. ! .It 2 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: unable to get issuer certificate The issuer certificate could not be found: this occurs if the issuer certificate of an untrusted certificate cannot be found. ! .It 3 X509_V_ERR_UNABLE_TO_GET_CRL: unable to get certificate CRL The CRL of a certificate could not be found. ! .It 4 X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE: unable to decrypt certificate's signature The certificate signature could not be decrypted. This means that the actual signature value could not be determined rather than it not matching the expected value. This is only meaningful for RSA keys. ! .It 5 X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE: unable to decrypt CRL's signature The CRL signature could not be decrypted: this means that the actual signature value could not be determined rather than it not matching the expected value. Unused. ! .It 6 X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY: unable to decode issuer public key The public key in the certificate ! .Cm SubjectPublicKeyInfo could not be read. ! .It 7 X509_V_ERR_CERT_SIGNATURE_FAILURE: certificate signature failure The signature of the certificate is invalid. ! .It 8 X509_V_ERR_CRL_SIGNATURE_FAILURE: CRL signature failure The signature of the certificate is invalid. ! .It 9 X509_V_ERR_CERT_NOT_YET_VALID: certificate is not yet valid The certificate is not yet valid: the ! .Cm notBefore date is after the current time. ! .It 10 X509_V_ERR_CERT_HAS_EXPIRED: certificate has expired The certificate has expired; that is, the ! .Cm notAfter date is before the current time. ! .It 11 X509_V_ERR_CRL_NOT_YET_VALID: CRL is not yet valid The CRL is not yet valid. ! .It 12 X509_V_ERR_CRL_HAS_EXPIRED: CRL has expired The CRL has expired. ! .It 13 X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD: format error in certificate's notBefore field The certificate ! .Cm notBefore field contains an invalid time. ! .It 14 X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD: format error in certificate's notAfter field The certificate ! .Cm notAfter field contains an invalid time. ! .It 15 X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD: format error in CRL's lastUpdate field The CRL ! .Cm lastUpdate field contains an invalid time. ! .It 16 X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD: format error in CRL's nextUpdate field The CRL ! .Cm nextUpdate field contains an invalid time. ! .It 17 X509_V_ERR_OUT_OF_MEM: out of memory An error occurred trying to allocate memory. This should never happen. ! .It 18 X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: self signed certificate The passed certificate is self-signed and the same certificate cannot be found in the list of trusted certificates. ! .It 19 X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: self signed certificate in certificate chain The certificate chain could be built up using the untrusted certificates but the root could not be found locally. ! .It 20 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: unable to get local issuer certificate The issuer certificate of a locally looked up certificate could not be found. This normally means the list of trusted certificates is not complete. ! .It 21 X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE: unable to verify the first certificate No signatures could be verified because the chain contains only one certificate and it is not self-signed. ! .It 22 X509_V_ERR_CERT_CHAIN_TOO_LONG: certificate chain too long The certificate chain length is greater than the supplied maximum depth. Unused. ! .It 23 X509_V_ERR_CERT_REVOKED: certificate revoked The certificate has been revoked. ! .It 24 X509_V_ERR_INVALID_CA: invalid CA certificate A CA certificate is invalid. Either it is not a CA or its extensions are not consistent with the supplied purpose. ! .It 25 X509_V_ERR_PATH_LENGTH_EXCEEDED: path length constraint exceeded The ! .Cm basicConstraints pathlength parameter has been exceeded. ! .It 26 X509_V_ERR_INVALID_PURPOSE: unsupported certificate purpose The supplied certificate cannot be used for the specified purpose. ! .It 27 X509_V_ERR_CERT_UNTRUSTED: certificate not trusted The root CA is not marked as trusted for the specified purpose. ! .It 28 X509_V_ERR_CERT_REJECTED: certificate rejected The root CA is marked to reject the specified purpose. ! .It 29 X509_V_ERR_SUBJECT_ISSUER_MISMATCH: subject issuer mismatch The current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate. Only displayed when the .Fl issuer_checks option is set. ! .It 30 X509_V_ERR_AKID_SKID_MISMATCH: authority and subject key identifier mismatch The current candidate issuer certificate was rejected because its subject key identifier was present and did not match the authority key identifier current certificate. Only displayed when the .Fl issuer_checks option is set. ! .It 31 X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH: authority and issuer serial number mismatch The current candidate issuer certificate was rejected because its issuer name and serial number were present and did not match the authority key identifier of the current certificate. Only displayed when the .Fl issuer_checks option is set. ! .It 32 X509_V_ERR_KEYUSAGE_NO_CERTSIGN:key usage does not include certificate signing The current candidate issuer certificate was rejected because its ! .Cm keyUsage extension does not permit certificate signing. ! .It 50 X509_V_ERR_APPLICATION_VERIFICATION: application verification failure An application specific error. Unused. .El .\" .\" VERSION .\"