Fix crash and latest update.
This commit is contained in:
@@ -18,6 +18,7 @@ B<openssl list>
|
||||
[B<-cipher-algorithms>]
|
||||
[B<-public-key-algorithms>]
|
||||
[B<-public-key-methods>]
|
||||
[B<-engines>]
|
||||
[B<-disabled>]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
@@ -80,6 +81,10 @@ a block of multiple lines, all but the first are indented.
|
||||
Display a list of public key method OIDs: this also includes public key methods
|
||||
without an associated ASN.1 method, for example, KDF algorithms.
|
||||
|
||||
=item B<-engines>
|
||||
|
||||
Display a list of loaded engines.
|
||||
|
||||
=item B<-disabled>
|
||||
|
||||
Display a list of disabled features, those that were compiled out
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
openssl-mac,
|
||||
mac - perform Message Authentication Code operations
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<openssl mac>
|
||||
[B<-help>]
|
||||
[B<-macopt>]
|
||||
[B<-in filename>]
|
||||
[B<-out filename>]
|
||||
[B<-binary>]
|
||||
B<mac_name>
|
||||
|
||||
B<openssl> I<mac> [B<...>] B<mac_name>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The message authentication code functions output the MAC of a supplied input
|
||||
file.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<-help>
|
||||
|
||||
Print a usage message.
|
||||
|
||||
=item B<-in filename>
|
||||
|
||||
Input filename to calculate a MAC for, or standard input by default.
|
||||
Standard input is used if the filename is '-'.
|
||||
Files are expected to be in binary format, standard input uses hexadecimal text
|
||||
format.
|
||||
|
||||
=item B<-out filename>
|
||||
|
||||
Filename to output to, or standard output by default.
|
||||
|
||||
=item B<-binary>
|
||||
|
||||
Output the MAC in binary form. Uses hexadecimal text format if not specified.
|
||||
|
||||
=item B<-macopt nm:v>
|
||||
|
||||
Passes options to the MAC algorithm.
|
||||
A comprehensive list of controls can be found in the EVP_MAC implementation
|
||||
documentation.
|
||||
Common control strings used by EVP_MAC_ctrl_str() are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<key:string>
|
||||
|
||||
Specifies the MAC key as an alphanumeric string (use if the key contains
|
||||
printable characters only).
|
||||
The string length must conform to any restrictions of the MAC algorithm.
|
||||
A key must be specified for every MAC algorithm.
|
||||
|
||||
=item B<hexkey:string>
|
||||
|
||||
Specifies the MAC key in hexadecimal form (two hex digits per byte).
|
||||
The key length must conform to any restrictions of the MAC algorithm.
|
||||
A key must be specified for every MAC algorithm.
|
||||
|
||||
=item B<digest:string>
|
||||
|
||||
Used by HMAC as an alphanumeric string (use if the key contains printable
|
||||
characters only).
|
||||
The string length must conform to any restrictions of the MAC algorithm.
|
||||
To see the list of supported digests, use the command I<list -digest-commands>.
|
||||
|
||||
=item B<cipher:string>
|
||||
|
||||
Used by CMAC and GMAC to specifiy the cipher algorithm.
|
||||
For CMAC it must be one of AES-128-CBC, AES-192-CBC, AES-256-CBC or
|
||||
DES-EDE3-CBC.
|
||||
For GMAC it should be a GCM mode cipher e.g. AES-128-GCM.
|
||||
|
||||
=item B<iv:string>
|
||||
|
||||
Used by GMAC to specify an IV as an alphanumeric string (use if the IV contains
|
||||
printable characters only).
|
||||
|
||||
=item B<hexiv:string>
|
||||
|
||||
Used by GMAC to specify an IV in hexadecimal form (two hex digits per byte).
|
||||
|
||||
=item B<outlen:int>
|
||||
|
||||
Used by KMAC128 or KMAC256 to specify an output length.
|
||||
The default sizes are 32 or 64 bytes respectively.
|
||||
|
||||
=item B<custom:string>
|
||||
|
||||
Used by KMAC128 or KMAC256 to specify a customization string.
|
||||
The default is the empty string "".
|
||||
|
||||
=back
|
||||
|
||||
=item B<mac_name>
|
||||
|
||||
Specifies the name of a supported MAC algorithm which will be used.
|
||||
To see the list of supported MAC's use the command I<list -mac-algorithms>.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
To create a hex-encoded HMAC-SHA1 MAC of a file and write to stdout: \
|
||||
openssl mac -macopt digest:SHA1 \
|
||||
-macopt hexkey:000102030405060708090A0B0C0D0E0F10111213 \
|
||||
-in msg.bin HMAC
|
||||
|
||||
To create a SipHash MAC from a file with a binary file output: \
|
||||
openssl mac -macopt hexkey:000102030405060708090A0B0C0D0E0F \
|
||||
-in msg.bin -out out.bin -binary SipHash
|
||||
|
||||
To create a hex-encoded CMAC-AES-128-CBC MAC from a file:\
|
||||
openssl mac -macopt cipher:AES-128-CBC \
|
||||
-macopt hexkey:77A77FAF290C1FA30C683DF16BA7A77B \
|
||||
-in msg.bin CMAC
|
||||
|
||||
To create a hex-encoded KMAC128 MAC from a file with a Customisation String
|
||||
'Tag' and output length of 16: \
|
||||
openssl mac -macopt custom:Tag -macopt hexkey:40414243444546 \
|
||||
-macopt outlen:16 -in msg.bin KMAC128
|
||||
|
||||
To create a hex-encoded GMAC-AES-128-GCM with a IV from a file: \
|
||||
openssl mac -macopt cipher:AES-128-GCM -macopt hexiv:E0E00F19FED7BA0136A797F3 \
|
||||
-macopt hexkey:77A77FAF290C1FA30C683DF16BA7A77B -in msg.bin GMAC
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
The MAC mechanisms that are available will depend on the options
|
||||
used when building OpenSSL.
|
||||
The B<list -mac-algorithms> command can be used to list them.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<EVP_MAC(3)>,
|
||||
L<EVP_MAC_CMAC(7)>,
|
||||
L<EVP_MAC_GMAC(7)>,
|
||||
L<EVP_MAC_HMAC(7)>,
|
||||
L<EVP_MAC_KMAC(7)>,
|
||||
L<EVP_MAC_SIPHASH(7)>,
|
||||
L<EVP_MAC_POLY1305(7)>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
||||
Licensed under the OpenSSL license (the "License"). You may not use
|
||||
this file except in compliance with the License. You can obtain a copy
|
||||
in the file LICENSE in the source distribution or at
|
||||
L<https://www.openssl.org/source/license.html>.
|
||||
|
||||
=cut
|
||||
+12
-6
@@ -11,7 +11,7 @@ I<command>
|
||||
[ I<command_opts> ]
|
||||
[ I<command_args> ]
|
||||
|
||||
B<openssl> B<list> [ B<standard-commands> | B<digest-commands> | B<cipher-commands> | B<cipher-algorithms> | B<digest-algorithms> | B<public-key-algorithms>]
|
||||
B<openssl> B<list> [ B<standard-commands> | B<digest-commands> | B<cipher-commands> | B<cipher-algorithms> | B<digest-algorithms> | B<mac-algorithms> | B<public-key-algorithms>]
|
||||
|
||||
B<openssl> B<no->I<XXX> [ I<arbitrary options> ]
|
||||
|
||||
@@ -28,7 +28,7 @@ It can be used for
|
||||
o Creation and management of private keys, public keys and parameters
|
||||
o Public key cryptographic operations
|
||||
o Creation of X.509 certificates, CSRs and CRLs
|
||||
o Calculation of Message Digests
|
||||
o Calculation of Message Digests and Message Authentication Codes
|
||||
o Encryption and Decryption with Ciphers
|
||||
o SSL/TLS Client and Server Tests
|
||||
o Handling of S/MIME signed or encrypted mail
|
||||
@@ -57,8 +57,9 @@ and B<cipher-commands> output a list (one entry per line) of the names
|
||||
of all standard commands, message digest commands, or cipher commands,
|
||||
respectively, that are available in the present B<openssl> utility.
|
||||
|
||||
The list parameters B<cipher-algorithms> and
|
||||
B<digest-algorithms> list all cipher and message digest names, one entry per line. Aliases are listed as:
|
||||
The list parameters B<cipher-algorithms>, B<digest-algorithms>,
|
||||
and B<mac-algorithms> list all cipher, message digest, and message
|
||||
authentication code names, one entry per line. Aliases are listed as:
|
||||
|
||||
from => to
|
||||
|
||||
@@ -106,7 +107,8 @@ CRL to PKCS#7 Conversion.
|
||||
|
||||
=item B<dgst>
|
||||
|
||||
Message Digest Calculation.
|
||||
Message Digest calculation. MAC calculations are superseded by
|
||||
L<mac(1)>.
|
||||
|
||||
=item B<dh>
|
||||
|
||||
@@ -165,6 +167,10 @@ Generation of Private Key or Parameters.
|
||||
|
||||
Generation of RSA Private Key. Superseded by L<genpkey(1)>.
|
||||
|
||||
=item B<mac>
|
||||
|
||||
Message Authentication Code Calculation.
|
||||
|
||||
=item B<nseq>
|
||||
|
||||
Create or examine a Netscape certificate sequence.
|
||||
@@ -606,7 +612,7 @@ L<crl(1)>, L<crl2pkcs7(1)>, L<dgst(1)>,
|
||||
L<dhparam(1)>, L<dsa(1)>, L<dsaparam(1)>,
|
||||
L<ec(1)>, L<ecparam(1)>,
|
||||
L<enc(1)>, L<engine(1)>, L<errstr(1)>, L<gendsa(1)>, L<genpkey(1)>,
|
||||
L<genrsa(1)>, L<nseq(1)>, L<ocsp(1)>,
|
||||
L<genrsa(1)>, L<mac(1)>, L<nseq(1)>, L<ocsp(1)>,
|
||||
L<passwd(1)>,
|
||||
L<pkcs12(1)>, L<pkcs7(1)>, L<pkcs8(1)>,
|
||||
L<pkey(1)>, L<pkeyparam(1)>, L<pkeyutl(1)>, L<prime(1)>,
|
||||
|
||||
+21
-12
@@ -62,7 +62,7 @@ if this option is not specified.
|
||||
This indicates that the input data is raw data, which is not hashed by any
|
||||
message digest algorithm. The user can specify a digest algorithm by using
|
||||
the B<-digest> option. This option can only be used with B<-sign> and
|
||||
B<-verify>.
|
||||
B<-verify> and must be used with the Ed25519 and Ed448 algorithms.
|
||||
|
||||
=item B<-digest algorithm>
|
||||
|
||||
@@ -216,21 +216,18 @@ hash the input data. It is used (by some algorithms) for sanity-checking the
|
||||
lengths of data passed in to the B<pkeyutl> and for creating the structures that
|
||||
make up the signature (e.g. B<DigestInfo> in RSASSA PKCS#1 v1.5 signatures).
|
||||
|
||||
This utility does not hash the input data but rather it will use the data
|
||||
directly as input to the signature algorithm. Depending on the key type,
|
||||
signature type, and mode of padding, the maximum acceptable lengths of input
|
||||
data differ. The signed data can't be longer than the key modulus with RSA. In
|
||||
case of ECDSA and DSA the data shouldn't be longer than the field
|
||||
size, otherwise it will be silently truncated to the field size. In any event
|
||||
the input size must not be larger than the largest supported digest size.
|
||||
This utility does not hash the input data (except where -rawin is used) but
|
||||
rather it will use the data directly as input to the signature algorithm.
|
||||
Depending on the key type, signature type, and mode of padding, the maximum
|
||||
acceptable lengths of input data differ. The signed data can't be longer than
|
||||
the key modulus with RSA. In case of ECDSA and DSA the data shouldn't be longer
|
||||
than the field size, otherwise it will be silently truncated to the field size.
|
||||
In any event the input size must not be larger than the largest supported digest
|
||||
size.
|
||||
|
||||
In other words, if the value of digest is B<sha1> the input should be the 20
|
||||
bytes long binary encoding of the SHA-1 hash function output.
|
||||
|
||||
The Ed25519 and Ed448 signature algorithms are not supported by this utility.
|
||||
They accept non-hashed input, but this utility can only be used to sign hashed
|
||||
input.
|
||||
|
||||
=head1 RSA ALGORITHM
|
||||
|
||||
The RSA algorithm generally supports the encrypt, decrypt, sign,
|
||||
@@ -319,6 +316,18 @@ this digest is assumed by default.
|
||||
The X25519 and X448 algorithms support key derivation only. Currently there are
|
||||
no additional options.
|
||||
|
||||
=head1 Ed25519 and Ed448 ALGORITHMS
|
||||
|
||||
These algorithms only support signing and verifying. OpenSSL only implements the
|
||||
"pure" variants of these algorithms so raw data can be passed directly to them
|
||||
without hashing them first. The option "-rawin" must be used with these
|
||||
algorithms with no "-digest" specified. Additionally OpenSSL only supports
|
||||
"oneshot" operation with these algorithms. This means that the entire file to
|
||||
be signed/verified must be read into memory before processing it. Signing or
|
||||
Verifying very large files should be avoided. Additionally the size of the file
|
||||
must be known for this to work. If the size of the file cannot be determined
|
||||
(for example if the input is stdin) then the sign or verify operation will fail.
|
||||
|
||||
=head1 SM2
|
||||
|
||||
The SM2 algorithm supports sign, verify, encrypt and decrypt operations. For
|
||||
|
||||
@@ -218,7 +218,7 @@ Even though SNI should normally be a DNS name and not an IP address, if
|
||||
B<-servername> is provided then that name will be sent, regardless of whether
|
||||
it is a DNS name or not.
|
||||
|
||||
This option cannot be used in conjuction with B<-noservername>.
|
||||
This option cannot be used in conjunction with B<-noservername>.
|
||||
|
||||
=item B<-noservername>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user