Latest update.
This commit is contained in:
+45
-15
@@ -24,6 +24,14 @@ OpenSSL 3.0
|
|||||||
|
|
||||||
### Changes between 1.1.1 and 3.0 [xx XXX xxxx] ###
|
### Changes between 1.1.1 and 3.0 [xx XXX xxxx] ###
|
||||||
|
|
||||||
|
* Deprecated EC_POINT_set_Jprojective_coordinates_GFp() and
|
||||||
|
EC_POINT_get_Jprojective_coordinates_GFp(). These functions are not widely
|
||||||
|
used and applications should instead use the
|
||||||
|
L<EC_POINT_set_affine_coordinates(3)> and
|
||||||
|
L<EC_POINT_get_affine_coordinates(3)> functions.
|
||||||
|
|
||||||
|
*Billy Bob Brumley*
|
||||||
|
|
||||||
* Added OSSL_PARAM_BLD to the public interface. This allows OSSL_PARAM
|
* Added OSSL_PARAM_BLD to the public interface. This allows OSSL_PARAM
|
||||||
arrays to be more easily constructed via a series of utility functions.
|
arrays to be more easily constructed via a series of utility functions.
|
||||||
Create a parameter builder using OSSL_PARAM_BLD_new(), add parameters using
|
Create a parameter builder using OSSL_PARAM_BLD_new(), add parameters using
|
||||||
@@ -79,10 +87,17 @@ OpenSSL 3.0
|
|||||||
|
|
||||||
*Richard Levitte*
|
*Richard Levitte*
|
||||||
|
|
||||||
* The command line utilities ecparam and ec have been deprecated. Instead
|
* Added an implementation of CMP and CRMF (RFC 4210, RFC 4211 RFC 6712).
|
||||||
use the pkeyparam, pkey and genpkey programs.
|
This adds crypto/cmp/, crpyto/crmf/, and test/cmp_*.
|
||||||
|
See L<OSSL_CMP_exec_IR_ses(3)> as starting point.
|
||||||
|
|
||||||
*Paul Dale*
|
*David von Oheimb*
|
||||||
|
|
||||||
|
* Generalized the HTTP client code from crypto/ocsp/ into crpyto/http/.
|
||||||
|
The legacy OCSP-focused and only partly documented API is retained.
|
||||||
|
See L<OSSL_CMP_MSG_http_perform(3)> etc. for details.
|
||||||
|
|
||||||
|
*David von Oheimb*
|
||||||
|
|
||||||
* All of the low level RSA functions have been deprecated including:
|
* All of the low level RSA functions have been deprecated including:
|
||||||
|
|
||||||
@@ -138,25 +153,35 @@ OpenSSL 3.0
|
|||||||
*Kurt Roeckx*
|
*Kurt Roeckx*
|
||||||
|
|
||||||
* The command line utilities dhparam, dsa, gendsa and dsaparam have been
|
* The command line utilities dhparam, dsa, gendsa and dsaparam have been
|
||||||
deprecated. Instead use the pkeyparam, pkey, genpkey and pkeyparam
|
modified to use PKEY APIs. These commands are now in maintenance mode
|
||||||
programs respectively.
|
and no new features will be added to them.
|
||||||
|
|
||||||
|
*Paul Dale*
|
||||||
|
|
||||||
|
* The command line utility rsautl has been deprecated.
|
||||||
|
Instead use the pkeyutl program.
|
||||||
|
|
||||||
|
*Paul Dale*
|
||||||
|
|
||||||
|
* The command line utilities genrsa and rsa have been modified to use PKEY
|
||||||
|
APIs These commands are now in maintenance mode and no new features will
|
||||||
|
be added to them.
|
||||||
|
|
||||||
*Paul Dale*
|
*Paul Dale*
|
||||||
|
|
||||||
* All of the low level DH functions have been deprecated including:
|
* All of the low level DH functions have been deprecated including:
|
||||||
|
|
||||||
DH_OpenSSL, DH_set_default_method, DH_get_default_method, DH_set_method,
|
DH_OpenSSL, DH_set_default_method, DH_get_default_method,
|
||||||
DH_new_method, DH_bits, DH_size, DH_security_bits, DH_get_ex_new_index,
|
DH_set_method, DH_new_method, DH_bits, DH_size, DH_security_bits,
|
||||||
DH_set_ex_data, DH_get_ex_data, DH_generate_parameters_ex,
|
DH_get_ex_new_index, DH_set_ex_data, DH_get_ex_data,
|
||||||
DH_check_params_ex, DH_check_ex, DH_check_pub_key_ex,
|
DH_generate_parameters_ex, DH_check_params_ex, DH_check_ex,
|
||||||
DH_check, DH_check_pub_key, DH_generate_key, DH_compute_key,
|
DH_check_pub_key_ex, DH_check, DH_check_pub_key, DH_generate_key,
|
||||||
DH_compute_key_padded, DHparams_print_fp, DHparams_print, DH_get_nid,
|
DH_compute_key, DH_compute_key_padded, DHparams_print_fp,
|
||||||
DH_KDF_X9_42, DH_get0_engine, DH_get_length, DH_set_length, DH_meth_new,
|
DHparams_print, DH_get_nid, DH_KDF_X9_42, DH_get0_engine, DH_meth_new,
|
||||||
DH_meth_free, DH_meth_dup, DH_meth_get0_name, DH_meth_set1_name,
|
DH_meth_free, DH_meth_dup, DH_meth_get0_name, DH_meth_set1_name,
|
||||||
DH_meth_get_flags, DH_meth_set_flags, DH_meth_get0_app_data,
|
DH_meth_get_flags, DH_meth_set_flags, DH_meth_get0_app_data,
|
||||||
DH_meth_set0_app_data, DH_meth_get_generate_key,
|
DH_meth_set0_app_data, DH_meth_get_generate_key, DH_meth_set_generate_key,
|
||||||
DH_meth_set_generate_key, DH_meth_get_compute_key,
|
DH_meth_get_compute_key, DH_meth_set_compute_key, DH_meth_get_bn_mod_exp,
|
||||||
DH_meth_set_compute_key, DH_meth_get_bn_mod_exp,
|
|
||||||
DH_meth_set_bn_mod_exp, DH_meth_get_init, DH_meth_set_init,
|
DH_meth_set_bn_mod_exp, DH_meth_get_init, DH_meth_set_init,
|
||||||
DH_meth_get_finish, DH_meth_set_finish, DH_meth_get_generate_params
|
DH_meth_get_finish, DH_meth_set_finish, DH_meth_get_generate_params
|
||||||
and DH_meth_set_generate_params.
|
and DH_meth_set_generate_params.
|
||||||
@@ -393,6 +418,11 @@ OpenSSL 3.0
|
|||||||
|
|
||||||
*Rich Salz*
|
*Rich Salz*
|
||||||
|
|
||||||
|
* Added documentation for the STACK API. OpenSSL only defines the STACK
|
||||||
|
functions where they are used.
|
||||||
|
|
||||||
|
*Rich Salz*
|
||||||
|
|
||||||
* Introduced a new method type and API, OSSL_SERIALIZER, to
|
* Introduced a new method type and API, OSSL_SERIALIZER, to
|
||||||
represent generic serializers. An implementation is expected to
|
represent generic serializers. An implementation is expected to
|
||||||
be able to serialize an object associated with a given name (such
|
be able to serialize an object associated with a given name (such
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ my %targets=(
|
|||||||
includes => [],
|
includes => [],
|
||||||
lib_cflags => "",
|
lib_cflags => "",
|
||||||
lib_cppflags => "",
|
lib_cppflags => "",
|
||||||
lib_defines => [ 'OPENSSL_BUILDING_OPENSSL' ],
|
lib_defines => [],
|
||||||
thread_scheme => "(unknown)", # Assume we don't know
|
thread_scheme => "(unknown)", # Assume we don't know
|
||||||
thread_defines => [],
|
thread_defines => [],
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ my %targets=(
|
|||||||
|
|
||||||
defines =>
|
defines =>
|
||||||
sub {
|
sub {
|
||||||
my @defs = ();
|
my @defs = ( 'OPENSSL_BUILDING_OPENSSL' );
|
||||||
push @defs, "ZLIB" unless $disabled{zlib};
|
push @defs, "ZLIB" unless $disabled{zlib};
|
||||||
push @defs, "ZLIB_SHARED" unless $disabled{"zlib-dynamic"};
|
push @defs, "ZLIB_SHARED" unless $disabled{"zlib-dynamic"};
|
||||||
return [ @defs ];
|
return [ @defs ];
|
||||||
|
|||||||
@@ -50,6 +50,10 @@
|
|||||||
grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
|
grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
|
||||||
&& $unified_info{attributes}->{modules}->{$_}->{engine} }
|
&& $unified_info{attributes}->{modules}->{$_}->{engine} }
|
||||||
@{$unified_info{modules}};
|
@{$unified_info{modules}};
|
||||||
|
our @install_modules =
|
||||||
|
grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
|
||||||
|
&& !$unified_info{attributes}->{modules}->{$_}->{engine} }
|
||||||
|
@{$unified_info{modules}};
|
||||||
our @install_programs =
|
our @install_programs =
|
||||||
grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
|
grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
|
||||||
@{$unified_info{programs}};
|
@{$unified_info{programs}};
|
||||||
@@ -132,6 +136,7 @@ GENERATED={- # common0.tmpl provides @generated
|
|||||||
INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @install_libs) -}
|
INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @install_libs) -}
|
||||||
INSTALL_SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @install_shlibs) -}
|
INSTALL_SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @install_shlibs) -}
|
||||||
INSTALL_ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @install_engines) -}
|
INSTALL_ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @install_engines) -}
|
||||||
|
INSTALL_MODULES={- join(", ", map { "-\n\t".$_.".EXE" } @install_modules) -}
|
||||||
INSTALL_PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @install_programs) -}
|
INSTALL_PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @install_programs) -}
|
||||||
BIN_SCRIPTS={- join(", ", @install_bin_scripts) -}
|
BIN_SCRIPTS={- join(", ", @install_bin_scripts) -}
|
||||||
MISC_SCRIPTS={- join(", ", @install_misc_scripts) -}
|
MISC_SCRIPTS={- join(", ", @install_misc_scripts) -}
|
||||||
@@ -521,11 +526,11 @@ descrip.mms : FORCE
|
|||||||
|
|
||||||
# Install helper targets #############################################
|
# Install helper targets #############################################
|
||||||
|
|
||||||
install_sw : install_dev install_engines install_runtime -
|
install_sw : install_dev install_engines install_modules -
|
||||||
install_startup install_ivp
|
install_runtime install_startup install_ivp
|
||||||
|
|
||||||
uninstall_sw : uninstall_dev uninstall_engines uninstall_runtime -
|
uninstall_sw : uninstall_dev uninstall_modules uninstall_engines -
|
||||||
uninstall_startup uninstall_ivp
|
uninstall_runtime uninstall_startup uninstall_ivp
|
||||||
|
|
||||||
install_docs : install_html_docs
|
install_docs : install_html_docs
|
||||||
|
|
||||||
@@ -566,13 +571,22 @@ install_dev : check_INSTALLTOP install_runtime_libs
|
|||||||
|
|
||||||
install_engines : check_INSTALLTOP install_runtime_libs build_modules
|
install_engines : check_INSTALLTOP install_runtime_libs build_modules
|
||||||
@ {- output_off() unless scalar @install_engines; "" -} !
|
@ {- output_off() unless scalar @install_engines; "" -} !
|
||||||
@ WRITE SYS$OUTPUT "*** Installing ENGINE modules"
|
@ WRITE SYS$OUTPUT "*** Installing engines"
|
||||||
- CREATE/DIR ossl_installroot:[ENGINES{- $sover_dirname.$target{pointer_size} -}.'arch']
|
- CREATE/DIR ossl_installroot:[ENGINES{- $sover_dirname.$target{pointer_size} -}.'arch']
|
||||||
{- join("\n ",
|
{- join("\n ",
|
||||||
map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[ENGINES$sover_dirname$target{pointer_size}.'arch']" }
|
map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[ENGINES$sover_dirname$target{pointer_size}.'arch']" }
|
||||||
@install_engines) -}
|
@install_engines) -}
|
||||||
@ {- output_on() unless scalar @install_engines; "" -} !
|
@ {- output_on() unless scalar @install_engines; "" -} !
|
||||||
|
|
||||||
|
install_modules : check_INSTALLTOP install_runtime_libs build_modules
|
||||||
|
@ {- output_off() unless scalar @install_modules; "" -} !
|
||||||
|
@ WRITE SYS$OUTPUT "*** Installing modules"
|
||||||
|
- CREATE/DIR ossl_installroot:[MODULES{- $sover_dirname.$target{pointer_size} -}.'arch']
|
||||||
|
{- join("\n ",
|
||||||
|
map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[MODULES$sover_dirname$target{pointer_size}.'arch']" }
|
||||||
|
@install_modules) -}
|
||||||
|
@ {- output_on() unless scalar @install_modules; "" -} !
|
||||||
|
|
||||||
install_runtime : install_programs
|
install_runtime : install_programs
|
||||||
|
|
||||||
install_runtime_libs : check_INSTALLTOP build_libs
|
install_runtime_libs : check_INSTALLTOP build_libs
|
||||||
|
|||||||
@@ -138,6 +138,14 @@ INSTALL_ENGINES={-
|
|||||||
&& $unified_info{attributes}->{modules}->{$_}->{engine} }
|
&& $unified_info{attributes}->{modules}->{$_}->{engine} }
|
||||||
@{$unified_info{modules}}))
|
@{$unified_info{modules}}))
|
||||||
-}
|
-}
|
||||||
|
INSTALL_MODULES={-
|
||||||
|
join(" \\\n" . ' ' x 16,
|
||||||
|
fill_lines(" ", $COLUMNS - 16,
|
||||||
|
map { platform->dso($_) }
|
||||||
|
grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
|
||||||
|
&& !$unified_info{attributes}->{modules}->{$_}->{engine} }
|
||||||
|
@{$unified_info{modules}}))
|
||||||
|
-}
|
||||||
INSTALL_PROGRAMS={-
|
INSTALL_PROGRAMS={-
|
||||||
join(" \\\n" . ' ' x 16,
|
join(" \\\n" . ' ' x 16,
|
||||||
fill_lines(" ", $COLUMNS - 16, map { platform->bin($_) }
|
fill_lines(" ", $COLUMNS - 16, map { platform->bin($_) }
|
||||||
@@ -532,9 +540,9 @@ depend:
|
|||||||
|
|
||||||
# Install helper targets #############################################
|
# Install helper targets #############################################
|
||||||
|
|
||||||
install_sw: install_dev install_engines install_runtime
|
install_sw: install_dev install_engines install_modules install_runtime
|
||||||
|
|
||||||
uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
|
uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev
|
||||||
|
|
||||||
install_docs: install_man_docs install_html_docs
|
install_docs: install_man_docs install_html_docs
|
||||||
|
|
||||||
@@ -702,10 +710,12 @@ uninstall_dev: uninstall_runtime_libs
|
|||||||
-$(RMDIR) $(DESTDIR)$(libdir)/pkgconfig
|
-$(RMDIR) $(DESTDIR)$(libdir)/pkgconfig
|
||||||
-$(RMDIR) $(DESTDIR)$(libdir)
|
-$(RMDIR) $(DESTDIR)$(libdir)
|
||||||
|
|
||||||
install_engines: install_runtime_libs build_modules
|
_install_modules_deps: install_runtime_libs build_modules
|
||||||
|
|
||||||
|
install_engines: _install_modules_deps
|
||||||
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
||||||
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/
|
||||||
@$(ECHO) "*** Installing ENGINE modules"
|
@$(ECHO) "*** Installing engines"
|
||||||
@set -e; for e in dummy $(INSTALL_ENGINES); do \
|
@set -e; for e in dummy $(INSTALL_ENGINES); do \
|
||||||
if [ "$$e" = "dummy" ]; then continue; fi; \
|
if [ "$$e" = "dummy" ]; then continue; fi; \
|
||||||
fn=`basename $$e`; \
|
fn=`basename $$e`; \
|
||||||
@@ -717,7 +727,7 @@ install_engines: install_runtime_libs build_modules
|
|||||||
done
|
done
|
||||||
|
|
||||||
uninstall_engines:
|
uninstall_engines:
|
||||||
@$(ECHO) "*** Uninstalling ENGINE modules"
|
@$(ECHO) "*** Uninstalling engines"
|
||||||
@set -e; for e in dummy $(INSTALL_ENGINES); do \
|
@set -e; for e in dummy $(INSTALL_ENGINES); do \
|
||||||
if [ "$$e" = "dummy" ]; then continue; fi; \
|
if [ "$$e" = "dummy" ]; then continue; fi; \
|
||||||
fn=`basename $$e`; \
|
fn=`basename $$e`; \
|
||||||
@@ -729,6 +739,33 @@ uninstall_engines:
|
|||||||
done
|
done
|
||||||
-$(RMDIR) $(DESTDIR)$(ENGINESDIR)
|
-$(RMDIR) $(DESTDIR)$(ENGINESDIR)
|
||||||
|
|
||||||
|
install_modules: _install_modules_deps
|
||||||
|
@[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
|
||||||
|
@$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MODULESDIR)/
|
||||||
|
@$(ECHO) "*** Installing modules"
|
||||||
|
@set -e; for e in dummy $(INSTALL_MODULES); do \
|
||||||
|
if [ "$$e" = "dummy" ]; then continue; fi; \
|
||||||
|
fn=`basename $$e`; \
|
||||||
|
$(ECHO) "install $$e -> $(DESTDIR)$(MODULESDIR)/$$fn"; \
|
||||||
|
cp $$e $(DESTDIR)$(MODULESDIR)/$$fn.new; \
|
||||||
|
chmod 755 $(DESTDIR)$(MODULESDIR)/$$fn.new; \
|
||||||
|
mv -f $(DESTDIR)$(MODULESDIR)/$$fn.new \
|
||||||
|
$(DESTDIR)$(MODULESDIR)/$$fn; \
|
||||||
|
done
|
||||||
|
|
||||||
|
uninstall_modules:
|
||||||
|
@$(ECHO) "*** Uninstalling modules"
|
||||||
|
@set -e; for e in dummy $(INSTALL_MODULES); do \
|
||||||
|
if [ "$$e" = "dummy" ]; then continue; fi; \
|
||||||
|
fn=`basename $$e`; \
|
||||||
|
if [ "$$fn" = '{- platform->dso("ossltest") -}' ]; then \
|
||||||
|
continue; \
|
||||||
|
fi; \
|
||||||
|
$(ECHO) "$(RM) $(DESTDIR)$(MODULESDIR)/$$fn"; \
|
||||||
|
$(RM) $(DESTDIR)$(MODULESDIR)/$$fn; \
|
||||||
|
done
|
||||||
|
-$(RMDIR) $(DESTDIR)$(MODULESDIR)
|
||||||
|
|
||||||
install_runtime: install_programs
|
install_runtime: install_programs
|
||||||
|
|
||||||
install_runtime_libs: build_libs
|
install_runtime_libs: build_libs
|
||||||
@@ -983,6 +1020,7 @@ generate_crypto_objects:
|
|||||||
crypto/objects/obj_mac.num \
|
crypto/objects/obj_mac.num \
|
||||||
crypto/objects/obj_xref.txt \
|
crypto/objects/obj_xref.txt \
|
||||||
> crypto/objects/obj_xref.h )
|
> crypto/objects/obj_xref.h )
|
||||||
|
( cd $(SRCDIR); cat crypto/objects/obj_compat.h >> include/openssl/obj_mac.h )
|
||||||
|
|
||||||
generate_crypto_conf:
|
generate_crypto_conf:
|
||||||
( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
|
( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
|
||||||
|
|||||||
@@ -94,6 +94,20 @@ INSTALL_ENGINEPDBS={-
|
|||||||
&& $unified_info{attributes}->{modules}->{$_}->{engine} }
|
&& $unified_info{attributes}->{modules}->{$_}->{engine} }
|
||||||
@{$unified_info{modules}})
|
@{$unified_info{modules}})
|
||||||
-}
|
-}
|
||||||
|
INSTALL_MODULES={-
|
||||||
|
join(" \\\n" . ' ' x 16,
|
||||||
|
fill_lines(" ", $COLUMNS - 16,
|
||||||
|
map { platform->dso($_) }
|
||||||
|
grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
|
||||||
|
&& !$unified_info{attributes}->{modules}->{$_}->{engine} }
|
||||||
|
@{$unified_info{modules}}))
|
||||||
|
-}
|
||||||
|
INSTALL_MODULEPDBS={-
|
||||||
|
join(" ", map { quotify1(platform->dsopdb($_)) }
|
||||||
|
grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
|
||||||
|
&& !$unified_info{attributes}->{modules}->{$_}->{engine} }
|
||||||
|
@{$unified_info{modules}})
|
||||||
|
-}
|
||||||
INSTALL_PROGRAMS={-
|
INSTALL_PROGRAMS={-
|
||||||
join(" ", map { quotify1(platform->bin($_)) }
|
join(" ", map { quotify1(platform->bin($_)) }
|
||||||
grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
|
grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
|
||||||
@@ -441,9 +455,9 @@ depend:
|
|||||||
|
|
||||||
# Install helper targets #############################################
|
# Install helper targets #############################################
|
||||||
|
|
||||||
install_sw: install_dev install_engines install_runtime
|
install_sw: install_dev install_engines install_modules install_runtime
|
||||||
|
|
||||||
uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
|
uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev
|
||||||
|
|
||||||
install_docs: install_html_docs
|
install_docs: install_html_docs
|
||||||
|
|
||||||
@@ -487,9 +501,11 @@ install_dev: install_runtime_libs
|
|||||||
|
|
||||||
uninstall_dev:
|
uninstall_dev:
|
||||||
|
|
||||||
install_engines: install_runtime_libs build_modules
|
_install_modules_deps: install_runtime_libs build_modules
|
||||||
|
|
||||||
|
install_engines: _install_modules_deps
|
||||||
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
|
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
|
||||||
@$(ECHO) "*** Installing ENGINE modules"
|
@$(ECHO) "*** Installing engines"
|
||||||
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)"
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)"
|
||||||
@if not "$(INSTALL_ENGINES)"=="" \
|
@if not "$(INSTALL_ENGINES)"=="" \
|
||||||
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)"
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)"
|
||||||
@@ -498,6 +514,17 @@ install_engines: install_runtime_libs build_modules
|
|||||||
|
|
||||||
uninstall_engines:
|
uninstall_engines:
|
||||||
|
|
||||||
|
install_modules: _install_modules_deps
|
||||||
|
@if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
|
||||||
|
@$(ECHO) "*** Installing modules"
|
||||||
|
@"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(MODULESDIR)"
|
||||||
|
@if not "$(INSTALL_MODULES)"=="" \
|
||||||
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_MODULES) "$(MODULESDIR)"
|
||||||
|
@if not "$(INSTALL_MODULES)"=="" \
|
||||||
|
"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_MODULEPDBS) "$(MODULESDIR)"
|
||||||
|
|
||||||
|
uninstall_modules:
|
||||||
|
|
||||||
install_runtime: install_programs
|
install_runtime: install_programs
|
||||||
|
|
||||||
install_runtime_libs: build_libs
|
install_runtime_libs: build_libs
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# -*- mode: perl; -*-
|
# -*- mode: perl; -*-
|
||||||
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -286,7 +286,13 @@ collect_information(
|
|||||||
qr/\s*(\w+)\s*=\s*(.*?)\s*$/ =>
|
qr/\s*(\w+)\s*=\s*(.*?)\s*$/ =>
|
||||||
sub {
|
sub {
|
||||||
# Only define it if there is a value at all
|
# Only define it if there is a value at all
|
||||||
$version{uc $1} = $2 if $2 ne '';
|
if ($2 ne '') {
|
||||||
|
my $k = $1;
|
||||||
|
my $v = $2;
|
||||||
|
# Some values are quoted. Trim the quotes
|
||||||
|
$v = $1 if $v =~ /^"(.*)"$/;
|
||||||
|
$version{uc $k} = $v;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"OTHERWISE" =>
|
"OTHERWISE" =>
|
||||||
sub { die "Something wrong with this line:\n$_\nin $srcdir/VERSION" },
|
sub { die "Something wrong with this line:\n$_\nin $srcdir/VERSION" },
|
||||||
@@ -518,7 +524,7 @@ my @disable_cascades = (
|
|||||||
"ssl3-method" => [ "ssl3" ],
|
"ssl3-method" => [ "ssl3" ],
|
||||||
"zlib" => [ "zlib-dynamic" ],
|
"zlib" => [ "zlib-dynamic" ],
|
||||||
"des" => [ "mdc2" ],
|
"des" => [ "mdc2" ],
|
||||||
"ec" => [ "ecdsa", "ecdh", "sm2" ],
|
"ec" => [ "ecdsa", "ecdh", "sm2", "gost" ],
|
||||||
sub { $disabled{"ec"} && $disabled{"dh"} }
|
sub { $disabled{"ec"} && $disabled{"dh"} }
|
||||||
=> [ "tls1_3" ],
|
=> [ "tls1_3" ],
|
||||||
"dgram" => [ "dtls", "sctp" ],
|
"dgram" => [ "dtls", "sctp" ],
|
||||||
|
|||||||
+18
-3
@@ -207,6 +207,9 @@ To avoid breaking other applications, install your copy of OpenSSL to a
|
|||||||
[different location](#installing-to-a-different-location) which is not in
|
[different location](#installing-to-a-different-location) which is not in
|
||||||
the global search path for system libraries.
|
the global search path for system libraries.
|
||||||
|
|
||||||
|
Finally, if you plan on using the FIPS module, you need to read the
|
||||||
|
[Post-installation Notes](#post-installation-notes) further down.
|
||||||
|
|
||||||
### Unix / Linux / macOS ###
|
### Unix / Linux / macOS ###
|
||||||
|
|
||||||
Depending on your distribution, you need to run the following command as
|
Depending on your distribution, you need to run the following command as
|
||||||
@@ -861,11 +864,11 @@ never be used in production environments. It will only work when used with gcc
|
|||||||
or clang and should be used in conjunction with the `-DPEDANTIC` option
|
or clang and should be used in conjunction with the `-DPEDANTIC` option
|
||||||
(or the `--strict-warnings` option).
|
(or the `--strict-warnings` option).
|
||||||
|
|
||||||
### no-ui ###
|
### no-ui-console ###
|
||||||
|
|
||||||
Don't build with the User Interface (UI) capability
|
Don't build with the User Interface (UI) console method
|
||||||
|
|
||||||
The User Interface is the set of features enabling text based prompts.
|
The User Interface console method enables text based console prompts.
|
||||||
|
|
||||||
### enable-unit-test ###
|
### enable-unit-test ###
|
||||||
|
|
||||||
@@ -1344,6 +1347,18 @@ Some APIs have changed as well. However, older APIs have been preserved when
|
|||||||
possible.
|
possible.
|
||||||
|
|
||||||
|
|
||||||
|
Post-installation Notes
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
With the default OpenSSL installation comes a FIPS provider module, which
|
||||||
|
needs some post-installation attention, without which it will not be usable.
|
||||||
|
This involves using the following command:
|
||||||
|
|
||||||
|
openssl fipsinstall
|
||||||
|
|
||||||
|
See the openssl-fipsinstall(1) manual for details and examples.
|
||||||
|
|
||||||
|
|
||||||
Advanced Build Options
|
Advanced Build Options
|
||||||
======================
|
======================
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ OpenSSL 3.0
|
|||||||
|
|
||||||
### Major changes between OpenSSL 1.1.1 and OpenSSL 3.0 [under development] ###
|
### Major changes between OpenSSL 1.1.1 and OpenSSL 3.0 [under development] ###
|
||||||
|
|
||||||
|
* The X25519, X448, Ed25519, Ed448 and SHAKE256 algorithms are included in
|
||||||
|
the FIPS provider. None have the "fips=yes" property set and, as such,
|
||||||
|
will not be accidentially used.
|
||||||
* The algorithm specific public key command line applications have
|
* The algorithm specific public key command line applications have
|
||||||
been deprecated. These include dhparam, gendsa and others. The pkey
|
been deprecated. These include dhparam, gendsa and others. The pkey
|
||||||
alternatives should be used intead: pkey, pkeyparam and genpkey.
|
alternatives should be used intead: pkey, pkeyparam and genpkey.
|
||||||
@@ -30,6 +33,12 @@ OpenSSL 3.0
|
|||||||
authenticate servers or clients.
|
authenticate servers or clients.
|
||||||
* enable-crypto-mdebug and enable-crypto-mdebug-backtrace were mostly
|
* enable-crypto-mdebug and enable-crypto-mdebug-backtrace were mostly
|
||||||
disabled; the project uses address sanitize/leak-detect instead.
|
disabled; the project uses address sanitize/leak-detect instead.
|
||||||
|
* Added a Certificate Management Protocol (CMP, RFC 4210) implementation
|
||||||
|
also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712).
|
||||||
|
It is part of the crypto lib, while a 'cmp' app using it is in preparation.
|
||||||
|
All widely used CMP features are supported for both clients and servers.
|
||||||
|
* Added a proper HTTP(S) client to libcrypto supporting GET and POST,
|
||||||
|
redirection, plain and ASN.1-encoded contents, proxies, and timeouts.
|
||||||
* Added OSSL_SERIALIZER, a generic serializer API.
|
* Added OSSL_SERIALIZER, a generic serializer API.
|
||||||
* Added OSSL_PARAM_BLD, an easier to use API to OSSL_PARAM.
|
* Added OSSL_PARAM_BLD, an easier to use API to OSSL_PARAM.
|
||||||
* Added error raising macros, ERR_raise() and ERR_raise_data().
|
* Added error raising macros, ERR_raise() and ERR_raise_data().
|
||||||
|
|||||||
@@ -118,6 +118,9 @@ document.
|
|||||||
* [NOTES.VMS](NOTES.VMS)
|
* [NOTES.VMS](NOTES.VMS)
|
||||||
* [NOTES.WIN](NOTES.WIN)
|
* [NOTES.WIN](NOTES.WIN)
|
||||||
|
|
||||||
|
Specific notes on upgrading to OpenSSL 3.0 from previous versions, as well as
|
||||||
|
known issues are available on the OpenSSL
|
||||||
|
[wiki](https://wiki.openssl.org/index.php/OpenSSL_3.0).
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
=============
|
=============
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
MAJOR=3
|
MAJOR=3
|
||||||
MINOR=0
|
MINOR=0
|
||||||
PATCH=0
|
PATCH=0
|
||||||
PRE_RELEASE_TAG=dev
|
PRE_RELEASE_TAG=alpha2-dev
|
||||||
BUILD_METADATA=
|
BUILD_METADATA=
|
||||||
RELEASE_DATE=
|
RELEASE_DATE=""
|
||||||
SHLIB_VERSION=3
|
SHLIB_VERSION=3
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
#!{- $config{HASHBANGPERL} -}
|
#!{- $config{HASHBANGPERL} -}
|
||||||
# Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -18,6 +18,9 @@
|
|||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
#include <openssl/asn1t.h>
|
#include <openssl/asn1t.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(ASN1_OBJECT)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
typedef enum OPTION_choice {
|
typedef enum OPTION_choice {
|
||||||
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
||||||
OPT_INFORM, OPT_IN, OPT_OUT, OPT_INDENT, OPT_NOOUT,
|
OPT_INFORM, OPT_IN, OPT_OUT, OPT_INDENT, OPT_NOOUT,
|
||||||
|
|||||||
+8
-10
@@ -34,16 +34,14 @@ ENDIF
|
|||||||
IF[{- !$disabled{'ts'} -}]
|
IF[{- !$disabled{'ts'} -}]
|
||||||
$OPENSSLSRC=$OPENSSLSRC ts.c
|
$OPENSSLSRC=$OPENSSLSRC ts.c
|
||||||
ENDIF
|
ENDIF
|
||||||
IF[{- !$disabled{'deprecated-3.0'} -}]
|
IF[{- !$disabled{'dh'} -}]
|
||||||
IF[{- !$disabled{'dh'} -}]
|
$OPENSSLSRC=$OPENSSLSRC dhparam.c
|
||||||
$OPENSSLSRC=$OPENSSLSRC dhparam.c
|
ENDIF
|
||||||
ENDIF
|
IF[{- !$disabled{'dsa'} -}]
|
||||||
IF[{- !$disabled{'dsa'} -}]
|
$OPENSSLSRC=$OPENSSLSRC dsa.c dsaparam.c gendsa.c
|
||||||
$OPENSSLSRC=$OPENSSLSRC dsa.c dsaparam.c gendsa.c
|
ENDIF
|
||||||
ENDIF
|
IF[{- !$disabled{'engine'} -}]
|
||||||
IF[{- !$disabled{'engine'} -}]
|
$OPENSSLSRC=$OPENSSLSRC engine.c
|
||||||
$OPENSSLSRC=$OPENSSLSRC engine.c
|
|
||||||
ENDIF
|
|
||||||
ENDIF
|
ENDIF
|
||||||
IF[{- !$disabled{'cmp'} -}]
|
IF[{- !$disabled{'cmp'} -}]
|
||||||
$OPENSSLSRC=$OPENSSLSRC cmp_mock_srv.c
|
$OPENSSLSRC=$OPENSSLSRC cmp_mock_srv.c
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -34,6 +34,11 @@
|
|||||||
#include "apps.h"
|
#include "apps.h"
|
||||||
#include "progs.h"
|
#include "progs.h"
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(X509)
|
||||||
|
DEFINE_STACK_OF(X509_EXTENSION)
|
||||||
|
DEFINE_STACK_OF(CONF_VALUE)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
#ifndef W_OK
|
#ifndef W_OK
|
||||||
# define F_OK 0
|
# define F_OK 0
|
||||||
# define W_OK 2
|
# define W_OK 2
|
||||||
@@ -88,7 +93,8 @@ typedef enum {
|
|||||||
|
|
||||||
static char *lookup_conf(const CONF *conf, const char *group, const char *tag);
|
static char *lookup_conf(const CONF *conf, const char *group, const char *tag);
|
||||||
|
|
||||||
static int certify(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
|
static int certify(X509 **xret, const char *infile, int informat,
|
||||||
|
EVP_PKEY *pkey, X509 *x509,
|
||||||
const EVP_MD *dgst,
|
const EVP_MD *dgst,
|
||||||
STACK_OF(OPENSSL_STRING) *sigopts,
|
STACK_OF(OPENSSL_STRING) *sigopts,
|
||||||
STACK_OF(OPENSSL_STRING) *vfyopts,
|
STACK_OF(OPENSSL_STRING) *vfyopts,
|
||||||
@@ -99,7 +105,8 @@ static int certify(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
|
|||||||
long days, int batch, const char *ext_sect, CONF *conf,
|
long days, int batch, const char *ext_sect, CONF *conf,
|
||||||
int verbose, unsigned long certopt, unsigned long nameopt,
|
int verbose, unsigned long certopt, unsigned long nameopt,
|
||||||
int default_op, int ext_copy, int selfsign);
|
int default_op, int ext_copy, int selfsign);
|
||||||
static int certify_cert(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
|
static int certify_cert(X509 **xret, const char *infile, int informat,
|
||||||
|
EVP_PKEY *pkey, X509 *x509,
|
||||||
const EVP_MD *dgst,
|
const EVP_MD *dgst,
|
||||||
STACK_OF(OPENSSL_STRING) *sigopts,
|
STACK_OF(OPENSSL_STRING) *sigopts,
|
||||||
STACK_OF(OPENSSL_STRING) *vfyopts,
|
STACK_OF(OPENSSL_STRING) *vfyopts,
|
||||||
@@ -145,7 +152,8 @@ typedef enum OPTION_choice {
|
|||||||
OPT_ENGINE, OPT_VERBOSE, OPT_CONFIG, OPT_NAME, OPT_SUBJ, OPT_UTF8,
|
OPT_ENGINE, OPT_VERBOSE, OPT_CONFIG, OPT_NAME, OPT_SUBJ, OPT_UTF8,
|
||||||
OPT_CREATE_SERIAL, OPT_MULTIVALUE_RDN, OPT_STARTDATE, OPT_ENDDATE,
|
OPT_CREATE_SERIAL, OPT_MULTIVALUE_RDN, OPT_STARTDATE, OPT_ENDDATE,
|
||||||
OPT_DAYS, OPT_MD, OPT_POLICY, OPT_KEYFILE, OPT_KEYFORM, OPT_PASSIN,
|
OPT_DAYS, OPT_MD, OPT_POLICY, OPT_KEYFILE, OPT_KEYFORM, OPT_PASSIN,
|
||||||
OPT_KEY, OPT_CERT, OPT_SELFSIGN, OPT_IN, OPT_OUT, OPT_OUTDIR, OPT_VFYOPT,
|
OPT_KEY, OPT_CERT, OPT_CERTFORM, OPT_SELFSIGN,
|
||||||
|
OPT_IN, OPT_INFORM, OPT_OUT, OPT_OUTDIR, OPT_VFYOPT,
|
||||||
OPT_SIGOPT, OPT_NOTEXT, OPT_BATCH, OPT_PRESERVEDN, OPT_NOEMAILDN,
|
OPT_SIGOPT, OPT_NOTEXT, OPT_BATCH, OPT_PRESERVEDN, OPT_NOEMAILDN,
|
||||||
OPT_GENCRL, OPT_MSIE_HACK, OPT_CRLDAYS, OPT_CRLHOURS, OPT_CRLSEC,
|
OPT_GENCRL, OPT_MSIE_HACK, OPT_CRLDAYS, OPT_CRLHOURS, OPT_CRLSEC,
|
||||||
OPT_INFILES, OPT_SS_CERT, OPT_SPKAC, OPT_REVOKE, OPT_VALID,
|
OPT_INFILES, OPT_SS_CERT, OPT_SPKAC, OPT_REVOKE, OPT_VALID,
|
||||||
@@ -163,7 +171,8 @@ const OPTIONS ca_options[] = {
|
|||||||
{"help", OPT_HELP, '-', "Display this summary"},
|
{"help", OPT_HELP, '-', "Display this summary"},
|
||||||
{"verbose", OPT_VERBOSE, '-', "Verbose output during processing"},
|
{"verbose", OPT_VERBOSE, '-', "Verbose output during processing"},
|
||||||
{"outdir", OPT_OUTDIR, '/', "Where to put output cert"},
|
{"outdir", OPT_OUTDIR, '/', "Where to put output cert"},
|
||||||
{"in", OPT_IN, '<', "The input PEM encoded cert request(s)"},
|
{"in", OPT_IN, '<', "The input cert request(s)"},
|
||||||
|
{"inform", OPT_INFORM, 'F', "CSR input format (DER or PEM); default PEM"},
|
||||||
{"infiles", OPT_INFILES, '-', "The last argument, requests to process"},
|
{"infiles", OPT_INFILES, '-', "The last argument, requests to process"},
|
||||||
{"out", OPT_OUT, '>', "Where to put the output file(s)"},
|
{"out", OPT_OUT, '>', "Where to put the output file(s)"},
|
||||||
{"notext", OPT_NOTEXT, '-', "Do not print the generated certificate"},
|
{"notext", OPT_NOTEXT, '-', "Do not print the generated certificate"},
|
||||||
@@ -185,7 +194,7 @@ const OPTIONS ca_options[] = {
|
|||||||
|
|
||||||
OPT_SECTION("Certificate"),
|
OPT_SECTION("Certificate"),
|
||||||
{"subj", OPT_SUBJ, 's', "Use arg instead of request's subject"},
|
{"subj", OPT_SUBJ, 's', "Use arg instead of request's subject"},
|
||||||
{"utf8", OPT_UTF8, '-', "Input characters are UTF8 (default ASCII)"},
|
{"utf8", OPT_UTF8, '-', "Input characters are UTF8; default ASCII"},
|
||||||
{"create_serial", OPT_CREATE_SERIAL, '-',
|
{"create_serial", OPT_CREATE_SERIAL, '-',
|
||||||
"If reading serial fails, create a new random serial"},
|
"If reading serial fails, create a new random serial"},
|
||||||
{"rand_serial", OPT_RAND_SERIAL, '-',
|
{"rand_serial", OPT_RAND_SERIAL, '-',
|
||||||
@@ -210,6 +219,8 @@ const OPTIONS ca_options[] = {
|
|||||||
{"passin", OPT_PASSIN, 's', "Input file pass phrase source"},
|
{"passin", OPT_PASSIN, 's', "Input file pass phrase source"},
|
||||||
{"key", OPT_KEY, 's', "Key to decode the private key if it is encrypted"},
|
{"key", OPT_KEY, 's', "Key to decode the private key if it is encrypted"},
|
||||||
{"cert", OPT_CERT, '<', "The CA cert"},
|
{"cert", OPT_CERT, '<', "The CA cert"},
|
||||||
|
{"certform", OPT_CERTFORM, 'F',
|
||||||
|
"certificate input format (DER or PEM); default PEM"},
|
||||||
{"selfsign", OPT_SELFSIGN, '-',
|
{"selfsign", OPT_SELFSIGN, '-',
|
||||||
"Sign a cert with the key associated with it"},
|
"Sign a cert with the key associated with it"},
|
||||||
{"sigopt", OPT_SIGOPT, 's', "Signature parameter in n:v form"},
|
{"sigopt", OPT_SIGOPT, 's', "Signature parameter in n:v form"},
|
||||||
@@ -262,6 +273,7 @@ int ca_main(int argc, char **argv)
|
|||||||
char *configfile = default_config_file, *section = NULL;
|
char *configfile = default_config_file, *section = NULL;
|
||||||
char *md = NULL, *policy = NULL, *keyfile = NULL;
|
char *md = NULL, *policy = NULL, *keyfile = NULL;
|
||||||
char *certfile = NULL, *crl_ext = NULL, *crlnumberfile = NULL, *key = NULL;
|
char *certfile = NULL, *crl_ext = NULL, *crlnumberfile = NULL, *key = NULL;
|
||||||
|
int certformat = FORMAT_PEM, informat = FORMAT_PEM;
|
||||||
const char *infile = NULL, *spkac_file = NULL, *ss_cert_file = NULL;
|
const char *infile = NULL, *spkac_file = NULL, *ss_cert_file = NULL;
|
||||||
const char *extensions = NULL, *extfile = NULL, *passinarg = NULL;
|
const char *extensions = NULL, *extfile = NULL, *passinarg = NULL;
|
||||||
char *outdir = NULL, *outfile = NULL, *rev_arg = NULL, *ser_status = NULL;
|
char *outdir = NULL, *outfile = NULL, *rev_arg = NULL, *ser_status = NULL;
|
||||||
@@ -301,6 +313,10 @@ opthelp:
|
|||||||
req = 1;
|
req = 1;
|
||||||
infile = opt_arg();
|
infile = opt_arg();
|
||||||
break;
|
break;
|
||||||
|
case OPT_INFORM:
|
||||||
|
if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &informat))
|
||||||
|
goto opthelp;
|
||||||
|
break;
|
||||||
case OPT_OUT:
|
case OPT_OUT:
|
||||||
outfile = opt_arg();
|
outfile = opt_arg();
|
||||||
break;
|
break;
|
||||||
@@ -368,6 +384,10 @@ opthelp:
|
|||||||
case OPT_CERT:
|
case OPT_CERT:
|
||||||
certfile = opt_arg();
|
certfile = opt_arg();
|
||||||
break;
|
break;
|
||||||
|
case OPT_CERTFORM:
|
||||||
|
if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &certformat))
|
||||||
|
goto opthelp;
|
||||||
|
break;
|
||||||
case OPT_SELFSIGN:
|
case OPT_SELFSIGN:
|
||||||
selfsign = 1;
|
selfsign = 1;
|
||||||
break;
|
break;
|
||||||
@@ -566,7 +586,7 @@ end_of_options:
|
|||||||
&& (certfile = lookup_conf(conf, section, ENV_CERTIFICATE)) == NULL)
|
&& (certfile = lookup_conf(conf, section, ENV_CERTIFICATE)) == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
x509 = load_cert(certfile, FORMAT_PEM, "CA certificate");
|
x509 = load_cert(certfile, certformat, "CA certificate");
|
||||||
if (x509 == NULL)
|
if (x509 == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
@@ -921,7 +941,7 @@ end_of_options:
|
|||||||
}
|
}
|
||||||
if (ss_cert_file != NULL) {
|
if (ss_cert_file != NULL) {
|
||||||
total++;
|
total++;
|
||||||
j = certify_cert(&x, ss_cert_file, pkey, x509, dgst,
|
j = certify_cert(&x, ss_cert_file, certformat, pkey, x509, dgst,
|
||||||
sigopts, vfyopts, attribs,
|
sigopts, vfyopts, attribs,
|
||||||
db, serial, subj, chtype, multirdn, email_dn,
|
db, serial, subj, chtype, multirdn, email_dn,
|
||||||
startdate, enddate, days, batch, extensions,
|
startdate, enddate, days, batch, extensions,
|
||||||
@@ -942,8 +962,8 @@ end_of_options:
|
|||||||
}
|
}
|
||||||
if (infile != NULL) {
|
if (infile != NULL) {
|
||||||
total++;
|
total++;
|
||||||
j = certify(&x, infile, pkey, x509p, dgst, sigopts, vfyopts,
|
j = certify(&x, infile, informat, pkey, x509p, dgst,
|
||||||
attribs, db,
|
sigopts, vfyopts, attribs, db,
|
||||||
serial, subj, chtype, multirdn, email_dn, startdate,
|
serial, subj, chtype, multirdn, email_dn, startdate,
|
||||||
enddate, days, batch, extensions, conf, verbose,
|
enddate, days, batch, extensions, conf, verbose,
|
||||||
certopt, get_nameopt(), default_op, ext_copy, selfsign);
|
certopt, get_nameopt(), default_op, ext_copy, selfsign);
|
||||||
@@ -962,7 +982,8 @@ end_of_options:
|
|||||||
}
|
}
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
total++;
|
total++;
|
||||||
j = certify(&x, argv[i], pkey, x509p, dgst, sigopts, vfyopts,
|
j = certify(&x, argv[i], informat, pkey, x509p, dgst,
|
||||||
|
sigopts, vfyopts,
|
||||||
attribs, db,
|
attribs, db,
|
||||||
serial, subj, chtype, multirdn, email_dn, startdate,
|
serial, subj, chtype, multirdn, email_dn, startdate,
|
||||||
enddate, days, batch, extensions, conf, verbose,
|
enddate, days, batch, extensions, conf, verbose,
|
||||||
@@ -1242,7 +1263,7 @@ end_of_options:
|
|||||||
goto end;
|
goto end;
|
||||||
} else {
|
} else {
|
||||||
X509 *revcert;
|
X509 *revcert;
|
||||||
revcert = load_cert(infile, FORMAT_PEM, infile);
|
revcert = load_cert(infile, certformat, infile);
|
||||||
if (revcert == NULL)
|
if (revcert == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
if (dorevoke == 2)
|
if (dorevoke == 2)
|
||||||
@@ -1295,7 +1316,8 @@ static char *lookup_conf(const CONF *conf, const char *section, const char *tag)
|
|||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int certify(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
|
static int certify(X509 **xret, const char *infile, int informat,
|
||||||
|
EVP_PKEY *pkey, X509 *x509,
|
||||||
const EVP_MD *dgst,
|
const EVP_MD *dgst,
|
||||||
STACK_OF(OPENSSL_STRING) *sigopts,
|
STACK_OF(OPENSSL_STRING) *sigopts,
|
||||||
STACK_OF(OPENSSL_STRING) *vfyopts,
|
STACK_OF(OPENSSL_STRING) *vfyopts,
|
||||||
@@ -1308,20 +1330,12 @@ static int certify(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
|
|||||||
int default_op, int ext_copy, int selfsign)
|
int default_op, int ext_copy, int selfsign)
|
||||||
{
|
{
|
||||||
X509_REQ *req = NULL;
|
X509_REQ *req = NULL;
|
||||||
BIO *in = NULL;
|
|
||||||
EVP_PKEY *pktmp = NULL;
|
EVP_PKEY *pktmp = NULL;
|
||||||
int ok = -1, i;
|
int ok = -1, i;
|
||||||
|
|
||||||
in = BIO_new_file(infile, "r");
|
req = load_csr(infile, informat, "certificate request");
|
||||||
if (in == NULL) {
|
if (req == NULL)
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
|
||||||
if ((req = PEM_read_bio_X509_REQ(in, NULL, NULL, NULL)) == NULL) {
|
|
||||||
BIO_printf(bio_err, "Error reading certificate request in %s\n",
|
|
||||||
infile);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
X509_REQ_print_ex(bio_err, req, nameopt, X509_FLAG_COMPAT);
|
X509_REQ_print_ex(bio_err, req, nameopt, X509_FLAG_COMPAT);
|
||||||
|
|
||||||
@@ -1362,11 +1376,11 @@ static int certify(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
|
|||||||
|
|
||||||
end:
|
end:
|
||||||
X509_REQ_free(req);
|
X509_REQ_free(req);
|
||||||
BIO_free(in);
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int certify_cert(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
|
static int certify_cert(X509 **xret, const char *infile, int certformat,
|
||||||
|
EVP_PKEY *pkey, X509 *x509,
|
||||||
const EVP_MD *dgst,
|
const EVP_MD *dgst,
|
||||||
STACK_OF(OPENSSL_STRING) *sigopts,
|
STACK_OF(OPENSSL_STRING) *sigopts,
|
||||||
STACK_OF(OPENSSL_STRING) *vfyopts,
|
STACK_OF(OPENSSL_STRING) *vfyopts,
|
||||||
@@ -1382,7 +1396,7 @@ static int certify_cert(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x
|
|||||||
EVP_PKEY *pktmp = NULL;
|
EVP_PKEY *pktmp = NULL;
|
||||||
int ok = -1, i;
|
int ok = -1, i;
|
||||||
|
|
||||||
if ((req = load_cert(infile, FORMAT_PEM, infile)) == NULL)
|
if ((req = load_cert(infile, certformat, infile)) == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
if (verbose)
|
if (verbose)
|
||||||
X509_print(bio_err, req);
|
X509_print(bio_err, req);
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -15,6 +15,8 @@
|
|||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF_CONST(SSL_CIPHER)
|
||||||
|
|
||||||
typedef enum OPTION_choice {
|
typedef enum OPTION_choice {
|
||||||
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
||||||
OPT_STDNAME,
|
OPT_STDNAME,
|
||||||
|
|||||||
@@ -15,6 +15,10 @@
|
|||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
#include <openssl/cmperr.h>
|
#include <openssl/cmperr.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(X509)
|
||||||
|
DEFINE_STACK_OF(OSSL_CMP_ITAV)
|
||||||
|
DEFINE_STACK_OF(ASN1_UTF8STRING)
|
||||||
|
|
||||||
/* the context for the CMP mock server */
|
/* the context for the CMP mock server */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|||||||
+7
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2008-2019 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2008-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -23,6 +23,12 @@
|
|||||||
# include <openssl/x509v3.h>
|
# include <openssl/x509v3.h>
|
||||||
# include <openssl/cms.h>
|
# include <openssl/cms.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(X509)
|
||||||
|
DEFINE_STACK_OF(CMS_SignerInfo)
|
||||||
|
DEFINE_STACK_OF(GENERAL_NAME)
|
||||||
|
DEFINE_STACK_OF(GENERAL_NAMES)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
static int save_certs(char *signerfile, STACK_OF(X509) *signers);
|
static int save_certs(char *signerfile, STACK_OF(X509) *signers);
|
||||||
static int cms_cb(int ok, X509_STORE_CTX *ctx);
|
static int cms_cb(int ok, X509_STORE_CTX *ctx);
|
||||||
static void receipt_request_print(CMS_ContentInfo *cms);
|
static void receipt_request_print(CMS_ContentInfo *cms);
|
||||||
|
|||||||
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -46,7 +46,7 @@ const OPTIONS crl_options[] = {
|
|||||||
#ifndef OPENSSL_NO_MD5
|
#ifndef OPENSSL_NO_MD5
|
||||||
{"hash_old", OPT_HASH_OLD, '-', "Print old-style (MD5) hash value"},
|
{"hash_old", OPT_HASH_OLD, '-', "Print old-style (MD5) hash value"},
|
||||||
#endif
|
#endif
|
||||||
{"nameopt", OPT_NAMEOPT, 's', "Various certificate name options"},
|
{"nameopt", OPT_NAMEOPT, 's', "Certificate subject/issuer name printing options"},
|
||||||
{"", OPT_MD, '-', "Any supported digest"},
|
{"", OPT_MD, '-', "Any supported digest"},
|
||||||
|
|
||||||
OPT_SECTION("CRL"),
|
OPT_SECTION("CRL"),
|
||||||
@@ -205,7 +205,7 @@ int crl_main(int argc, char **argv)
|
|||||||
if (argc != 0)
|
if (argc != 0)
|
||||||
goto opthelp;
|
goto opthelp;
|
||||||
|
|
||||||
x = load_crl(infile, informat);
|
x = load_crl(infile, informat, "CRL");
|
||||||
if (x == NULL)
|
if (x == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ int crl_main(int argc, char **argv)
|
|||||||
BIO_puts(bio_err, "Missing CRL signing key\n");
|
BIO_puts(bio_err, "Missing CRL signing key\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
newcrl = load_crl(crldiff, informat);
|
newcrl = load_crl(crldiff, informat, "other CRL");
|
||||||
if (!newcrl)
|
if (!newcrl)
|
||||||
goto end;
|
goto end;
|
||||||
pkey = load_key(keyfile, keyformat, 0, NULL, NULL, "CRL signing key");
|
pkey = load_key(keyfile, keyformat, 0, NULL, NULL, "CRL signing key");
|
||||||
|
|||||||
+6
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -19,6 +19,11 @@
|
|||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
#include <openssl/objects.h>
|
#include <openssl/objects.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(X509_CRL)
|
||||||
|
DEFINE_STACK_OF(X509)
|
||||||
|
DEFINE_STACK_OF(X509_INFO)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile);
|
static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile);
|
||||||
|
|
||||||
typedef enum OPTION_choice {
|
typedef enum OPTION_choice {
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -21,6 +21,8 @@
|
|||||||
#include <openssl/hmac.h>
|
#include <openssl/hmac.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
#undef BUFSIZE
|
#undef BUFSIZE
|
||||||
#define BUFSIZE 1024*8
|
#define BUFSIZE 1024*8
|
||||||
|
|
||||||
|
|||||||
+77
-52
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -7,9 +7,10 @@
|
|||||||
* https://www.openssl.org/source/license.html
|
* https://www.openssl.org/source/license.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||||
/* We need to use some deprecated APIs */
|
/* We need to use some deprecated APIs */
|
||||||
#define OPENSSL_SUPPRESS_DEPRECATED
|
# define OPENSSL_SUPPRESS_DEPRECATED
|
||||||
|
#endif
|
||||||
#include <openssl/opensslconf.h>
|
#include <openssl/opensslconf.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -25,13 +26,16 @@
|
|||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_DSA
|
#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
|
||||||
# include <openssl/dsa.h>
|
# include <openssl/dsa.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEFBITS 2048
|
#define DEFBITS 2048
|
||||||
|
|
||||||
|
#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
|
||||||
static int dh_cb(int p, int n, BN_GENCB *cb);
|
static int dh_cb(int p, int n, BN_GENCB *cb);
|
||||||
|
#endif
|
||||||
|
static int gendh_cb(EVP_PKEY_CTX *ctx);
|
||||||
|
|
||||||
typedef enum OPTION_choice {
|
typedef enum OPTION_choice {
|
||||||
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
||||||
@@ -81,9 +85,11 @@ int dhparam_main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL, *out = NULL;
|
||||||
DH *dh = NULL;
|
DH *dh = NULL;
|
||||||
|
EVP_PKEY *pkey = NULL;
|
||||||
|
EVP_PKEY_CTX *ctx = NULL;
|
||||||
char *infile = NULL, *outfile = NULL, *prog;
|
char *infile = NULL, *outfile = NULL, *prog;
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
#ifndef OPENSSL_NO_DSA
|
#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
|
||||||
int dsaparam = 0;
|
int dsaparam = 0;
|
||||||
#endif
|
#endif
|
||||||
int i, text = 0, C = 0, ret = 1, num = 0, g = 0;
|
int i, text = 0, C = 0, ret = 1, num = 0, g = 0;
|
||||||
@@ -127,7 +133,11 @@ int dhparam_main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case OPT_DSAPARAM:
|
case OPT_DSAPARAM:
|
||||||
#ifndef OPENSSL_NO_DSA
|
#ifndef OPENSSL_NO_DSA
|
||||||
|
# ifdef OPENSSL_NO_DEPRECATED_3_0
|
||||||
|
BIO_printf(bio_err, "The dsaparam option is deprecated.\n");
|
||||||
|
# else
|
||||||
dsaparam = 1;
|
dsaparam = 1;
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case OPT_C:
|
case OPT_C:
|
||||||
@@ -164,7 +174,7 @@ int dhparam_main(int argc, char **argv)
|
|||||||
if (g && !num)
|
if (g && !num)
|
||||||
num = DEFBITS;
|
num = DEFBITS;
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_DSA
|
#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
|
||||||
if (dsaparam && g) {
|
if (dsaparam && g) {
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
"generator may not be chosen for DSA parameters\n");
|
"generator may not be chosen for DSA parameters\n");
|
||||||
@@ -182,8 +192,12 @@ int dhparam_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (num) {
|
if (num) {
|
||||||
|
|
||||||
BN_GENCB *cb;
|
|
||||||
cb = BN_GENCB_new();
|
#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
|
||||||
|
if (dsaparam) {
|
||||||
|
DSA *dsa = DSA_new();
|
||||||
|
BN_GENCB *cb = BN_GENCB_new();
|
||||||
|
|
||||||
if (cb == NULL) {
|
if (cb == NULL) {
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
@@ -191,10 +205,6 @@ int dhparam_main(int argc, char **argv)
|
|||||||
|
|
||||||
BN_GENCB_set(cb, dh_cb, bio_err);
|
BN_GENCB_set(cb, dh_cb, bio_err);
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_DSA
|
|
||||||
if (dsaparam) {
|
|
||||||
DSA *dsa = DSA_new();
|
|
||||||
|
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
"Generating DSA parameters, %d bit long prime\n", num);
|
"Generating DSA parameters, %d bit long prime\n", num);
|
||||||
if (dsa == NULL
|
if (dsa == NULL
|
||||||
@@ -208,34 +218,51 @@ int dhparam_main(int argc, char **argv)
|
|||||||
|
|
||||||
dh = DSA_dup_DH(dsa);
|
dh = DSA_dup_DH(dsa);
|
||||||
DSA_free(dsa);
|
DSA_free(dsa);
|
||||||
if (dh == NULL) {
|
|
||||||
BN_GENCB_free(cb);
|
BN_GENCB_free(cb);
|
||||||
|
if (dh == NULL) {
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
dh = DH_new();
|
ctx = EVP_PKEY_CTX_new_from_name(NULL, "DH", NULL);
|
||||||
|
if (ctx == NULL) {
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"Error, DH key generation context allocation failed\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
EVP_PKEY_CTX_set_cb(ctx, gendh_cb);
|
||||||
|
EVP_PKEY_CTX_set_app_data(ctx, bio_err);
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
"Generating DH parameters, %d bit long safe prime, generator %d\n",
|
"Generating DH parameters, %d bit long safe prime, generator %d\n",
|
||||||
num, g);
|
num, g);
|
||||||
BIO_printf(bio_err, "This is going to take a long time\n");
|
BIO_printf(bio_err, "This is going to take a long time\n");
|
||||||
if (dh == NULL || !DH_generate_parameters_ex(dh, num, g, cb)) {
|
if (!EVP_PKEY_paramgen_init(ctx)) {
|
||||||
BN_GENCB_free(cb);
|
BIO_printf(bio_err,
|
||||||
|
"Error, unable to initialise DH param generation\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, num)) {
|
||||||
|
BIO_printf(bio_err, "Error, unable to set DH prime length\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (!EVP_PKEY_paramgen(ctx, &pkey)) {
|
||||||
|
BIO_printf(bio_err, "Error, DH generation failed\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BN_GENCB_free(cb);
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
in = bio_open_default(infile, 'r', informat);
|
in = bio_open_default(infile, 'r', informat);
|
||||||
if (in == NULL)
|
if (in == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_DSA
|
#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
|
||||||
if (dsaparam) {
|
if (dsaparam) {
|
||||||
DSA *dsa;
|
DSA *dsa;
|
||||||
|
|
||||||
@@ -264,10 +291,10 @@ int dhparam_main(int argc, char **argv)
|
|||||||
* We have no PEM header to determine what type of DH params it
|
* We have no PEM header to determine what type of DH params it
|
||||||
* is. We'll just try both.
|
* is. We'll just try both.
|
||||||
*/
|
*/
|
||||||
dh = d2i_DHparams_bio(in, NULL);
|
dh = ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, in, NULL);
|
||||||
/* BIO_reset() returns 0 for success for file BIOs only!!! */
|
/* BIO_reset() returns 0 for success for file BIOs only!!! */
|
||||||
if (dh == NULL && BIO_reset(in) == 0)
|
if (dh == NULL && BIO_reset(in) == 0)
|
||||||
dh = d2i_DHxparams_bio(in, NULL);
|
dh = ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, in, NULL);
|
||||||
} else {
|
} else {
|
||||||
/* informat == FORMAT_PEM */
|
/* informat == FORMAT_PEM */
|
||||||
dh = PEM_read_bio_DHparams(in, NULL, NULL, NULL);
|
dh = PEM_read_bio_DHparams(in, NULL, NULL, NULL);
|
||||||
@@ -279,37 +306,20 @@ int dhparam_main(int argc, char **argv)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* dh != NULL */
|
/* dh != NULL */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text) {
|
if (text)
|
||||||
DHparams_print(out, dh);
|
EVP_PKEY_print_params(out, pkey, 4, NULL);
|
||||||
}
|
|
||||||
|
|
||||||
if (check) {
|
if (check) {
|
||||||
if (!DH_check(dh, &i)) {
|
if (!EVP_PKEY_param_check(ctx) /* DH_check(dh, &i) */) {
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
|
BIO_printf(bio_err, "ERROR: Invalid parameters generated\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (i & DH_CHECK_P_NOT_PRIME)
|
|
||||||
BIO_printf(bio_err, "WARNING: p value is not prime\n");
|
|
||||||
if (i & DH_CHECK_P_NOT_SAFE_PRIME)
|
|
||||||
BIO_printf(bio_err, "WARNING: p value is not a safe prime\n");
|
|
||||||
if (i & DH_CHECK_Q_NOT_PRIME)
|
|
||||||
BIO_printf(bio_err, "WARNING: q value is not a prime\n");
|
|
||||||
if (i & DH_CHECK_INVALID_Q_VALUE)
|
|
||||||
BIO_printf(bio_err, "WARNING: q value is invalid\n");
|
|
||||||
if (i & DH_CHECK_INVALID_J_VALUE)
|
|
||||||
BIO_printf(bio_err, "WARNING: j value is invalid\n");
|
|
||||||
if (i & DH_UNABLE_TO_CHECK_GENERATOR)
|
|
||||||
BIO_printf(bio_err,
|
|
||||||
"WARNING: unable to check the generator value\n");
|
|
||||||
if (i & DH_NOT_SUITABLE_GENERATOR)
|
|
||||||
BIO_printf(bio_err, "WARNING: the g value is not a generator\n");
|
|
||||||
if (i == 0)
|
|
||||||
BIO_printf(bio_err, "DH parameters appear to be ok.\n");
|
BIO_printf(bio_err, "DH parameters appear to be ok.\n");
|
||||||
if (num != 0 && i != 0) {
|
if (num != 0) {
|
||||||
/*
|
/*
|
||||||
* We have generated parameters but DH_check() indicates they are
|
* We have generated parameters but DH_check() indicates they are
|
||||||
* invalid! This should never happen!
|
* invalid! This should never happen!
|
||||||
@@ -323,8 +333,9 @@ int dhparam_main(int argc, char **argv)
|
|||||||
int len, bits;
|
int len, bits;
|
||||||
const BIGNUM *pbn, *gbn;
|
const BIGNUM *pbn, *gbn;
|
||||||
|
|
||||||
len = DH_size(dh);
|
dh = EVP_PKEY_get0_DH(pkey);
|
||||||
bits = DH_bits(dh);
|
len = EVP_PKEY_size(pkey);
|
||||||
|
bits = EVP_PKEY_size(pkey);
|
||||||
DH_get0_pqg(dh, &pbn, NULL, &gbn);
|
DH_get0_pqg(dh, &pbn, NULL, &gbn);
|
||||||
data = app_malloc(len, "print a BN");
|
data = app_malloc(len, "print a BN");
|
||||||
|
|
||||||
@@ -362,9 +373,9 @@ int dhparam_main(int argc, char **argv)
|
|||||||
DH_get0_pqg(dh, NULL, &q, NULL);
|
DH_get0_pqg(dh, NULL, &q, NULL);
|
||||||
if (outformat == FORMAT_ASN1) {
|
if (outformat == FORMAT_ASN1) {
|
||||||
if (q != NULL)
|
if (q != NULL)
|
||||||
i = i2d_DHxparams_bio(out, dh);
|
i = ASN1_i2d_bio_of(DH, i2d_DHxparams, out, dh);
|
||||||
else
|
else
|
||||||
i = i2d_DHparams_bio(out, dh);
|
i = ASN1_i2d_bio_of(DH, i2d_DHparams, out, dh);
|
||||||
} else if (q != NULL) {
|
} else if (q != NULL) {
|
||||||
i = PEM_write_bio_DHxparams(out, dh);
|
i = PEM_write_bio_DHxparams(out, dh);
|
||||||
} else {
|
} else {
|
||||||
@@ -380,17 +391,31 @@ int dhparam_main(int argc, char **argv)
|
|||||||
end:
|
end:
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
DH_free(dh);
|
EVP_PKEY_free(pkey);
|
||||||
|
EVP_PKEY_CTX_free(ctx);
|
||||||
release_engine(e);
|
release_engine(e);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dh_cb(int p, int n, BN_GENCB *cb)
|
static int common_dh_cb(int p, BIO *b)
|
||||||
{
|
{
|
||||||
static const char symbols[] = ".+*\n";
|
static const char symbols[] = ".+*\n";
|
||||||
char c = (p >= 0 && (size_t)p < sizeof(symbols) - 1) ? symbols[p] : '?';
|
char c = (p >= 0 && (size_t)p < sizeof(symbols) - 1) ? symbols[p] : '?';
|
||||||
|
|
||||||
BIO_write(BN_GENCB_get_arg(cb), &c, 1);
|
BIO_write(b, &c, 1);
|
||||||
(void)BIO_flush(BN_GENCB_get_arg(cb));
|
(void)BIO_flush(b);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
|
||||||
|
static int dh_cb(int p, int n, BN_GENCB *cb)
|
||||||
|
{
|
||||||
|
return common_dh_cb(p, BN_GENCB_get_arg(cb));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static int gendh_cb(EVP_PKEY_CTX *ctx)
|
||||||
|
{
|
||||||
|
return common_dh_cb(EVP_PKEY_CTX_get_keygen_info(ctx, 0),
|
||||||
|
EVP_PKEY_CTX_get_app_data(ctx));
|
||||||
|
}
|
||||||
+6
-12
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -7,9 +7,6 @@
|
|||||||
* https://www.openssl.org/source/license.html
|
* https://www.openssl.org/source/license.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* We need to use the deprecated DSA_print */
|
|
||||||
#define OPENSSL_SUPPRESS_DEPRECATED
|
|
||||||
|
|
||||||
#include <openssl/opensslconf.h>
|
#include <openssl/opensslconf.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -73,6 +70,7 @@ int dsa_main(int argc, char **argv)
|
|||||||
BIO *out = NULL;
|
BIO *out = NULL;
|
||||||
DSA *dsa = NULL;
|
DSA *dsa = NULL;
|
||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
|
EVP_PKEY *pkey = NULL;
|
||||||
const EVP_CIPHER *enc = NULL;
|
const EVP_CIPHER *enc = NULL;
|
||||||
char *infile = NULL, *outfile = NULL, *prog;
|
char *infile = NULL, *outfile = NULL, *prog;
|
||||||
char *passin = NULL, *passout = NULL, *passinarg = NULL, *passoutarg = NULL;
|
char *passin = NULL, *passout = NULL, *passinarg = NULL, *passoutarg = NULL;
|
||||||
@@ -166,19 +164,13 @@ int dsa_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BIO_printf(bio_err, "read DSA key\n");
|
BIO_printf(bio_err, "read DSA key\n");
|
||||||
{
|
|
||||||
EVP_PKEY *pkey;
|
|
||||||
|
|
||||||
if (pubin)
|
if (pubin)
|
||||||
pkey = load_pubkey(infile, informat, 1, passin, e, "Public Key");
|
pkey = load_pubkey(infile, informat, 1, passin, e, "Public Key");
|
||||||
else
|
else
|
||||||
pkey = load_key(infile, informat, 1, passin, e, "Private Key");
|
pkey = load_key(infile, informat, 1, passin, e, "Private Key");
|
||||||
|
|
||||||
if (pkey != NULL) {
|
if (pkey != NULL)
|
||||||
dsa = EVP_PKEY_get1_DSA(pkey);
|
dsa = EVP_PKEY_get1_DSA(pkey);
|
||||||
EVP_PKEY_free(pkey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dsa == NULL) {
|
if (dsa == NULL) {
|
||||||
BIO_printf(bio_err, "unable to load Key\n");
|
BIO_printf(bio_err, "unable to load Key\n");
|
||||||
@@ -192,7 +184,8 @@ int dsa_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (text) {
|
if (text) {
|
||||||
assert(pubin || private);
|
assert(pubin || private);
|
||||||
if (!DSA_print(out, dsa, 0)) {
|
if ((pubin && EVP_PKEY_print_public(out, pkey, 0, NULL) <= 0)
|
||||||
|
|| (!pubin && EVP_PKEY_print_private(out, pkey, 0, NULL) <= 0)) {
|
||||||
perror(outfile);
|
perror(outfile);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
@@ -269,6 +262,7 @@ int dsa_main(int argc, char **argv)
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
end:
|
end:
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
DSA_free(dsa);
|
DSA_free(dsa);
|
||||||
release_engine(e);
|
release_engine(e);
|
||||||
OPENSSL_free(passin);
|
OPENSSL_free(passin);
|
||||||
|
|||||||
+79
-29
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -7,9 +7,6 @@
|
|||||||
* https://www.openssl.org/source/license.html
|
* https://www.openssl.org/source/license.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* We need to use some deprecated APIs */
|
|
||||||
#define OPENSSL_SUPPRESS_DEPRECATED
|
|
||||||
|
|
||||||
#include <openssl/opensslconf.h>
|
#include <openssl/opensslconf.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -27,7 +24,7 @@
|
|||||||
|
|
||||||
static int verbose = 0;
|
static int verbose = 0;
|
||||||
|
|
||||||
static int dsa_cb(int p, int n, BN_GENCB *cb);
|
static int gendsa_cb(EVP_PKEY_CTX *ctx);
|
||||||
|
|
||||||
typedef enum OPTION_choice {
|
typedef enum OPTION_choice {
|
||||||
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
||||||
@@ -71,7 +68,8 @@ int dsaparam_main(int argc, char **argv)
|
|||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
DSA *dsa = NULL;
|
DSA *dsa = NULL;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *in = NULL, *out = NULL;
|
||||||
BN_GENCB *cb = NULL;
|
EVP_PKEY *pkey = NULL;
|
||||||
|
EVP_PKEY_CTX *ctx = NULL;
|
||||||
int numbits = -1, num = 0, genkey = 0;
|
int numbits = -1, num = 0, genkey = 0;
|
||||||
int informat = FORMAT_PEM, outformat = FORMAT_PEM, noout = 0, C = 0;
|
int informat = FORMAT_PEM, outformat = FORMAT_PEM, noout = 0, C = 0;
|
||||||
int ret = 1, i, text = 0, private = 0;
|
int ret = 1, i, text = 0, private = 0;
|
||||||
@@ -150,6 +148,13 @@ int dsaparam_main(int argc, char **argv)
|
|||||||
if (out == NULL)
|
if (out == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
ctx = EVP_PKEY_CTX_new_from_name(NULL, "DSA", NULL);
|
||||||
|
if (ctx == NULL) {
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"Error, DSA parameter generation context allocation failed\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
if (numbits > 0) {
|
if (numbits > 0) {
|
||||||
if (numbits > OPENSSL_DSA_MAX_MODULUS_BITS)
|
if (numbits > OPENSSL_DSA_MAX_MODULUS_BITS)
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
@@ -157,27 +162,36 @@ int dsaparam_main(int argc, char **argv)
|
|||||||
" Your key size is %d! Larger key size may behave not as expected.\n",
|
" Your key size is %d! Larger key size may behave not as expected.\n",
|
||||||
OPENSSL_DSA_MAX_MODULUS_BITS, numbits);
|
OPENSSL_DSA_MAX_MODULUS_BITS, numbits);
|
||||||
|
|
||||||
cb = BN_GENCB_new();
|
EVP_PKEY_CTX_set_cb(ctx, gendsa_cb);
|
||||||
if (cb == NULL) {
|
EVP_PKEY_CTX_set_app_data(ctx, bio_err);
|
||||||
BIO_printf(bio_err, "Error allocating BN_GENCB object\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
BN_GENCB_set(cb, dsa_cb, bio_err);
|
|
||||||
dsa = DSA_new();
|
|
||||||
if (dsa == NULL) {
|
|
||||||
BIO_printf(bio_err, "Error allocating DSA object\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
BIO_printf(bio_err, "Generating DSA parameters, %d bit long prime\n",
|
BIO_printf(bio_err, "Generating DSA parameters, %d bit long prime\n",
|
||||||
num);
|
num);
|
||||||
BIO_printf(bio_err, "This could take some time\n");
|
BIO_printf(bio_err, "This could take some time\n");
|
||||||
}
|
}
|
||||||
if (!DSA_generate_parameters_ex(dsa, num, NULL, 0, NULL, NULL, cb)) {
|
if (EVP_PKEY_paramgen_init(ctx) <= 0) {
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"Error, DSA key generation paramgen init failed\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (!EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, num)) {
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"Error, DSA key generation setting bit length failed\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (EVP_PKEY_paramgen(ctx, &pkey) <= 0) {
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
BIO_printf(bio_err, "Error, DSA key generation failed\n");
|
BIO_printf(bio_err, "Error, DSA key generation failed\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
dsa = EVP_PKEY_get1_DSA(pkey);
|
||||||
|
if (dsa == NULL) {
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
BIO_printf(bio_err, "Error, DSA key extraction failed\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
} else if (informat == FORMAT_ASN1) {
|
} else if (informat == FORMAT_ASN1) {
|
||||||
dsa = d2i_DSAparams_bio(in, NULL);
|
dsa = d2i_DSAparams_bio(in, NULL);
|
||||||
} else {
|
} else {
|
||||||
@@ -189,8 +203,21 @@ int dsaparam_main(int argc, char **argv)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pkey == NULL) {
|
||||||
|
pkey = EVP_PKEY_new();
|
||||||
|
if (pkey == NULL) {
|
||||||
|
BIO_printf(bio_err, "Error, unable to allocate PKEY object\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (!EVP_PKEY_set1_DSA(pkey, dsa)) {
|
||||||
|
BIO_printf(bio_err, "Error, unable to set DSA parameters\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (text) {
|
if (text) {
|
||||||
DSAparams_print(out, dsa);
|
EVP_PKEY_print_params(out, pkey, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (C) {
|
if (C) {
|
||||||
@@ -246,11 +273,28 @@ int dsaparam_main(int argc, char **argv)
|
|||||||
if (genkey) {
|
if (genkey) {
|
||||||
DSA *dsakey;
|
DSA *dsakey;
|
||||||
|
|
||||||
if ((dsakey = DSAparams_dup(dsa)) == NULL)
|
EVP_PKEY_CTX_free(ctx);
|
||||||
goto end;
|
ctx = EVP_PKEY_CTX_new_from_name(NULL, "DSA", NULL);
|
||||||
if (!DSA_generate_key(dsakey)) {
|
if (ctx == NULL) {
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
BIO_printf(bio_err,
|
||||||
|
"Error, DSA key generation context allocation failed\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (!EVP_PKEY_keygen_init(ctx)) {
|
||||||
|
BIO_printf(bio_err, "unable to initialise for key generation\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (!EVP_PKEY_keygen(ctx, &pkey)) {
|
||||||
|
BIO_printf(bio_err, "unable to generate key\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
dsakey = EVP_PKEY_get0_DSA(pkey);
|
||||||
|
if (dsakey == NULL) {
|
||||||
|
BIO_printf(bio_err, "unable to extract generated key\n");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
DSA_free(dsakey);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
assert(private);
|
assert(private);
|
||||||
@@ -259,27 +303,33 @@ int dsaparam_main(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
i = PEM_write_bio_DSAPrivateKey(out, dsakey, NULL, NULL, 0, NULL,
|
i = PEM_write_bio_DSAPrivateKey(out, dsakey, NULL, NULL, 0, NULL,
|
||||||
NULL);
|
NULL);
|
||||||
DSA_free(dsakey);
|
|
||||||
}
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
end:
|
end:
|
||||||
BN_GENCB_free(cb);
|
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
|
EVP_PKEY_CTX_free(ctx);
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
DSA_free(dsa);
|
DSA_free(dsa);
|
||||||
release_engine(e);
|
release_engine(e);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dsa_cb(int p, int n, BN_GENCB *cb)
|
static int gendsa_cb(EVP_PKEY_CTX *ctx)
|
||||||
{
|
{
|
||||||
static const char symbols[] = ".+*\n";
|
static const char symbols[] = ".+*\n";
|
||||||
char c = (p >= 0 && (size_t)p < sizeof(symbols) - 1) ? symbols[p] : '?';
|
int p;
|
||||||
|
char c;
|
||||||
|
BIO *b;
|
||||||
|
|
||||||
if (!verbose)
|
if (!verbose)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
BIO_write(BN_GENCB_get_arg(cb), &c, 1);
|
b = EVP_PKEY_CTX_get_app_data(ctx);
|
||||||
(void)BIO_flush(BN_GENCB_get_arg(cb));
|
p = EVP_PKEY_CTX_get_keygen_info(ctx, 0);
|
||||||
|
c = (p >= 0 && (size_t)p < sizeof(symbols) - 1) ? symbols[p] : '?';
|
||||||
|
|
||||||
|
BIO_write(b, &c, 1);
|
||||||
|
(void)BIO_flush(b);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
+4
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -19,6 +19,9 @@
|
|||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
#include <openssl/store.h>
|
#include <openssl/store.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
DEFINE_STACK_OF_CSTRING()
|
||||||
|
|
||||||
typedef enum OPTION_choice {
|
typedef enum OPTION_choice {
|
||||||
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
||||||
OPT_C, OPT_T, OPT_TT, OPT_PRE, OPT_POST,
|
OPT_C, OPT_T, OPT_TT, OPT_PRE, OPT_POST,
|
||||||
|
|||||||
+14
-3
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -18,6 +18,8 @@
|
|||||||
#include "apps.h"
|
#include "apps.h"
|
||||||
#include "progs.h"
|
#include "progs.h"
|
||||||
|
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
#define BUFSIZE 4096
|
#define BUFSIZE 4096
|
||||||
#define DEFAULT_MAC_NAME "HMAC"
|
#define DEFAULT_MAC_NAME "HMAC"
|
||||||
#define DEFAULT_FIPS_SECTION "fips_check_section"
|
#define DEFAULT_FIPS_SECTION "fips_check_section"
|
||||||
@@ -31,12 +33,13 @@ static OSSL_CALLBACK self_test_events;
|
|||||||
static char *self_test_corrupt_desc = NULL;
|
static char *self_test_corrupt_desc = NULL;
|
||||||
static char *self_test_corrupt_type = NULL;
|
static char *self_test_corrupt_type = NULL;
|
||||||
static int self_test_log = 1;
|
static int self_test_log = 1;
|
||||||
|
static int quiet = 0;
|
||||||
|
|
||||||
typedef enum OPTION_choice {
|
typedef enum OPTION_choice {
|
||||||
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
||||||
OPT_IN, OPT_OUT, OPT_MODULE,
|
OPT_IN, OPT_OUT, OPT_MODULE,
|
||||||
OPT_PROV_NAME, OPT_SECTION_NAME, OPT_MAC_NAME, OPT_MACOPT, OPT_VERIFY,
|
OPT_PROV_NAME, OPT_SECTION_NAME, OPT_MAC_NAME, OPT_MACOPT, OPT_VERIFY,
|
||||||
OPT_NO_LOG, OPT_CORRUPT_DESC, OPT_CORRUPT_TYPE
|
OPT_NO_LOG, OPT_CORRUPT_DESC, OPT_CORRUPT_TYPE, OPT_QUIET
|
||||||
} OPTION_CHOICE;
|
} OPTION_CHOICE;
|
||||||
|
|
||||||
const OPTIONS fipsinstall_options[] = {
|
const OPTIONS fipsinstall_options[] = {
|
||||||
@@ -60,6 +63,7 @@ const OPTIONS fipsinstall_options[] = {
|
|||||||
{"noout", OPT_NO_LOG, '-', "Disable logging of self test events"},
|
{"noout", OPT_NO_LOG, '-', "Disable logging of self test events"},
|
||||||
{"corrupt_desc", OPT_CORRUPT_DESC, 's', "Corrupt a self test by description"},
|
{"corrupt_desc", OPT_CORRUPT_DESC, 's', "Corrupt a self test by description"},
|
||||||
{"corrupt_type", OPT_CORRUPT_TYPE, 's', "Corrupt a self test by type"},
|
{"corrupt_type", OPT_CORRUPT_TYPE, 's', "Corrupt a self test by type"},
|
||||||
|
{"quiet", OPT_QUIET, '-', "No messages, just exit status"},
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -287,7 +291,7 @@ int fipsinstall_main(int argc, char **argv)
|
|||||||
case OPT_ERR:
|
case OPT_ERR:
|
||||||
opthelp:
|
opthelp:
|
||||||
BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
|
BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
|
||||||
goto end;
|
goto cleanup;
|
||||||
case OPT_HELP:
|
case OPT_HELP:
|
||||||
opt_help(fipsinstall_options);
|
opt_help(fipsinstall_options);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@@ -298,6 +302,9 @@ opthelp:
|
|||||||
case OPT_OUT:
|
case OPT_OUT:
|
||||||
out_fname = opt_arg();
|
out_fname = opt_arg();
|
||||||
break;
|
break;
|
||||||
|
case OPT_QUIET:
|
||||||
|
quiet = 1;
|
||||||
|
/* FALLTHROUGH */
|
||||||
case OPT_NO_LOG:
|
case OPT_NO_LOG:
|
||||||
self_test_log = 0;
|
self_test_log = 0;
|
||||||
break;
|
break;
|
||||||
@@ -405,6 +412,7 @@ opthelp:
|
|||||||
if (!verify_config(in_fname, section_name, module_mac, module_mac_len,
|
if (!verify_config(in_fname, section_name, module_mac, module_mac_len,
|
||||||
install_mac, install_mac_len))
|
install_mac, install_mac_len))
|
||||||
goto end;
|
goto end;
|
||||||
|
if (!quiet)
|
||||||
BIO_printf(bio_out, "VERIFY PASSED\n");
|
BIO_printf(bio_out, "VERIFY PASSED\n");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -424,16 +432,19 @@ opthelp:
|
|||||||
module_mac_len, install_mac,
|
module_mac_len, install_mac,
|
||||||
install_mac_len))
|
install_mac_len))
|
||||||
goto end;
|
goto end;
|
||||||
|
if (!quiet)
|
||||||
BIO_printf(bio_out, "INSTALL PASSED\n");
|
BIO_printf(bio_out, "INSTALL PASSED\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
end:
|
end:
|
||||||
if (ret == 1) {
|
if (ret == 1) {
|
||||||
|
if (!quiet)
|
||||||
BIO_printf(bio_err, "%s FAILED\n", verify ? "VERIFY" : "INSTALL");
|
BIO_printf(bio_err, "%s FAILED\n", verify ? "VERIFY" : "INSTALL");
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cleanup:
|
||||||
BIO_free(fout);
|
BIO_free(fout);
|
||||||
BIO_free(mem_bio);
|
BIO_free(mem_bio);
|
||||||
BIO_free(module_bio);
|
BIO_free(module_bio);
|
||||||
|
|||||||
+31
-6
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -7,9 +7,6 @@
|
|||||||
* https://www.openssl.org/source/license.html
|
* https://www.openssl.org/source/license.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* We need to use some deprecated APIs */
|
|
||||||
#define OPENSSL_SUPPRESS_DEPRECATED
|
|
||||||
|
|
||||||
#include <openssl/opensslconf.h>
|
#include <openssl/opensslconf.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -58,6 +55,8 @@ int gendsa_main(int argc, char **argv)
|
|||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
BIO *out = NULL, *in = NULL;
|
BIO *out = NULL, *in = NULL;
|
||||||
DSA *dsa = NULL;
|
DSA *dsa = NULL;
|
||||||
|
EVP_PKEY *pkey = NULL;
|
||||||
|
EVP_PKEY_CTX *ctx = NULL;
|
||||||
const EVP_CIPHER *enc = NULL;
|
const EVP_CIPHER *enc = NULL;
|
||||||
char *dsaparams = NULL;
|
char *dsaparams = NULL;
|
||||||
char *outfile = NULL, *passoutarg = NULL, *passout = NULL, *prog;
|
char *outfile = NULL, *passoutarg = NULL, *passout = NULL, *prog;
|
||||||
@@ -139,14 +138,38 @@ int gendsa_main(int argc, char **argv)
|
|||||||
" Your key size is %d! Larger key size may behave not as expected.\n",
|
" Your key size is %d! Larger key size may behave not as expected.\n",
|
||||||
OPENSSL_DSA_MAX_MODULUS_BITS, BN_num_bits(p));
|
OPENSSL_DSA_MAX_MODULUS_BITS, BN_num_bits(p));
|
||||||
|
|
||||||
|
pkey = EVP_PKEY_new();
|
||||||
|
if (pkey == NULL) {
|
||||||
|
BIO_printf(bio_err, "unable to allocate PKEY\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (!EVP_PKEY_set1_DSA(pkey, dsa)) {
|
||||||
|
BIO_printf(bio_err, "unable to associate DSA parameters with PKEY\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
ctx = EVP_PKEY_CTX_new(pkey, NULL);
|
||||||
|
if (ctx == NULL) {
|
||||||
|
BIO_printf(bio_err, "unable to create PKEY context\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
|
pkey = NULL;
|
||||||
|
if (EVP_PKEY_keygen_init(ctx) <= 0) {
|
||||||
|
BIO_printf(bio_err, "unable to set up for key generation\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
if (verbose)
|
if (verbose)
|
||||||
BIO_printf(bio_err, "Generating DSA key, %d bits\n", BN_num_bits(p));
|
BIO_printf(bio_err, "Generating DSA key, %d bits\n", BN_num_bits(p));
|
||||||
if (!DSA_generate_key(dsa))
|
if (EVP_PKEY_keygen(ctx, &pkey) <= 0) {
|
||||||
|
BIO_printf(bio_err, "unable to generate key\n");
|
||||||
goto end;
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
assert(private);
|
assert(private);
|
||||||
if (!PEM_write_bio_DSAPrivateKey(out, dsa, enc, NULL, 0, NULL, passout))
|
if (!PEM_write_bio_PrivateKey(out, pkey, enc, NULL, 0, NULL, passout)) {
|
||||||
|
BIO_printf(bio_err, "unable to output generated key\n");
|
||||||
goto end;
|
goto end;
|
||||||
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
end:
|
end:
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
@@ -155,6 +178,8 @@ int gendsa_main(int argc, char **argv)
|
|||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
DSA_free(dsa);
|
DSA_free(dsa);
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
|
EVP_PKEY_CTX_free(ctx);
|
||||||
release_engine(e);
|
release_engine(e);
|
||||||
OPENSSL_free(passout);
|
OPENSSL_free(passout);
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
+49
-24
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
static int verbose = 0;
|
static int verbose = 0;
|
||||||
|
|
||||||
static int genrsa_cb(int p, int n, BN_GENCB *cb);
|
static int genrsa_cb(EVP_PKEY_CTX *ctx);
|
||||||
|
|
||||||
typedef enum OPTION_choice {
|
typedef enum OPTION_choice {
|
||||||
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
||||||
@@ -70,24 +70,24 @@ const OPTIONS genrsa_options[] = {
|
|||||||
int genrsa_main(int argc, char **argv)
|
int genrsa_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
BN_GENCB *cb = BN_GENCB_new();
|
BN_GENCB *cb = BN_GENCB_new();
|
||||||
PW_CB_DATA cb_data;
|
|
||||||
ENGINE *eng = NULL;
|
ENGINE *eng = NULL;
|
||||||
BIGNUM *bn = BN_new();
|
BIGNUM *bn = BN_new();
|
||||||
|
RSA *rsa;
|
||||||
BIO *out = NULL;
|
BIO *out = NULL;
|
||||||
const BIGNUM *e;
|
const BIGNUM *e;
|
||||||
RSA *rsa = NULL;
|
EVP_PKEY *pkey = NULL;
|
||||||
|
EVP_PKEY_CTX *ctx = NULL;
|
||||||
const EVP_CIPHER *enc = NULL;
|
const EVP_CIPHER *enc = NULL;
|
||||||
int ret = 1, num = DEFBITS, private = 0, primes = DEFPRIMES;
|
int ret = 1, num = DEFBITS, private = 0, primes = DEFPRIMES;
|
||||||
unsigned long f4 = RSA_F4;
|
unsigned long f4 = RSA_F4;
|
||||||
char *outfile = NULL, *passoutarg = NULL, *passout = NULL;
|
char *outfile = NULL, *passoutarg = NULL, *passout = NULL;
|
||||||
char *prog, *hexe, *dece;
|
char *prog, *hexe, *dece;
|
||||||
OPTION_CHOICE o;
|
OPTION_CHOICE o;
|
||||||
|
unsigned char *ebuf = NULL;
|
||||||
|
|
||||||
if (bn == NULL || cb == NULL)
|
if (bn == NULL || cb == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
BN_GENCB_set(cb, genrsa_cb, bio_err);
|
|
||||||
|
|
||||||
prog = opt_init(argc, argv, genrsa_options);
|
prog = opt_init(argc, argv, genrsa_options);
|
||||||
while ((o = opt_next()) != OPT_EOF) {
|
while ((o = opt_next()) != OPT_EOF) {
|
||||||
switch (o) {
|
switch (o) {
|
||||||
@@ -101,7 +101,7 @@ opthelp:
|
|||||||
opt_help(genrsa_options);
|
opt_help(genrsa_options);
|
||||||
goto end;
|
goto end;
|
||||||
case OPT_3:
|
case OPT_3:
|
||||||
f4 = 3;
|
f4 = RSA_3;
|
||||||
break;
|
break;
|
||||||
case OPT_F4:
|
case OPT_F4:
|
||||||
f4 = RSA_F4;
|
f4 = RSA_F4;
|
||||||
@@ -162,49 +162,74 @@ opthelp:
|
|||||||
if (out == NULL)
|
if (out == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
if (!init_gen_str(&ctx, "RSA", eng, 0))
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
EVP_PKEY_CTX_set_cb(ctx, genrsa_cb);
|
||||||
|
EVP_PKEY_CTX_set_app_data(ctx, bio_err);
|
||||||
|
|
||||||
|
if (EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, num) <= 0) {
|
||||||
|
BIO_printf(bio_err, "Error setting RSA length\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (!BN_set_word(bn, f4)) {
|
||||||
|
BIO_printf(bio_err, "Error allocating RSA public exponent\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx, bn) <= 0) {
|
||||||
|
BIO_printf(bio_err, "Error setting RSA public exponent\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
if (EVP_PKEY_CTX_set_rsa_keygen_primes(ctx, primes) <= 0) {
|
||||||
|
BIO_printf(bio_err, "Error setting number of primes\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
if (verbose)
|
if (verbose)
|
||||||
BIO_printf(bio_err, "Generating RSA private key, %d bit long modulus (%d primes)\n",
|
BIO_printf(bio_err, "Generating RSA private key, %d bit long modulus (%d primes)\n",
|
||||||
num, primes);
|
num, primes);
|
||||||
rsa = eng ? RSA_new_method(eng) : RSA_new();
|
if (!EVP_PKEY_keygen(ctx, &pkey)) {
|
||||||
if (rsa == NULL)
|
BIO_printf(bio_err, "Error generating RSA key\n");
|
||||||
goto end;
|
|
||||||
|
|
||||||
if (!BN_set_word(bn, f4)
|
|
||||||
|| !RSA_generate_multi_prime_key(rsa, num, primes, bn, cb))
|
|
||||||
goto end;
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (verbose) {
|
||||||
|
if ((rsa = EVP_PKEY_get0_RSA(pkey)) != NULL) {
|
||||||
RSA_get0_key(rsa, NULL, &e, NULL);
|
RSA_get0_key(rsa, NULL, &e, NULL);
|
||||||
|
} else {
|
||||||
|
BIO_printf(bio_err, "Error cannot access RSA e\n");
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
hexe = BN_bn2hex(e);
|
hexe = BN_bn2hex(e);
|
||||||
dece = BN_bn2dec(e);
|
dece = BN_bn2dec(e);
|
||||||
if (hexe && dece && verbose) {
|
if (hexe && dece) {
|
||||||
BIO_printf(bio_err, "e is %s (0x%s)\n", dece, hexe);
|
BIO_printf(bio_err, "e is %s (0x%s)\n", dece, hexe);
|
||||||
}
|
}
|
||||||
OPENSSL_free(hexe);
|
OPENSSL_free(hexe);
|
||||||
OPENSSL_free(dece);
|
OPENSSL_free(dece);
|
||||||
cb_data.password = passout;
|
}
|
||||||
cb_data.prompt_info = outfile;
|
if (!PEM_write_bio_PrivateKey(out, pkey, enc, NULL, 0, NULL, passout))
|
||||||
assert(private);
|
|
||||||
if (!PEM_write_bio_RSAPrivateKey(out, rsa, enc, NULL, 0,
|
|
||||||
(pem_password_cb *)password_callback,
|
|
||||||
&cb_data))
|
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
end:
|
end:
|
||||||
BN_free(bn);
|
BN_free(bn);
|
||||||
BN_GENCB_free(cb);
|
BN_GENCB_free(cb);
|
||||||
RSA_free(rsa);
|
EVP_PKEY_CTX_free(ctx);
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
release_engine(eng);
|
release_engine(eng);
|
||||||
OPENSSL_free(passout);
|
OPENSSL_free(passout);
|
||||||
|
OPENSSL_free(ebuf);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int genrsa_cb(int p, int n, BN_GENCB *cb)
|
static int genrsa_cb(EVP_PKEY_CTX *ctx)
|
||||||
{
|
{
|
||||||
char c = '*';
|
char c = '*';
|
||||||
|
BIO *b = EVP_PKEY_CTX_get_app_data(ctx);
|
||||||
|
int p = EVP_PKEY_CTX_get_keygen_info(ctx, 0);
|
||||||
|
|
||||||
if (!verbose)
|
if (!verbose)
|
||||||
return 1;
|
return 1;
|
||||||
@@ -217,7 +242,7 @@ static int genrsa_cb(int p, int n, BN_GENCB *cb)
|
|||||||
c = '*';
|
c = '*';
|
||||||
if (p == 3)
|
if (p == 3)
|
||||||
c = '\n';
|
c = '\n';
|
||||||
BIO_write(BN_GENCB_get_arg(cb), &c, 1);
|
BIO_write(b, &c, 1);
|
||||||
(void)BIO_flush(BN_GENCB_get_arg(cb));
|
(void)BIO_flush(b);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
+8
-7
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -104,16 +104,17 @@ int set_ext_copy(int *copy_type, const char *arg);
|
|||||||
int copy_extensions(X509 *x, X509_REQ *req, int copy_type);
|
int copy_extensions(X509 *x, X509_REQ *req, int copy_type);
|
||||||
int app_passwd(const char *arg1, const char *arg2, char **pass1, char **pass2);
|
int app_passwd(const char *arg1, const char *arg2, char **pass1, char **pass2);
|
||||||
int add_oid_section(CONF *conf);
|
int add_oid_section(CONF *conf);
|
||||||
X509 *load_cert(const char *file, int format, const char *cert_descrip);
|
X509_REQ *load_csr(const char *file, int format, const char *desc);
|
||||||
X509_CRL *load_crl(const char *infile, int format);
|
X509 *load_cert(const char *file, int format, const char *desc);
|
||||||
|
X509_CRL *load_crl(const char *infile, int format, const char *desc);
|
||||||
EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
|
EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
|
||||||
const char *pass, ENGINE *e, const char *key_descrip);
|
const char *pass, ENGINE *e, const char *desc);
|
||||||
EVP_PKEY *load_pubkey(const char *file, int format, int maybe_stdin,
|
EVP_PKEY *load_pubkey(const char *file, int format, int maybe_stdin,
|
||||||
const char *pass, ENGINE *e, const char *key_descrip);
|
const char *pass, ENGINE *e, const char *desc);
|
||||||
int load_certs(const char *file, STACK_OF(X509) **certs, int format,
|
int load_certs(const char *file, STACK_OF(X509) **certs, int format,
|
||||||
const char *pass, const char *cert_descrip);
|
const char *pass, const char *desc);
|
||||||
int load_crls(const char *file, STACK_OF(X509_CRL) **crls, int format,
|
int load_crls(const char *file, STACK_OF(X509_CRL) **crls, int format,
|
||||||
const char *pass, const char *cert_descrip);
|
const char *pass, const char *desc);
|
||||||
X509_STORE *setup_verify(const char *CAfile, int noCAfile,
|
X509_STORE *setup_verify(const char *CAfile, int noCAfile,
|
||||||
const char *CApath, int noCApath,
|
const char *CApath, int noCApath,
|
||||||
const char *CAstore, int noCAstore);
|
const char *CAstore, int noCAstore);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -26,6 +26,7 @@ typedef struct function_st {
|
|||||||
int (*func)(int argc, char *argv[]);
|
int (*func)(int argc, char *argv[]);
|
||||||
const OPTIONS *help;
|
const OPTIONS *help;
|
||||||
const char *deprecated_alternative;
|
const char *deprecated_alternative;
|
||||||
|
const char *deprecated_version;
|
||||||
} FUNCTION;
|
} FUNCTION;
|
||||||
|
|
||||||
DEFINE_LHASH_OF(FUNCTION);
|
DEFINE_LHASH_OF(FUNCTION);
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -342,6 +342,7 @@ char *opt_init(int ac, char **av, const OPTIONS * o);
|
|||||||
int opt_next(void);
|
int opt_next(void);
|
||||||
void opt_begin(void);
|
void opt_begin(void);
|
||||||
int opt_format(const char *s, unsigned long flags, int *result);
|
int opt_format(const char *s, unsigned long flags, int *result);
|
||||||
|
const char *format2str(int format);
|
||||||
int opt_int(const char *arg, int *result);
|
int opt_int(const char *arg, int *result);
|
||||||
int opt_ulong(const char *arg, unsigned long *result);
|
int opt_ulong(const char *arg, unsigned long *result);
|
||||||
int opt_long(const char *arg, long *result);
|
int opt_long(const char *arg, long *result);
|
||||||
@@ -370,6 +371,7 @@ int opt_provider(int i);
|
|||||||
void opt_help(const OPTIONS * list);
|
void opt_help(const OPTIONS * list);
|
||||||
void opt_print(const OPTIONS * opt, int doingparams, int width);
|
void opt_print(const OPTIONS * opt, int doingparams, int width);
|
||||||
int opt_format_error(const char *s, unsigned long flags);
|
int opt_format_error(const char *s, unsigned long flags);
|
||||||
|
void print_format_error(int format, unsigned long flags);
|
||||||
int opt_isdir(const char *name);
|
int opt_isdir(const char *name);
|
||||||
int opt_printf_stderr(const char *fmt, ...);
|
int opt_printf_stderr(const char *fmt, ...);
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -17,6 +17,8 @@
|
|||||||
#include <openssl/kdf.h>
|
#include <openssl/kdf.h>
|
||||||
#include <openssl/params.h>
|
#include <openssl/params.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
typedef enum OPTION_choice {
|
typedef enum OPTION_choice {
|
||||||
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
||||||
OPT_KDFOPT, OPT_BIN, OPT_KEYLEN, OPT_OUT,
|
OPT_KDFOPT, OPT_BIN, OPT_KEYLEN, OPT_OUT,
|
||||||
|
|||||||
+136
-75
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -57,6 +57,17 @@ static int WIN32_rename(const char *from, const char *to);
|
|||||||
|
|
||||||
#define PASS_SOURCE_SIZE_MAX 4
|
#define PASS_SOURCE_SIZE_MAX 4
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(CONF)
|
||||||
|
DEFINE_STACK_OF(CONF_VALUE)
|
||||||
|
DEFINE_STACK_OF(X509)
|
||||||
|
DEFINE_STACK_OF(X509_CRL)
|
||||||
|
DEFINE_STACK_OF(X509_INFO)
|
||||||
|
DEFINE_STACK_OF(X509_EXTENSION)
|
||||||
|
DEFINE_STACK_OF(X509_POLICY_NODE)
|
||||||
|
DEFINE_STACK_OF(GENERAL_NAME)
|
||||||
|
DEFINE_STACK_OF(DIST_POINT)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char *name;
|
const char *name;
|
||||||
unsigned long flag;
|
unsigned long flag;
|
||||||
@@ -410,7 +421,7 @@ static int load_pkcs12(BIO *in, const char *desc,
|
|||||||
int len, ret = 0;
|
int len, ret = 0;
|
||||||
PKCS12 *p12;
|
PKCS12 *p12;
|
||||||
p12 = d2i_PKCS12_bio(in, NULL);
|
p12 = d2i_PKCS12_bio(in, NULL);
|
||||||
if (p12 == NULL) {
|
if (p12 == NULL && desc != NULL) {
|
||||||
BIO_printf(bio_err, "Error loading PKCS12 file for %s\n", desc);
|
BIO_printf(bio_err, "Error loading PKCS12 file for %s\n", desc);
|
||||||
goto die;
|
goto die;
|
||||||
}
|
}
|
||||||
@@ -422,7 +433,8 @@ static int load_pkcs12(BIO *in, const char *desc,
|
|||||||
pem_cb = (pem_password_cb *)password_callback;
|
pem_cb = (pem_password_cb *)password_callback;
|
||||||
len = pem_cb(tpass, PEM_BUFSIZE, 0, cb_data);
|
len = pem_cb(tpass, PEM_BUFSIZE, 0, cb_data);
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
BIO_printf(bio_err, "Passphrase callback error for %s\n", desc);
|
BIO_printf(bio_err, "Passphrase callback error for %s\n",
|
||||||
|
desc != NULL ? desc : "PKCS12 input");
|
||||||
goto die;
|
goto die;
|
||||||
}
|
}
|
||||||
if (len < PEM_BUFSIZE)
|
if (len < PEM_BUFSIZE)
|
||||||
@@ -430,7 +442,7 @@ static int load_pkcs12(BIO *in, const char *desc,
|
|||||||
if (!PKCS12_verify_mac(p12, tpass, len)) {
|
if (!PKCS12_verify_mac(p12, tpass, len)) {
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
"Mac verify error (wrong password?) in PKCS12 file for %s\n",
|
"Mac verify error (wrong password?) in PKCS12 file for %s\n",
|
||||||
desc);
|
desc != NULL ? desc : "PKCS12 input");
|
||||||
goto die;
|
goto die;
|
||||||
}
|
}
|
||||||
pass = tpass;
|
pass = tpass;
|
||||||
@@ -441,7 +453,7 @@ static int load_pkcs12(BIO *in, const char *desc,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
X509 *load_cert(const char *file, int format, const char *cert_descrip)
|
X509 *load_cert(const char *file, int format, const char *desc)
|
||||||
{
|
{
|
||||||
X509 *x = NULL;
|
X509 *x = NULL;
|
||||||
BIO *cert;
|
BIO *cert;
|
||||||
@@ -468,22 +480,26 @@ X509 *load_cert(const char *file, int format, const char *cert_descrip)
|
|||||||
x = PEM_read_bio_X509_AUX(cert, NULL,
|
x = PEM_read_bio_X509_AUX(cert, NULL,
|
||||||
(pem_password_cb *)password_callback, NULL);
|
(pem_password_cb *)password_callback, NULL);
|
||||||
} else if (format == FORMAT_PKCS12) {
|
} else if (format == FORMAT_PKCS12) {
|
||||||
if (!load_pkcs12(cert, cert_descrip, NULL, NULL, NULL, &x, NULL))
|
if (!load_pkcs12(cert, desc, NULL, NULL, NULL, &x, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
} else {
|
} else {
|
||||||
BIO_printf(bio_err, "bad input format specified for %s\n", cert_descrip);
|
print_format_error(format,
|
||||||
goto end;
|
#if !defined(OPENSSL_NO_OCSP) && !defined(OPENSSL_NO_SOCK)
|
||||||
|
OPT_FMT_HTTP |
|
||||||
|
#endif
|
||||||
|
OPT_FMT_PEMDER | OPT_FMT_PKCS12);
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (x == NULL) {
|
if (x == NULL && desc != NULL) {
|
||||||
BIO_printf(bio_err, "unable to load certificate\n");
|
BIO_printf(bio_err, "Unable to load %s\n", desc);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
}
|
}
|
||||||
BIO_free(cert);
|
BIO_free(cert);
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
X509_CRL *load_crl(const char *infile, int format)
|
X509_CRL *load_crl(const char *infile, int format, const char *desc)
|
||||||
{
|
{
|
||||||
X509_CRL *x = NULL;
|
X509_CRL *x = NULL;
|
||||||
BIO *in = NULL;
|
BIO *in = NULL;
|
||||||
@@ -502,23 +518,45 @@ X509_CRL *load_crl(const char *infile, int format)
|
|||||||
x = d2i_X509_CRL_bio(in, NULL);
|
x = d2i_X509_CRL_bio(in, NULL);
|
||||||
} else if (format == FORMAT_PEM) {
|
} else if (format == FORMAT_PEM) {
|
||||||
x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL);
|
x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL);
|
||||||
} else {
|
} else
|
||||||
BIO_printf(bio_err, "bad input format specified for input crl\n");
|
print_format_error(format, OPT_FMT_PEMDER);
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
if (x == NULL) {
|
|
||||||
BIO_printf(bio_err, "unable to load CRL\n");
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
if (x == NULL && desc != NULL) {
|
||||||
|
BIO_printf(bio_err, "Unable to load %s\n", desc);
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
}
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
X509_REQ *load_csr(const char *file, int format, const char *desc)
|
||||||
|
{
|
||||||
|
X509_REQ *req = NULL;
|
||||||
|
BIO *in;
|
||||||
|
|
||||||
|
in = bio_open_default(file, 'r', format);
|
||||||
|
if (in == NULL)
|
||||||
|
goto end;
|
||||||
|
|
||||||
|
if (format == FORMAT_ASN1)
|
||||||
|
req = d2i_X509_REQ_bio(in, NULL);
|
||||||
|
else if (format == FORMAT_PEM)
|
||||||
|
req = PEM_read_bio_X509_REQ(in, NULL, NULL, NULL);
|
||||||
|
else
|
||||||
|
print_format_error(format, OPT_FMT_PEMDER);
|
||||||
|
|
||||||
|
end:
|
||||||
|
if (req == NULL && desc != NULL) {
|
||||||
|
BIO_printf(bio_err, "Unable to load %s\n", desc);
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
}
|
||||||
|
BIO_free(in);
|
||||||
|
return req;
|
||||||
|
}
|
||||||
|
|
||||||
EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
|
EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
|
||||||
const char *pass, ENGINE *e, const char *key_descrip)
|
const char *pass, ENGINE *e, const char *desc)
|
||||||
{
|
{
|
||||||
BIO *key = NULL;
|
BIO *key = NULL;
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey = NULL;
|
||||||
@@ -528,12 +566,12 @@ EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
|
|||||||
cb_data.prompt_info = file;
|
cb_data.prompt_info = file;
|
||||||
|
|
||||||
if (file == NULL && (!maybe_stdin || format == FORMAT_ENGINE)) {
|
if (file == NULL && (!maybe_stdin || format == FORMAT_ENGINE)) {
|
||||||
BIO_printf(bio_err, "no keyfile specified\n");
|
BIO_printf(bio_err, "No keyfile specified\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (format == FORMAT_ENGINE) {
|
if (format == FORMAT_ENGINE) {
|
||||||
if (e == NULL) {
|
if (e == NULL) {
|
||||||
BIO_printf(bio_err, "no engine specified\n");
|
BIO_printf(bio_err, "No engine specified\n");
|
||||||
} else {
|
} else {
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
if (ENGINE_init(e)) {
|
if (ENGINE_init(e)) {
|
||||||
@@ -542,12 +580,12 @@ EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
|
|||||||
&cb_data);
|
&cb_data);
|
||||||
ENGINE_finish(e);
|
ENGINE_finish(e);
|
||||||
}
|
}
|
||||||
if (pkey == NULL) {
|
if (pkey == NULL && desc != NULL) {
|
||||||
BIO_printf(bio_err, "cannot load %s from engine\n", key_descrip);
|
BIO_printf(bio_err, "Cannot load %s from engine\n", desc);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
BIO_printf(bio_err, "engines not supported\n");
|
BIO_printf(bio_err, "Engines not supported\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
goto end;
|
goto end;
|
||||||
@@ -565,7 +603,8 @@ EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
|
|||||||
} else if (format == FORMAT_PEM) {
|
} else if (format == FORMAT_PEM) {
|
||||||
pkey = PEM_read_bio_PrivateKey(key, NULL, wrap_password_callback, &cb_data);
|
pkey = PEM_read_bio_PrivateKey(key, NULL, wrap_password_callback, &cb_data);
|
||||||
} else if (format == FORMAT_PKCS12) {
|
} else if (format == FORMAT_PKCS12) {
|
||||||
if (!load_pkcs12(key, key_descrip, wrap_password_callback, &cb_data,
|
if (!load_pkcs12(key, desc,
|
||||||
|
(pem_password_cb *)password_callback, &cb_data,
|
||||||
&pkey, NULL, NULL))
|
&pkey, NULL, NULL))
|
||||||
goto end;
|
goto end;
|
||||||
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA) && !defined (OPENSSL_NO_RC4)
|
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA) && !defined (OPENSSL_NO_RC4)
|
||||||
@@ -575,20 +614,27 @@ EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
|
|||||||
pkey = b2i_PVK_bio(key, wrap_password_callback, &cb_data);
|
pkey = b2i_PVK_bio(key, wrap_password_callback, &cb_data);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
BIO_printf(bio_err, "bad input format specified for key file\n");
|
print_format_error(format, OPT_FMT_PEMDER | OPT_FMT_PKCS12
|
||||||
goto end;
|
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA) && !defined (OPENSSL_NO_RC4)
|
||||||
|
| OPT_FMT_MSBLOB | FORMAT_PVK
|
||||||
|
#endif
|
||||||
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
|
| OPT_FMT_ENGINE
|
||||||
|
#endif
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
BIO_free(key);
|
BIO_free(key);
|
||||||
if (pkey == NULL) {
|
if (pkey == NULL && desc != NULL) {
|
||||||
BIO_printf(bio_err, "unable to load %s\n", key_descrip);
|
BIO_printf(bio_err, "Unable to load %s\n", desc);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
}
|
}
|
||||||
return pkey;
|
return pkey;
|
||||||
}
|
}
|
||||||
|
|
||||||
EVP_PKEY *load_pubkey(const char *file, int format, int maybe_stdin,
|
EVP_PKEY *load_pubkey(const char *file, int format, int maybe_stdin,
|
||||||
const char *pass, ENGINE *e, const char *key_descrip)
|
const char *pass, ENGINE *e, const char *desc)
|
||||||
{
|
{
|
||||||
BIO *key = NULL;
|
BIO *key = NULL;
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey = NULL;
|
||||||
@@ -598,22 +644,22 @@ EVP_PKEY *load_pubkey(const char *file, int format, int maybe_stdin,
|
|||||||
cb_data.prompt_info = file;
|
cb_data.prompt_info = file;
|
||||||
|
|
||||||
if (file == NULL && (!maybe_stdin || format == FORMAT_ENGINE)) {
|
if (file == NULL && (!maybe_stdin || format == FORMAT_ENGINE)) {
|
||||||
BIO_printf(bio_err, "no keyfile specified\n");
|
BIO_printf(bio_err, "No keyfile specified\n");
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (format == FORMAT_ENGINE) {
|
if (format == FORMAT_ENGINE) {
|
||||||
if (e == NULL) {
|
if (e == NULL) {
|
||||||
BIO_printf(bio_err, "no engine specified\n");
|
BIO_printf(bio_err, "No engine specified\n");
|
||||||
} else {
|
} else {
|
||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
pkey = ENGINE_load_public_key(e, file, (UI_METHOD *)get_ui_method(),
|
pkey = ENGINE_load_public_key(e, file, (UI_METHOD *)get_ui_method(),
|
||||||
&cb_data);
|
&cb_data);
|
||||||
if (pkey == NULL) {
|
if (pkey == NULL && desc != NULL) {
|
||||||
BIO_printf(bio_err, "cannot load %s from engine\n", key_descrip);
|
BIO_printf(bio_err, "Cannot load %s from engine\n", desc);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
BIO_printf(bio_err, "engines not supported\n");
|
BIO_printf(bio_err, "Engines not supported\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
goto end;
|
goto end;
|
||||||
@@ -666,11 +712,19 @@ EVP_PKEY *load_pubkey(const char *file, int format, int maybe_stdin,
|
|||||||
} else if (format == FORMAT_MSBLOB) {
|
} else if (format == FORMAT_MSBLOB) {
|
||||||
pkey = b2i_PublicKey_bio(key);
|
pkey = b2i_PublicKey_bio(key);
|
||||||
#endif
|
#endif
|
||||||
|
} else {
|
||||||
|
print_format_error(format, OPT_FMT_PEMDER
|
||||||
|
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA)
|
||||||
|
| OPT_FMT_MSBLOB
|
||||||
|
#endif
|
||||||
|
);
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
BIO_free(key);
|
BIO_free(key);
|
||||||
if (pkey == NULL)
|
if (pkey == NULL && desc != NULL) {
|
||||||
BIO_printf(bio_err, "unable to load %s\n", key_descrip);
|
BIO_printf(bio_err, "Unable to load %s\n", desc);
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
}
|
||||||
return pkey;
|
return pkey;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -690,7 +744,7 @@ static int load_certs_crls(const char *file, int format,
|
|||||||
cb_data.prompt_info = file;
|
cb_data.prompt_info = file;
|
||||||
|
|
||||||
if (format != FORMAT_PEM) {
|
if (format != FORMAT_PEM) {
|
||||||
BIO_printf(bio_err, "bad input format specified for %s\n", desc);
|
BIO_printf(bio_err, "Bad input format specified for %s\n", desc);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -749,10 +803,12 @@ static int load_certs_crls(const char *file, int format,
|
|||||||
sk_X509_CRL_pop_free(*pcrls, X509_CRL_free);
|
sk_X509_CRL_pop_free(*pcrls, X509_CRL_free);
|
||||||
*pcrls = NULL;
|
*pcrls = NULL;
|
||||||
}
|
}
|
||||||
BIO_printf(bio_err, "unable to load %s\n",
|
if (desc != NULL) {
|
||||||
pcerts ? "certificates" : "CRLs");
|
BIO_printf(bio_err, "Unable to load %s for %s\n",
|
||||||
|
pcerts ? "certificates" : "CRLs", desc);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1083,6 +1139,7 @@ X509_STORE *setup_verify(const char *CAfile, int noCAfile,
|
|||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
return store;
|
return store;
|
||||||
end:
|
end:
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
X509_STORE_free(store);
|
X509_STORE_free(store);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -1110,13 +1167,13 @@ ENGINE *setup_engine(const char *engine, int debug)
|
|||||||
#ifndef OPENSSL_NO_ENGINE
|
#ifndef OPENSSL_NO_ENGINE
|
||||||
if (engine != NULL) {
|
if (engine != NULL) {
|
||||||
if (strcmp(engine, "auto") == 0) {
|
if (strcmp(engine, "auto") == 0) {
|
||||||
BIO_printf(bio_err, "enabling auto ENGINE support\n");
|
BIO_printf(bio_err, "Enabling auto ENGINE support\n");
|
||||||
ENGINE_register_all_complete();
|
ENGINE_register_all_complete();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if ((e = ENGINE_by_id(engine)) == NULL
|
if ((e = ENGINE_by_id(engine)) == NULL
|
||||||
&& (e = try_load_engine(engine)) == NULL) {
|
&& (e = try_load_engine(engine)) == NULL) {
|
||||||
BIO_printf(bio_err, "invalid engine \"%s\"\n", engine);
|
BIO_printf(bio_err, "Invalid engine \"%s\"\n", engine);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -1126,13 +1183,13 @@ ENGINE *setup_engine(const char *engine, int debug)
|
|||||||
ENGINE_ctrl_cmd(e, "SET_USER_INTERFACE", 0, (void *)get_ui_method(),
|
ENGINE_ctrl_cmd(e, "SET_USER_INTERFACE", 0, (void *)get_ui_method(),
|
||||||
0, 1);
|
0, 1);
|
||||||
if (!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
|
if (!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
|
||||||
BIO_printf(bio_err, "can't use that engine\n");
|
BIO_printf(bio_err, "Cannot use engine \"%s\"\n", ENGINE_get_id(e));
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
ENGINE_free(e);
|
ENGINE_free(e);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
BIO_printf(bio_err, "engine \"%s\" set.\n", ENGINE_get_id(e));
|
BIO_printf(bio_err, "Engine \"%s\" set.\n", ENGINE_get_id(e));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return e;
|
return e;
|
||||||
@@ -1211,14 +1268,13 @@ BIGNUM *load_serial(const char *serialfile, int create, ASN1_INTEGER **retai)
|
|||||||
BIO_printf(bio_err, "Out of memory\n");
|
BIO_printf(bio_err, "Out of memory\n");
|
||||||
} else {
|
} else {
|
||||||
if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) {
|
if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) {
|
||||||
BIO_printf(bio_err, "unable to load number from %s\n",
|
BIO_printf(bio_err, "Unable to load number from %s\n",
|
||||||
serialfile);
|
serialfile);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
ret = ASN1_INTEGER_to_BN(ai, NULL);
|
ret = ASN1_INTEGER_to_BN(ai, NULL);
|
||||||
if (ret == NULL) {
|
if (ret == NULL) {
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err, "Error converting number from bin to BIGNUM\n");
|
||||||
"error converting number from bin to BIGNUM\n");
|
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1228,6 +1284,7 @@ BIGNUM *load_serial(const char *serialfile, int create, ASN1_INTEGER **retai)
|
|||||||
ai = NULL;
|
ai = NULL;
|
||||||
}
|
}
|
||||||
err:
|
err:
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
BIO_free(in);
|
BIO_free(in);
|
||||||
ASN1_INTEGER_free(ai);
|
ASN1_INTEGER_free(ai);
|
||||||
return ret;
|
return ret;
|
||||||
@@ -1247,7 +1304,7 @@ int save_serial(const char *serialfile, const char *suffix, const BIGNUM *serial
|
|||||||
else
|
else
|
||||||
j = strlen(serialfile) + strlen(suffix) + 1;
|
j = strlen(serialfile) + strlen(suffix) + 1;
|
||||||
if (j >= BSIZE) {
|
if (j >= BSIZE) {
|
||||||
BIO_printf(bio_err, "file name too long\n");
|
BIO_printf(bio_err, "File name too long\n");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1262,7 +1319,6 @@ int save_serial(const char *serialfile, const char *suffix, const BIGNUM *serial
|
|||||||
}
|
}
|
||||||
out = BIO_new_file(buf[0], "w");
|
out = BIO_new_file(buf[0], "w");
|
||||||
if (out == NULL) {
|
if (out == NULL) {
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1278,6 +1334,8 @@ int save_serial(const char *serialfile, const char *suffix, const BIGNUM *serial
|
|||||||
ai = NULL;
|
ai = NULL;
|
||||||
}
|
}
|
||||||
err:
|
err:
|
||||||
|
if (!ret)
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
ASN1_INTEGER_free(ai);
|
ASN1_INTEGER_free(ai);
|
||||||
return ret;
|
return ret;
|
||||||
@@ -1294,7 +1352,7 @@ int rotate_serial(const char *serialfile, const char *new_suffix,
|
|||||||
if (i > j)
|
if (i > j)
|
||||||
j = i;
|
j = i;
|
||||||
if (j + 1 >= BSIZE) {
|
if (j + 1 >= BSIZE) {
|
||||||
BIO_printf(bio_err, "file name too long\n");
|
BIO_printf(bio_err, "File name too long\n");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
#ifndef OPENSSL_SYS_VMS
|
#ifndef OPENSSL_SYS_VMS
|
||||||
@@ -1310,19 +1368,20 @@ int rotate_serial(const char *serialfile, const char *new_suffix,
|
|||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
"unable to rename %s to %s\n", serialfile, buf[1]);
|
"Unable to rename %s to %s\n", serialfile, buf[1]);
|
||||||
perror("reason");
|
perror("reason");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if (rename(buf[0], serialfile) < 0) {
|
if (rename(buf[0], serialfile) < 0) {
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
"unable to rename %s to %s\n", buf[0], serialfile);
|
"Unable to rename %s to %s\n", buf[0], serialfile);
|
||||||
perror("reason");
|
perror("reason");
|
||||||
rename(buf[1], serialfile);
|
rename(buf[1], serialfile);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
err:
|
err:
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1363,17 +1422,14 @@ CA_DB *load_index(const char *dbfile, DB_ATTR *db_attr)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
in = BIO_new_file(dbfile, "r");
|
in = BIO_new_file(dbfile, "r");
|
||||||
if (in == NULL) {
|
if (in == NULL)
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto err;
|
goto err;
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_POSIX_IO
|
#ifndef OPENSSL_NO_POSIX_IO
|
||||||
BIO_get_fp(in, &dbfp);
|
BIO_get_fp(in, &dbfp);
|
||||||
if (fstat(fileno(dbfp), &dbst) == -1) {
|
if (fstat(fileno(dbfp), &dbst) == -1) {
|
||||||
ERR_raise_data(ERR_LIB_SYS, errno,
|
ERR_raise_data(ERR_LIB_SYS, errno,
|
||||||
"calling fstat(%s)", dbfile);
|
"calling fstat(%s)", dbfile);
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1410,6 +1466,7 @@ CA_DB *load_index(const char *dbfile, DB_ATTR *db_attr)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
err:
|
err:
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
NCONF_free(dbattr_conf);
|
NCONF_free(dbattr_conf);
|
||||||
TXT_DB_free(tmpdb);
|
TXT_DB_free(tmpdb);
|
||||||
BIO_free_all(in);
|
BIO_free_all(in);
|
||||||
@@ -1425,20 +1482,23 @@ int index_index(CA_DB *db)
|
|||||||
LHASH_HASH_FN(index_serial),
|
LHASH_HASH_FN(index_serial),
|
||||||
LHASH_COMP_FN(index_serial))) {
|
LHASH_COMP_FN(index_serial))) {
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
"error creating serial number index:(%ld,%ld,%ld)\n",
|
"Error creating serial number index:(%ld,%ld,%ld)\n",
|
||||||
db->db->error, db->db->arg1, db->db->arg2);
|
db->db->error, db->db->arg1, db->db->arg2);
|
||||||
return 0;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (db->attributes.unique_subject
|
if (db->attributes.unique_subject
|
||||||
&& !TXT_DB_create_index(db->db, DB_name, index_name_qual,
|
&& !TXT_DB_create_index(db->db, DB_name, index_name_qual,
|
||||||
LHASH_HASH_FN(index_name),
|
LHASH_HASH_FN(index_name),
|
||||||
LHASH_COMP_FN(index_name))) {
|
LHASH_COMP_FN(index_name))) {
|
||||||
BIO_printf(bio_err, "error creating name index:(%ld,%ld,%ld)\n",
|
BIO_printf(bio_err, "Error creating name index:(%ld,%ld,%ld)\n",
|
||||||
db->db->error, db->db->arg1, db->db->arg2);
|
db->db->error, db->db->arg1, db->db->arg2);
|
||||||
return 0;
|
goto err;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
err:
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int save_index(const char *dbfile, const char *suffix, CA_DB *db)
|
int save_index(const char *dbfile, const char *suffix, CA_DB *db)
|
||||||
@@ -1449,7 +1509,7 @@ int save_index(const char *dbfile, const char *suffix, CA_DB *db)
|
|||||||
|
|
||||||
j = strlen(dbfile) + strlen(suffix);
|
j = strlen(dbfile) + strlen(suffix);
|
||||||
if (j + 6 >= BSIZE) {
|
if (j + 6 >= BSIZE) {
|
||||||
BIO_printf(bio_err, "file name too long\n");
|
BIO_printf(bio_err, "File name too long\n");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
#ifndef OPENSSL_SYS_VMS
|
#ifndef OPENSSL_SYS_VMS
|
||||||
@@ -1464,7 +1524,7 @@ int save_index(const char *dbfile, const char *suffix, CA_DB *db)
|
|||||||
out = BIO_new_file(buf[0], "w");
|
out = BIO_new_file(buf[0], "w");
|
||||||
if (out == NULL) {
|
if (out == NULL) {
|
||||||
perror(dbfile);
|
perror(dbfile);
|
||||||
BIO_printf(bio_err, "unable to open '%s'\n", dbfile);
|
BIO_printf(bio_err, "Unable to open '%s'\n", dbfile);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
j = TXT_DB_write(out, db->db);
|
j = TXT_DB_write(out, db->db);
|
||||||
@@ -1475,7 +1535,7 @@ int save_index(const char *dbfile, const char *suffix, CA_DB *db)
|
|||||||
out = BIO_new_file(buf[1], "w");
|
out = BIO_new_file(buf[1], "w");
|
||||||
if (out == NULL) {
|
if (out == NULL) {
|
||||||
perror(buf[2]);
|
perror(buf[2]);
|
||||||
BIO_printf(bio_err, "unable to open '%s'\n", buf[2]);
|
BIO_printf(bio_err, "Unable to open '%s'\n", buf[2]);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
BIO_printf(out, "unique_subject = %s\n",
|
BIO_printf(out, "unique_subject = %s\n",
|
||||||
@@ -1484,6 +1544,7 @@ int save_index(const char *dbfile, const char *suffix, CA_DB *db)
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
err:
|
err:
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1498,7 +1559,7 @@ int rotate_index(const char *dbfile, const char *new_suffix,
|
|||||||
if (i > j)
|
if (i > j)
|
||||||
j = i;
|
j = i;
|
||||||
if (j + 6 >= BSIZE) {
|
if (j + 6 >= BSIZE) {
|
||||||
BIO_printf(bio_err, "file name too long\n");
|
BIO_printf(bio_err, "File name too long\n");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
#ifndef OPENSSL_SYS_VMS
|
#ifndef OPENSSL_SYS_VMS
|
||||||
@@ -1519,12 +1580,12 @@ int rotate_index(const char *dbfile, const char *new_suffix,
|
|||||||
&& errno != ENOTDIR
|
&& errno != ENOTDIR
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
BIO_printf(bio_err, "unable to rename %s to %s\n", dbfile, buf[1]);
|
BIO_printf(bio_err, "Unable to rename %s to %s\n", dbfile, buf[1]);
|
||||||
perror("reason");
|
perror("reason");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if (rename(buf[0], dbfile) < 0) {
|
if (rename(buf[0], dbfile) < 0) {
|
||||||
BIO_printf(bio_err, "unable to rename %s to %s\n", buf[0], dbfile);
|
BIO_printf(bio_err, "Unable to rename %s to %s\n", buf[0], dbfile);
|
||||||
perror("reason");
|
perror("reason");
|
||||||
rename(buf[1], dbfile);
|
rename(buf[1], dbfile);
|
||||||
goto err;
|
goto err;
|
||||||
@@ -1534,14 +1595,14 @@ int rotate_index(const char *dbfile, const char *new_suffix,
|
|||||||
&& errno != ENOTDIR
|
&& errno != ENOTDIR
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
BIO_printf(bio_err, "unable to rename %s to %s\n", buf[4], buf[3]);
|
BIO_printf(bio_err, "Unable to rename %s to %s\n", buf[4], buf[3]);
|
||||||
perror("reason");
|
perror("reason");
|
||||||
rename(dbfile, buf[0]);
|
rename(dbfile, buf[0]);
|
||||||
rename(buf[1], dbfile);
|
rename(buf[1], dbfile);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if (rename(buf[2], buf[4]) < 0) {
|
if (rename(buf[2], buf[4]) < 0) {
|
||||||
BIO_printf(bio_err, "unable to rename %s to %s\n", buf[2], buf[4]);
|
BIO_printf(bio_err, "Unable to rename %s to %s\n", buf[2], buf[4]);
|
||||||
perror("reason");
|
perror("reason");
|
||||||
rename(buf[3], buf[4]);
|
rename(buf[3], buf[4]);
|
||||||
rename(dbfile, buf[0]);
|
rename(dbfile, buf[0]);
|
||||||
@@ -1550,6 +1611,7 @@ int rotate_index(const char *dbfile, const char *new_suffix,
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
err:
|
err:
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1640,7 +1702,7 @@ X509_NAME *parse_name(const char *cp, long chtype, int canmulti)
|
|||||||
}
|
}
|
||||||
if (*cp == '\\' && *++cp == '\0') {
|
if (*cp == '\\' && *++cp == '\0') {
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
"%s: escape character at end of string\n",
|
"%s: Escape character at end of string\n",
|
||||||
opt_getprog());
|
opt_getprog());
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
@@ -1889,15 +1951,14 @@ static X509_CRL *load_crl_crldp(STACK_OF(DIST_POINT) *crldp)
|
|||||||
DIST_POINT *dp = sk_DIST_POINT_value(crldp, i);
|
DIST_POINT *dp = sk_DIST_POINT_value(crldp, i);
|
||||||
urlptr = get_dp_url(dp);
|
urlptr = get_dp_url(dp);
|
||||||
if (urlptr)
|
if (urlptr)
|
||||||
return load_crl(urlptr, FORMAT_HTTP);
|
return load_crl(urlptr, FORMAT_HTTP, "CRL via CDP");
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Example of downloading CRLs from CRLDP: not usable for real world as it
|
* Example of downloading CRLs from CRLDP:
|
||||||
* always downloads, doesn't support non-blocking I/O and doesn't cache
|
* not usable for real world as it always downloads and doesn't cache anything.
|
||||||
* anything.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static STACK_OF(X509_CRL) *crls_http_cb(const X509_STORE_CTX *ctx,
|
static STACK_OF(X509_CRL) *crls_http_cb(const X509_STORE_CTX *ctx,
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
#include <openssl/safestack.h>
|
#include <openssl/safestack.h>
|
||||||
#include "names.h"
|
#include "names.h"
|
||||||
|
|
||||||
|
DEFINE_STACK_OF_CSTRING()
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# define strcasecmp _stricmp
|
# define strcasecmp _stricmp
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+36
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -282,6 +282,41 @@ int opt_format(const char *s, unsigned long flags, int *result)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return string representing the given format. */
|
||||||
|
const char *format2str(int format)
|
||||||
|
{
|
||||||
|
switch (format) {
|
||||||
|
default:
|
||||||
|
return "(undefined)";
|
||||||
|
case FORMAT_PEM:
|
||||||
|
return "PEM";
|
||||||
|
case FORMAT_ASN1:
|
||||||
|
return "DER";
|
||||||
|
case FORMAT_TEXT:
|
||||||
|
return "TEXT";
|
||||||
|
case FORMAT_NSS:
|
||||||
|
return "NSS";
|
||||||
|
case FORMAT_SMIME:
|
||||||
|
return "SMIME";
|
||||||
|
case FORMAT_MSBLOB:
|
||||||
|
return "MSBLOB";
|
||||||
|
case FORMAT_ENGINE:
|
||||||
|
return "ENGINE";
|
||||||
|
case FORMAT_HTTP:
|
||||||
|
return "HTTP";
|
||||||
|
case FORMAT_PKCS12:
|
||||||
|
return "P12";
|
||||||
|
case FORMAT_PVK:
|
||||||
|
return "PVK";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Print an error message about unsuitable/unsupported format requested. */
|
||||||
|
void print_format_error(int format, unsigned long flags)
|
||||||
|
{
|
||||||
|
(void)opt_format_error(format2str(format), flags);
|
||||||
|
}
|
||||||
|
|
||||||
/* Parse a cipher name, put it in *EVP_CIPHER; return 0 on failure, else 1. */
|
/* Parse a cipher name, put it in *EVP_CIPHER; return 0 on failure, else 1. */
|
||||||
int opt_cipher(const char *name, const EVP_CIPHER **cipherp)
|
int opt_cipher(const char *name, const EVP_CIPHER **cipherp)
|
||||||
{
|
{
|
||||||
|
|||||||
+7
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -26,6 +26,11 @@
|
|||||||
|
|
||||||
#define COOKIE_SECRET_LENGTH 16
|
#define COOKIE_SECRET_LENGTH 16
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(X509)
|
||||||
|
DEFINE_STACK_OF(X509_CRL)
|
||||||
|
DEFINE_STACK_OF(X509_NAME)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
VERIFY_CB_ARGS verify_args = { -1, 0, X509_V_OK, 0 };
|
VERIFY_CB_ARGS verify_args = { -1, 0, X509_V_OK, 0 };
|
||||||
|
|
||||||
#ifndef OPENSSL_NO_SOCK
|
#ifndef OPENSSL_NO_SOCK
|
||||||
@@ -190,7 +195,7 @@ static STRINT_PAIR cert_type_list[] = {
|
|||||||
{"RSA fixed ECDH", TLS_CT_RSA_FIXED_ECDH},
|
{"RSA fixed ECDH", TLS_CT_RSA_FIXED_ECDH},
|
||||||
{"ECDSA fixed ECDH", TLS_CT_ECDSA_FIXED_ECDH},
|
{"ECDSA fixed ECDH", TLS_CT_ECDSA_FIXED_ECDH},
|
||||||
{"GOST01 Sign", TLS_CT_GOST01_SIGN},
|
{"GOST01 Sign", TLS_CT_GOST01_SIGN},
|
||||||
{"GOST12 Sign", TLS_CT_GOST12_SIGN},
|
{"GOST12 Sign", TLS_CT_GOST12_IANA_SIGN},
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -19,6 +19,8 @@
|
|||||||
#include "opt.h"
|
#include "opt.h"
|
||||||
#include "names.h"
|
#include "names.h"
|
||||||
|
|
||||||
|
DEFINE_STACK_OF_CSTRING()
|
||||||
|
|
||||||
static int verbose = 0;
|
static int verbose = 0;
|
||||||
|
|
||||||
static void legacy_cipher_fn(const EVP_CIPHER *c,
|
static void legacy_cipher_fn(const EVP_CIPHER *c,
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -16,6 +16,8 @@
|
|||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/params.h>
|
#include <openssl/params.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
#undef BUFSIZE
|
#undef BUFSIZE
|
||||||
#define BUFSIZE 1024*8
|
#define BUFSIZE 1024*8
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -14,6 +14,8 @@
|
|||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
#include <openssl/err.h>
|
#include <openssl/err.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(X509)
|
||||||
|
|
||||||
typedef enum OPTION_choice {
|
typedef enum OPTION_choice {
|
||||||
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
||||||
OPT_TOSEQ, OPT_IN, OPT_OUT,
|
OPT_TOSEQ, OPT_IN, OPT_OUT,
|
||||||
|
|||||||
+6
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -33,6 +33,11 @@
|
|||||||
#include <openssl/x509v3.h>
|
#include <openssl/x509v3.h>
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(OCSP_CERTID)
|
||||||
|
DEFINE_STACK_OF(CONF_VALUE)
|
||||||
|
DEFINE_STACK_OF(X509)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
#ifndef HAVE_FORK
|
#ifndef HAVE_FORK
|
||||||
# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS)
|
# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS)
|
||||||
# define HAVE_FORK 0
|
# define HAVE_FORK 0
|
||||||
|
|||||||
+11
-8
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -47,12 +47,15 @@ BIO *bio_in = NULL;
|
|||||||
BIO *bio_out = NULL;
|
BIO *bio_out = NULL;
|
||||||
BIO *bio_err = NULL;
|
BIO *bio_err = NULL;
|
||||||
|
|
||||||
static void warn_deprecated(const char *pname,
|
static void warn_deprecated(const FUNCTION *fp)
|
||||||
const char *deprecated_alternative)
|
|
||||||
{
|
{
|
||||||
BIO_printf(bio_err, "The command %s is deprecated.", pname);
|
if (fp->deprecated_version != NULL)
|
||||||
if (strcmp(deprecated_alternative, DEPRECATED_NO_ALTERNATIVE) != 0)
|
BIO_printf(bio_err, "The command %s was deprecated in version %s.",
|
||||||
BIO_printf(bio_err, " Use '%s' instead.", deprecated_alternative);
|
fp->name, fp->deprecated_version);
|
||||||
|
else
|
||||||
|
BIO_printf(bio_err, "The command %s is deprecated.", fp->name);
|
||||||
|
if (strcmp(fp->deprecated_alternative, DEPRECATED_NO_ALTERNATIVE) != 0)
|
||||||
|
BIO_printf(bio_err, " Use '%s' instead.", fp->deprecated_alternative);
|
||||||
BIO_printf(bio_err, "\n");
|
BIO_printf(bio_err, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,7 +290,7 @@ int main(int argc, char *argv[])
|
|||||||
if (fp != NULL) {
|
if (fp != NULL) {
|
||||||
argv[0] = pname;
|
argv[0] = pname;
|
||||||
if (fp->deprecated_alternative != NULL)
|
if (fp->deprecated_alternative != NULL)
|
||||||
warn_deprecated(pname, fp->deprecated_alternative);
|
warn_deprecated(fp);
|
||||||
ret = fp->func(argc, argv);
|
ret = fp->func(argc, argv);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@@ -483,7 +486,7 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if (fp != NULL) {
|
if (fp != NULL) {
|
||||||
if (fp->deprecated_alternative != NULL)
|
if (fp->deprecated_alternative != NULL)
|
||||||
warn_deprecated(fp->name, fp->deprecated_alternative);
|
warn_deprecated(fp);
|
||||||
return fp->func(argc, argv);
|
return fp->func(argc, argv);
|
||||||
}
|
}
|
||||||
if ((strncmp(argv[0], "no-", 3)) == 0) {
|
if ((strncmp(argv[0], "no-", 3)) == 0) {
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
+7
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -19,6 +19,12 @@
|
|||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
#include <openssl/pkcs12.h>
|
#include <openssl/pkcs12.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(X509)
|
||||||
|
DEFINE_STACK_OF(PKCS7)
|
||||||
|
DEFINE_STACK_OF(PKCS12_SAFEBAG)
|
||||||
|
DEFINE_STACK_OF(X509_ATTRIBUTE)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
#define NOKEYS 0x1
|
#define NOKEYS 0x1
|
||||||
#define NOCERTS 0x2
|
#define NOCERTS 0x2
|
||||||
#define INFO 0x4
|
#define INFO 0x4
|
||||||
|
|||||||
+4
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -20,6 +20,9 @@
|
|||||||
#include <openssl/pkcs7.h>
|
#include <openssl/pkcs7.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(X509)
|
||||||
|
DEFINE_STACK_OF(X509_CRL)
|
||||||
|
|
||||||
typedef enum OPTION_choice {
|
typedef enum OPTION_choice {
|
||||||
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
||||||
OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_NOOUT,
|
OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_NOOUT,
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -15,6 +15,8 @@
|
|||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
#define KEY_NONE 0
|
#define KEY_NONE 0
|
||||||
#define KEY_PRIVKEY 1
|
#define KEY_PRIVKEY 1
|
||||||
#define KEY_PUBKEY 2
|
#define KEY_PUBKEY 2
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2004-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
+30
-17
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -92,35 +92,48 @@ EOF
|
|||||||
|
|
||||||
my %cmd_disabler = (
|
my %cmd_disabler = (
|
||||||
ciphers => "sock",
|
ciphers => "sock",
|
||||||
|
genrsa => "rsa",
|
||||||
|
gendsa => "dsa",
|
||||||
|
dsaparam => "dsa",
|
||||||
|
gendh => "dh",
|
||||||
|
dhparam => "dh",
|
||||||
|
ecparam => "ec",
|
||||||
pkcs12 => "des",
|
pkcs12 => "des",
|
||||||
);
|
);
|
||||||
my %cmd_deprecated = (
|
my %cmd_deprecated = (
|
||||||
rsa => [ "3_0", "pkey", "rsa" ],
|
# The format of this table is:
|
||||||
genrsa => [ "3_0", "genpkey", "rsa" ],
|
# [0] = alternative command to use instead
|
||||||
rsautl => [ "3_0", "pkeyutl", "rsa" ],
|
# [1] = deprecented in this version
|
||||||
dhparam => [ "3_0", "pkeyparam", "dh" ],
|
# [2] = preprocessor conditional for exclusing irrespective of deprecation
|
||||||
dsaparam => [ "3_0", "pkeyparam", "dsa" ],
|
# rsa => [ "pkey", "3_0", "rsa" ],
|
||||||
dsa => [ "3_0", "pkey", "dsa" ],
|
# genrsa => [ "genpkey", "3_0", "rsa" ],
|
||||||
gendsa => [ "3_0", "genpkey", "dsa" ],
|
rsautl => [ "pkeyutl", "3_0", "rsa" ],
|
||||||
ec => [ "3_0", "pkey", "ec" ],
|
# dhparam => [ "pkeyparam", "3_0", "dh" ],
|
||||||
ecparam => [ "3_0", "pkeyparam", "ec" ],
|
# dsaparam => [ "pkeyparam", "3_0", "dsa" ],
|
||||||
|
# dsa => [ "pkey", "3_0", "dsa" ],
|
||||||
|
# gendsa => [ "genpkey", "3_0", "dsa" ],
|
||||||
|
# ec => [ "pkey", "3_0", "ec" ],
|
||||||
|
# ecparam => [ "pkeyparam", "3_0", "ec" ],
|
||||||
);
|
);
|
||||||
|
|
||||||
print "FUNCTION functions[] = {\n";
|
print "FUNCTION functions[] = {\n";
|
||||||
foreach my $cmd ( @ARGV ) {
|
foreach my $cmd ( @ARGV ) {
|
||||||
my $str =
|
my $str =
|
||||||
" {FT_general, \"$cmd\", ${cmd}_main, ${cmd}_options, NULL},\n";
|
" {FT_general, \"$cmd\", ${cmd}_main, ${cmd}_options, NULL, NULL},\n";
|
||||||
if ($cmd =~ /^s_/) {
|
if ($cmd =~ /^s_/) {
|
||||||
print "#ifndef OPENSSL_NO_SOCK\n${str}#endif\n";
|
print "#ifndef OPENSSL_NO_SOCK\n${str}#endif\n";
|
||||||
} elsif (my $deprecated = $cmd_deprecated{$cmd}) {
|
} elsif (my $deprecated = $cmd_deprecated{$cmd}) {
|
||||||
my @dep = @{$deprecated};
|
my @dep = @{$deprecated};
|
||||||
print "#if ";
|
my $daltprg = $dep[0];
|
||||||
if ($dep[2]) {
|
my $dver = $dep[1];
|
||||||
print "!defined(OPENSSL_NO_" . uc($dep[2]) . ") && ";
|
my $dsys = $dep[2];
|
||||||
|
print "#if !defined(OPENSSL_NO_DEPRECATED_" . $dver . ")";
|
||||||
|
if ($dsys) {
|
||||||
|
print " && !defined(OPENSSL_NO_" . uc($dsys) . ")";
|
||||||
}
|
}
|
||||||
print "!defined(OPENSSL_NO_DEPRECATED_" . $dep[0] . ")";
|
$dver =~ s/_/./g;
|
||||||
my $dalt = "\"" . $dep[1] . "\"";
|
my $dalt = "\"" . $daltprg . "\", \"" . $dver . "\"";
|
||||||
$str =~ s/NULL/$dalt/;
|
$str =~ s/NULL, NULL/$dalt/;
|
||||||
print "\n${str}#endif\n";
|
print "\n${str}#endif\n";
|
||||||
} elsif (grep { $cmd eq $_ } @disablables) {
|
} elsif (grep { $cmd eq $_ } @disablables) {
|
||||||
print "#ifndef OPENSSL_NO_" . uc($cmd) . "\n${str}#endif\n";
|
print "#ifndef OPENSSL_NO_" . uc($cmd) . "\n${str}#endif\n";
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
#include <openssl/core.h>
|
#include <openssl/core.h>
|
||||||
#include <openssl/core_numbers.h>
|
#include <openssl/core_numbers.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF_CSTRING()
|
||||||
|
|
||||||
typedef enum OPTION_choice {
|
typedef enum OPTION_choice {
|
||||||
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
|
||||||
OPT_V = 100, OPT_VV, OPT_VVV
|
OPT_V = 100, OPT_VV, OPT_VVV
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1998-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -42,6 +42,8 @@
|
|||||||
# include <openssl/pem.h>
|
# include <openssl/pem.h>
|
||||||
# include <openssl/x509.h>
|
# include <openssl/x509.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(X509_INFO)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
# ifndef PATH_MAX
|
# ifndef PATH_MAX
|
||||||
# define PATH_MAX 4096
|
# define PATH_MAX 4096
|
||||||
|
|||||||
+9
-20
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -32,6 +32,8 @@
|
|||||||
# include <openssl/dsa.h>
|
# include <openssl/dsa.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(CONF_VALUE)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
#define BITS "default_bits"
|
#define BITS "default_bits"
|
||||||
#define KEYFILE "default_keyfile"
|
#define KEYFILE "default_keyfile"
|
||||||
@@ -113,7 +115,7 @@ const OPTIONS req_options[] = {
|
|||||||
{"config", OPT_CONFIG, '<', "Request template file"},
|
{"config", OPT_CONFIG, '<', "Request template file"},
|
||||||
{"section", OPT_SECTION, 's', "Config section to use (default \"req\")"},
|
{"section", OPT_SECTION, 's', "Config section to use (default \"req\")"},
|
||||||
{"utf8", OPT_UTF8, '-', "Input characters are UTF8 (default ASCII)"},
|
{"utf8", OPT_UTF8, '-', "Input characters are UTF8 (default ASCII)"},
|
||||||
{"nameopt", OPT_NAMEOPT, 's', "Various certificate name options"},
|
{"nameopt", OPT_NAMEOPT, 's', "Certificate subject/issuer name printing options"},
|
||||||
{"reqopt", OPT_REQOPT, 's', "Various request text options"},
|
{"reqopt", OPT_REQOPT, 's', "Various request text options"},
|
||||||
{"text", OPT_TEXT, '-', "Text form of request"},
|
{"text", OPT_TEXT, '-', "Text form of request"},
|
||||||
{"x509", OPT_X509, '-',
|
{"x509", OPT_X509, '-',
|
||||||
@@ -228,7 +230,7 @@ static int duplicated(LHASH_OF(OPENSSL_STRING) *addexts, char *kv)
|
|||||||
int req_main(int argc, char **argv)
|
int req_main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
ASN1_INTEGER *serial = NULL;
|
ASN1_INTEGER *serial = NULL;
|
||||||
BIO *in = NULL, *out = NULL;
|
BIO *out = NULL;
|
||||||
ENGINE *e = NULL, *gen_eng = NULL;
|
ENGINE *e = NULL, *gen_eng = NULL;
|
||||||
EVP_PKEY *pkey = NULL;
|
EVP_PKEY *pkey = NULL;
|
||||||
EVP_PKEY_CTX *genctx = NULL;
|
EVP_PKEY_CTX *genctx = NULL;
|
||||||
@@ -467,7 +469,7 @@ int req_main(int argc, char **argv)
|
|||||||
BIO_printf(bio_err, "Using configuration from %s\n", template);
|
BIO_printf(bio_err, "Using configuration from %s\n", template);
|
||||||
if ((req_conf = app_load_config(template)) == NULL)
|
if ((req_conf = app_load_config(template)) == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
if (addext_bio) {
|
if (addext_bio != NULL) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
"Using additional configuration from command line\n");
|
"Using additional configuration from command line\n");
|
||||||
@@ -588,13 +590,10 @@ int req_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (keyfile != NULL) {
|
if (keyfile != NULL) {
|
||||||
pkey = load_key(keyfile, keyform, 0, passin, e, "Private Key");
|
pkey = load_key(keyfile, keyform, 0, passin, e, "Private Key");
|
||||||
if (pkey == NULL) {
|
if (pkey == NULL)
|
||||||
/* load_key() has already printed an appropriate message */
|
|
||||||
goto end;
|
goto end;
|
||||||
} else {
|
|
||||||
app_RAND_load_conf(req_conf, section);
|
app_RAND_load_conf(req_conf, section);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (newreq && (pkey == NULL)) {
|
if (newreq && (pkey == NULL)) {
|
||||||
app_RAND_load_conf(req_conf, section);
|
app_RAND_load_conf(req_conf, section);
|
||||||
@@ -713,18 +712,9 @@ int req_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!newreq) {
|
if (!newreq) {
|
||||||
in = bio_open_default(infile, 'r', informat);
|
req = load_csr(infile, informat, "X509 request");
|
||||||
if (in == NULL)
|
if (req == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
if (informat == FORMAT_ASN1)
|
|
||||||
req = d2i_X509_REQ_bio(in, NULL);
|
|
||||||
else
|
|
||||||
req = PEM_read_bio_X509_REQ(in, NULL, NULL, NULL);
|
|
||||||
if (req == NULL) {
|
|
||||||
BIO_printf(bio_err, "unable to load X509 request\n");
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newreq || x509) {
|
if (newreq || x509) {
|
||||||
@@ -990,7 +980,6 @@ int req_main(int argc, char **argv)
|
|||||||
NCONF_free(req_conf);
|
NCONF_free(req_conf);
|
||||||
NCONF_free(addext_conf);
|
NCONF_free(addext_conf);
|
||||||
BIO_free(addext_bio);
|
BIO_free(addext_bio);
|
||||||
BIO_free(in);
|
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
EVP_PKEY_CTX_free(genctx);
|
EVP_PKEY_CTX_free(genctx);
|
||||||
|
|||||||
+17
-8
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -76,6 +76,8 @@ int rsa_main(int argc, char **argv)
|
|||||||
ENGINE *e = NULL;
|
ENGINE *e = NULL;
|
||||||
BIO *out = NULL;
|
BIO *out = NULL;
|
||||||
RSA *rsa = NULL;
|
RSA *rsa = NULL;
|
||||||
|
EVP_PKEY *pkey = NULL;
|
||||||
|
EVP_PKEY_CTX *pctx;
|
||||||
const EVP_CIPHER *enc = NULL;
|
const EVP_CIPHER *enc = NULL;
|
||||||
char *infile = NULL, *outfile = NULL, *prog;
|
char *infile = NULL, *outfile = NULL, *prog;
|
||||||
char *passin = NULL, *passout = NULL, *passinarg = NULL, *passoutarg = NULL;
|
char *passin = NULL, *passout = NULL, *passinarg = NULL, *passoutarg = NULL;
|
||||||
@@ -178,11 +180,9 @@ int rsa_main(int argc, char **argv)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
EVP_PKEY *pkey;
|
|
||||||
|
|
||||||
if (pubin) {
|
if (pubin) {
|
||||||
int tmpformat = -1;
|
int tmpformat = -1;
|
||||||
|
|
||||||
if (pubin == 2) {
|
if (pubin == 2) {
|
||||||
if (informat == FORMAT_PEM)
|
if (informat == FORMAT_PEM)
|
||||||
tmpformat = FORMAT_PEMRSA;
|
tmpformat = FORMAT_PEMRSA;
|
||||||
@@ -199,8 +199,6 @@ int rsa_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (pkey != NULL)
|
if (pkey != NULL)
|
||||||
rsa = EVP_PKEY_get1_RSA(pkey);
|
rsa = EVP_PKEY_get1_RSA(pkey);
|
||||||
EVP_PKEY_free(pkey);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rsa == NULL) {
|
if (rsa == NULL) {
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
@@ -213,7 +211,8 @@ int rsa_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (text) {
|
if (text) {
|
||||||
assert(pubin || private);
|
assert(pubin || private);
|
||||||
if (!RSA_print(out, rsa, 0)) {
|
if ((pubin && EVP_PKEY_print_public(out, pkey, 0, NULL) <= 0)
|
||||||
|
|| (!pubin && EVP_PKEY_print_private(out, pkey, 0, NULL) <= 0)) {
|
||||||
perror(outfile);
|
perror(outfile);
|
||||||
ERR_print_errors(bio_err);
|
ERR_print_errors(bio_err);
|
||||||
goto end;
|
goto end;
|
||||||
@@ -229,7 +228,16 @@ int rsa_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (check) {
|
if (check) {
|
||||||
int r = RSA_check_key_ex(rsa, NULL);
|
int r;
|
||||||
|
|
||||||
|
pctx = EVP_PKEY_CTX_new_from_pkey(NULL, pkey, NULL);
|
||||||
|
if (pctx == NULL) {
|
||||||
|
BIO_printf(out, "RSA unable to create PKEY context\n");
|
||||||
|
ERR_print_errors(bio_err);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
r = EVP_PKEY_check(pctx);
|
||||||
|
EVP_PKEY_CTX_free(pctx);
|
||||||
|
|
||||||
if (r == 1) {
|
if (r == 1) {
|
||||||
BIO_printf(out, "RSA key ok\n");
|
BIO_printf(out, "RSA key ok\n");
|
||||||
@@ -318,6 +326,7 @@ int rsa_main(int argc, char **argv)
|
|||||||
end:
|
end:
|
||||||
release_engine(e);
|
release_engine(e);
|
||||||
BIO_free_all(out);
|
BIO_free_all(out);
|
||||||
|
EVP_PKEY_free(pkey);
|
||||||
RSA_free(rsa);
|
RSA_free(rsa);
|
||||||
OPENSSL_free(passin);
|
OPENSSL_free(passin);
|
||||||
OPENSSL_free(passout);
|
OPENSSL_free(passout);
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
+21
-22
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
* Copyright 2005 Nokia. All rights reserved.
|
* Copyright 2005 Nokia. All rights reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
@@ -56,6 +56,12 @@ typedef unsigned int u_int;
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(X509)
|
||||||
|
DEFINE_STACK_OF(X509_CRL)
|
||||||
|
DEFINE_STACK_OF(X509_NAME)
|
||||||
|
DEFINE_STACK_OF(SCT)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
#undef BUFSIZZ
|
#undef BUFSIZZ
|
||||||
#define BUFSIZZ 1024*8
|
#define BUFSIZZ 1024*8
|
||||||
#define S_CLIENT_IRC_READ_TIMEOUT 8
|
#define S_CLIENT_IRC_READ_TIMEOUT 8
|
||||||
@@ -649,14 +655,17 @@ const OPTIONS s_client_options[] = {
|
|||||||
{"fallback_scsv", OPT_FALLBACKSCSV, '-', "Send the fallback SCSV"},
|
{"fallback_scsv", OPT_FALLBACKSCSV, '-', "Send the fallback SCSV"},
|
||||||
|
|
||||||
OPT_SECTION("Identity"),
|
OPT_SECTION("Identity"),
|
||||||
{"verify", OPT_VERIFY, 'p', "Turn on peer certificate verification"},
|
{"cert", OPT_CERT, '<', "Client certificate file to use"},
|
||||||
{"cert", OPT_CERT, '<', "Certificate file to use, PEM format assumed"},
|
|
||||||
{"certform", OPT_CERTFORM, 'F',
|
{"certform", OPT_CERTFORM, 'F',
|
||||||
"Certificate format (PEM or DER) PEM default"},
|
"Client certificate file format (PEM or DER) PEM default"},
|
||||||
{"nameopt", OPT_NAMEOPT, 's', "Various certificate name options"},
|
{"cert_chain", OPT_CERT_CHAIN, '<',
|
||||||
{"key", OPT_KEY, 's', "Private key file to use, if not in -cert file"},
|
"Client certificate chain file (in PEM format)"},
|
||||||
|
{"build_chain", OPT_BUILD_CHAIN, '-', "Build client certificate chain"},
|
||||||
|
{"key", OPT_KEY, 's', "Private key file to use; default is: -cert file"},
|
||||||
{"keyform", OPT_KEYFORM, 'E', "Key format (PEM, DER or engine) PEM default"},
|
{"keyform", OPT_KEYFORM, 'E', "Key format (PEM, DER or engine) PEM default"},
|
||||||
{"pass", OPT_PASS, 's', "Private key file pass phrase source"},
|
{"pass", OPT_PASS, 's', "Private key file pass phrase source"},
|
||||||
|
{"verify", OPT_VERIFY, 'p', "Turn on peer certificate verification"},
|
||||||
|
{"nameopt", OPT_NAMEOPT, 's', "Certificate subject/issuer name printing options"},
|
||||||
{"CApath", OPT_CAPATH, '/', "PEM format directory of CA's"},
|
{"CApath", OPT_CAPATH, '/', "PEM format directory of CA's"},
|
||||||
{"CAfile", OPT_CAFILE, '<', "PEM format file of CA's"},
|
{"CAfile", OPT_CAFILE, '<', "PEM format file of CA's"},
|
||||||
{"CAstore", OPT_CASTORE, ':', "URI to store of CA's"},
|
{"CAstore", OPT_CASTORE, ':', "URI to store of CA's"},
|
||||||
@@ -801,8 +810,8 @@ const OPTIONS s_client_options[] = {
|
|||||||
{"verify_return_error", OPT_VERIFY_RET_ERROR, '-',
|
{"verify_return_error", OPT_VERIFY_RET_ERROR, '-',
|
||||||
"Close connection on verification error"},
|
"Close connection on verification error"},
|
||||||
{"verify_quiet", OPT_VERIFY_QUIET, '-', "Restrict verify output to errors"},
|
{"verify_quiet", OPT_VERIFY_QUIET, '-', "Restrict verify output to errors"},
|
||||||
{"cert_chain", OPT_CERT_CHAIN, '<',
|
{"chainCAfile", OPT_CHAINCAFILE, '<',
|
||||||
"Certificate chain file (in PEM format)"},
|
"CA file for certificate chain (PEM format)"},
|
||||||
{"chainCApath", OPT_CHAINCAPATH, '/',
|
{"chainCApath", OPT_CHAINCAPATH, '/',
|
||||||
"Use dir as certificate store path to build CA certificate chain"},
|
"Use dir as certificate store path to build CA certificate chain"},
|
||||||
{"chainCAstore", OPT_CHAINCASTORE, ':',
|
{"chainCAstore", OPT_CHAINCASTORE, ':',
|
||||||
@@ -813,9 +822,6 @@ const OPTIONS s_client_options[] = {
|
|||||||
"Use dir as certificate store path to verify CA certificate"},
|
"Use dir as certificate store path to verify CA certificate"},
|
||||||
{"verifyCAstore", OPT_VERIFYCASTORE, ':',
|
{"verifyCAstore", OPT_VERIFYCASTORE, ':',
|
||||||
"CA store URI for certificate verification"},
|
"CA store URI for certificate verification"},
|
||||||
{"build_chain", OPT_BUILD_CHAIN, '-', "Build certificate chain"},
|
|
||||||
{"chainCAfile", OPT_CHAINCAFILE, '<',
|
|
||||||
"CA file for certificate chain (PEM format)"},
|
|
||||||
OPT_X_OPTIONS,
|
OPT_X_OPTIONS,
|
||||||
OPT_PROV_OPTIONS,
|
OPT_PROV_OPTIONS,
|
||||||
|
|
||||||
@@ -1708,19 +1714,15 @@ int s_client_main(int argc, char **argv)
|
|||||||
if (key_file != NULL) {
|
if (key_file != NULL) {
|
||||||
key = load_key(key_file, key_format, 0, pass, e,
|
key = load_key(key_file, key_format, 0, pass, e,
|
||||||
"client certificate private key file");
|
"client certificate private key file");
|
||||||
if (key == NULL) {
|
if (key == NULL)
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (cert_file != NULL) {
|
if (cert_file != NULL) {
|
||||||
cert = load_cert(cert_file, cert_format, "client certificate file");
|
cert = load_cert(cert_file, cert_format, "client certificate file");
|
||||||
if (cert == NULL) {
|
if (cert == NULL)
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (chain_file != NULL) {
|
if (chain_file != NULL) {
|
||||||
if (!load_certs(chain_file, &chain, FORMAT_PEM, NULL,
|
if (!load_certs(chain_file, &chain, FORMAT_PEM, NULL,
|
||||||
@@ -1730,12 +1732,9 @@ int s_client_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (crl_file != NULL) {
|
if (crl_file != NULL) {
|
||||||
X509_CRL *crl;
|
X509_CRL *crl;
|
||||||
crl = load_crl(crl_file, crl_format);
|
crl = load_crl(crl_file, crl_format, "CRL");
|
||||||
if (crl == NULL) {
|
if (crl == NULL)
|
||||||
BIO_puts(bio_err, "Error loading CRL\n");
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
|
||||||
crls = sk_X509_CRL_new_null();
|
crls = sk_X509_CRL_new_null();
|
||||||
if (crls == NULL || !sk_X509_CRL_push(crls, crl)) {
|
if (crls == NULL || !sk_X509_CRL_push(crls, crl)) {
|
||||||
BIO_puts(bio_err, "Error adding CRL\n");
|
BIO_puts(bio_err, "Error adding CRL\n");
|
||||||
|
|||||||
+38
-45
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
||||||
* Copyright 2005 Nokia. All rights reserved.
|
* Copyright 2005 Nokia. All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -60,6 +60,12 @@ typedef unsigned int u_int;
|
|||||||
#endif
|
#endif
|
||||||
#include "internal/sockets.h"
|
#include "internal/sockets.h"
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(X509_EXTENSION)
|
||||||
|
DEFINE_STACK_OF(X509_CRL)
|
||||||
|
DEFINE_STACK_OF(X509)
|
||||||
|
DEFINE_STACK_OF(SSL_CIPHER)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
static int not_resumable_sess_cb(SSL *s, int is_forward_secure);
|
static int not_resumable_sess_cb(SSL *s, int is_forward_secure);
|
||||||
static int sv_body(int s, int stype, int prot, unsigned char *context);
|
static int sv_body(int s, int stype, int prot, unsigned char *context);
|
||||||
static int www_body(int s, int stype, int prot, unsigned char *context);
|
static int www_body(int s, int stype, int prot, unsigned char *context);
|
||||||
@@ -802,31 +808,36 @@ const OPTIONS s_server_options[] = {
|
|||||||
{"verify", OPT_VERIFY, 'n', "Turn on peer certificate verification"},
|
{"verify", OPT_VERIFY, 'n', "Turn on peer certificate verification"},
|
||||||
{"Verify", OPT_UPPER_V_VERIFY, 'n',
|
{"Verify", OPT_UPPER_V_VERIFY, 'n',
|
||||||
"Turn on peer certificate verification, must have a cert"},
|
"Turn on peer certificate verification, must have a cert"},
|
||||||
{"cert", OPT_CERT, '<', "Certificate file to use; default is " TEST_CERT},
|
{"nameopt", OPT_NAMEOPT, 's', "Certificate subject/issuer name printing options"},
|
||||||
|
{"cert", OPT_CERT, '<', "Server certificate file to use; default is " TEST_CERT},
|
||||||
{"cert2", OPT_CERT2, '<',
|
{"cert2", OPT_CERT2, '<',
|
||||||
"Certificate file to use for servername; default is" TEST_CERT2},
|
"Certificate file to use for servername; default is" TEST_CERT2},
|
||||||
{"key2", OPT_KEY2, '<',
|
{"certform", OPT_CERTFORM, 'F',
|
||||||
"-Private Key file to use for servername if not in -cert2"},
|
"Server certificate file format (PEM or DER) PEM default"},
|
||||||
{"nameopt", OPT_NAMEOPT, 's', "Various certificate name options"},
|
{"cert_chain", OPT_CERT_CHAIN, '<',
|
||||||
|
"Server certificate chain file in PEM format"},
|
||||||
|
{"build_chain", OPT_BUILD_CHAIN, '-', "Build server certificate chain"},
|
||||||
{"serverinfo", OPT_SERVERINFO, 's',
|
{"serverinfo", OPT_SERVERINFO, 's',
|
||||||
"PEM serverinfo file for certificate"},
|
"PEM serverinfo file for certificate"},
|
||||||
{"certform", OPT_CERTFORM, 'F',
|
|
||||||
"Certificate format (PEM or DER) PEM default"},
|
|
||||||
{"key", OPT_KEY, 's',
|
{"key", OPT_KEY, 's',
|
||||||
"Private Key if not in -cert; default is " TEST_CERT},
|
"Private key file to use; default is -cert file or else" TEST_CERT},
|
||||||
|
{"key2", OPT_KEY2, '<',
|
||||||
|
"-Private Key file to use for servername if not in -cert2"},
|
||||||
{"keyform", OPT_KEYFORM, 'f',
|
{"keyform", OPT_KEYFORM, 'f',
|
||||||
"Key format (PEM, DER or ENGINE) PEM default"},
|
"Key format (PEM, DER or ENGINE) PEM default"},
|
||||||
{"pass", OPT_PASS, 's', "Private key file pass phrase source"},
|
{"pass", OPT_PASS, 's', "Private key file pass phrase source"},
|
||||||
{"dcert", OPT_DCERT, '<',
|
{"dcert", OPT_DCERT, '<',
|
||||||
"Second certificate file to use (usually for DSA)"},
|
"Second server certificate file to use (usually for DSA)"},
|
||||||
{"dhparam", OPT_DHPARAM, '<', "DH parameters file to use"},
|
|
||||||
{"dcertform", OPT_DCERTFORM, 'F',
|
{"dcertform", OPT_DCERTFORM, 'F',
|
||||||
"Second certificate format (PEM or DER) PEM default"},
|
"Second server certificate file format (PEM or DER) PEM default"},
|
||||||
|
{"dcert_chain", OPT_DCERT_CHAIN, '<',
|
||||||
|
"second server certificate chain file in PEM format"},
|
||||||
{"dkey", OPT_DKEY, '<',
|
{"dkey", OPT_DKEY, '<',
|
||||||
"Second private key file to use (usually for DSA)"},
|
"Second private key file to use (usually for DSA)"},
|
||||||
{"dkeyform", OPT_DKEYFORM, 'F',
|
{"dkeyform", OPT_DKEYFORM, 'F',
|
||||||
"Second key format (PEM, DER or ENGINE) PEM default"},
|
"Second key file format (PEM, DER or ENGINE) PEM default"},
|
||||||
{"dpass", OPT_DPASS, 's', "Second private key file pass phrase source"},
|
{"dpass", OPT_DPASS, 's', "Second private key file pass phrase source"},
|
||||||
|
{"dhparam", OPT_DHPARAM, '<', "DH parameters file to use"},
|
||||||
{"servername", OPT_SERVERNAME, 's',
|
{"servername", OPT_SERVERNAME, 's',
|
||||||
"Servername for HostName TLS extension"},
|
"Servername for HostName TLS extension"},
|
||||||
{"servername_fatal", OPT_SERVERNAME_FATAL, '-',
|
{"servername_fatal", OPT_SERVERNAME_FATAL, '-',
|
||||||
@@ -850,12 +861,17 @@ const OPTIONS s_server_options[] = {
|
|||||||
{"keymatexportlen", OPT_KEYMATEXPORTLEN, 'p',
|
{"keymatexportlen", OPT_KEYMATEXPORTLEN, 'p',
|
||||||
"Export len bytes of keying material (default 20)"},
|
"Export len bytes of keying material (default 20)"},
|
||||||
{"CRL", OPT_CRL, '<', "CRL file to use"},
|
{"CRL", OPT_CRL, '<', "CRL file to use"},
|
||||||
|
{"CRLform", OPT_CRLFORM, 'F', "CRL file format (PEM or DER); default PEM"},
|
||||||
{"crl_download", OPT_CRL_DOWNLOAD, '-',
|
{"crl_download", OPT_CRL_DOWNLOAD, '-',
|
||||||
"Download CRL from distribution points"},
|
"Download CRLs from distribution points in certificate CDP entries"},
|
||||||
|
{"chainCAfile", OPT_CHAINCAFILE, '<',
|
||||||
|
"CA file for certificate chain (PEM format)"},
|
||||||
{"chainCApath", OPT_CHAINCAPATH, '/',
|
{"chainCApath", OPT_CHAINCAPATH, '/',
|
||||||
"use dir as certificate store path to build CA certificate chain"},
|
"use dir as certificate store path to build CA certificate chain"},
|
||||||
{"chainCAstore", OPT_CHAINCASTORE, ':',
|
{"chainCAstore", OPT_CHAINCASTORE, ':',
|
||||||
"use URI as certificate store to build CA certificate chain"},
|
"use URI as certificate store to build CA certificate chain"},
|
||||||
|
{"verifyCAfile", OPT_VERIFYCAFILE, '<',
|
||||||
|
"CA file for certificate verification (PEM format)"},
|
||||||
{"verifyCApath", OPT_VERIFYCAPATH, '/',
|
{"verifyCApath", OPT_VERIFYCAPATH, '/',
|
||||||
"use dir as certificate store path to verify CA certificate"},
|
"use dir as certificate store path to verify CA certificate"},
|
||||||
{"verifyCAstore", OPT_VERIFYCASTORE, ':',
|
{"verifyCAstore", OPT_VERIFYCASTORE, ':',
|
||||||
@@ -863,13 +879,10 @@ const OPTIONS s_server_options[] = {
|
|||||||
{"no_cache", OPT_NO_CACHE, '-', "Disable session cache"},
|
{"no_cache", OPT_NO_CACHE, '-', "Disable session cache"},
|
||||||
{"ext_cache", OPT_EXT_CACHE, '-',
|
{"ext_cache", OPT_EXT_CACHE, '-',
|
||||||
"Disable internal cache, setup and use external cache"},
|
"Disable internal cache, setup and use external cache"},
|
||||||
{"CRLform", OPT_CRLFORM, 'F', "CRL format (PEM or DER) PEM is default"},
|
|
||||||
{"verify_return_error", OPT_VERIFY_RET_ERROR, '-',
|
{"verify_return_error", OPT_VERIFY_RET_ERROR, '-',
|
||||||
"Close connection on verification error"},
|
"Close connection on verification error"},
|
||||||
{"verify_quiet", OPT_VERIFY_QUIET, '-',
|
{"verify_quiet", OPT_VERIFY_QUIET, '-',
|
||||||
"No verify output except verify errors"},
|
"No verify output except verify errors"},
|
||||||
{"verifyCAfile", OPT_VERIFYCAFILE, '<',
|
|
||||||
"CA file for certificate verification (PEM format)"},
|
|
||||||
{"ign_eof", OPT_IGN_EOF, '-', "ignore input eof (default when -quiet)"},
|
{"ign_eof", OPT_IGN_EOF, '-', "ignore input eof (default when -quiet)"},
|
||||||
{"no_ign_eof", OPT_NO_IGN_EOF, '-', "Do not ignore input eof"},
|
{"no_ign_eof", OPT_NO_IGN_EOF, '-', "Do not ignore input eof"},
|
||||||
|
|
||||||
@@ -990,13 +1003,6 @@ const OPTIONS s_server_options[] = {
|
|||||||
OPT_R_OPTIONS,
|
OPT_R_OPTIONS,
|
||||||
OPT_S_OPTIONS,
|
OPT_S_OPTIONS,
|
||||||
OPT_V_OPTIONS,
|
OPT_V_OPTIONS,
|
||||||
{"cert_chain", OPT_CERT_CHAIN, '<',
|
|
||||||
"certificate chain file in PEM format"},
|
|
||||||
{"dcert_chain", OPT_DCERT_CHAIN, '<',
|
|
||||||
"second certificate chain file in PEM format"},
|
|
||||||
{"build_chain", OPT_BUILD_CHAIN, '-', "Build certificate chain"},
|
|
||||||
{"chainCAfile", OPT_CHAINCAFILE, '<',
|
|
||||||
"CA file for certificate chain (PEM format)"},
|
|
||||||
OPT_X_OPTIONS,
|
OPT_X_OPTIONS,
|
||||||
OPT_PROV_OPTIONS,
|
OPT_PROV_OPTIONS,
|
||||||
{NULL}
|
{NULL}
|
||||||
@@ -1244,7 +1250,7 @@ int s_server_main(int argc, char *argv[])
|
|||||||
s_key_file = opt_arg();
|
s_key_file = opt_arg();
|
||||||
break;
|
break;
|
||||||
case OPT_KEYFORM:
|
case OPT_KEYFORM:
|
||||||
if (!opt_format(opt_arg(), OPT_FMT_ANY, &s_key_format))
|
if (!opt_format(opt_arg(), OPT_FMT_PDE, &s_key_format))
|
||||||
goto opthelp;
|
goto opthelp;
|
||||||
break;
|
break;
|
||||||
case OPT_PASS:
|
case OPT_PASS:
|
||||||
@@ -1266,7 +1272,7 @@ int s_server_main(int argc, char *argv[])
|
|||||||
s_dcert_file = opt_arg();
|
s_dcert_file = opt_arg();
|
||||||
break;
|
break;
|
||||||
case OPT_DKEYFORM:
|
case OPT_DKEYFORM:
|
||||||
if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &s_dkey_format))
|
if (!opt_format(opt_arg(), OPT_FMT_PDE, &s_dkey_format))
|
||||||
goto opthelp;
|
goto opthelp;
|
||||||
break;
|
break;
|
||||||
case OPT_DPASS:
|
case OPT_DPASS:
|
||||||
@@ -1730,18 +1736,14 @@ int s_server_main(int argc, char *argv[])
|
|||||||
if (nocert == 0) {
|
if (nocert == 0) {
|
||||||
s_key = load_key(s_key_file, s_key_format, 0, pass, engine,
|
s_key = load_key(s_key_file, s_key_format, 0, pass, engine,
|
||||||
"server certificate private key file");
|
"server certificate private key file");
|
||||||
if (s_key == NULL) {
|
if (s_key == NULL)
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
|
||||||
|
|
||||||
s_cert = load_cert(s_cert_file, s_cert_format,
|
s_cert = load_cert(s_cert_file, s_cert_format,
|
||||||
"server certificate file");
|
"server certificate file");
|
||||||
|
|
||||||
if (s_cert == NULL) {
|
if (s_cert == NULL)
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
|
||||||
if (s_chain_file != NULL) {
|
if (s_chain_file != NULL) {
|
||||||
if (!load_certs(s_chain_file, &s_chain, FORMAT_PEM, NULL,
|
if (!load_certs(s_chain_file, &s_chain, FORMAT_PEM, NULL,
|
||||||
"server certificate chain"))
|
"server certificate chain"))
|
||||||
@@ -1751,20 +1753,16 @@ int s_server_main(int argc, char *argv[])
|
|||||||
if (tlsextcbp.servername != NULL) {
|
if (tlsextcbp.servername != NULL) {
|
||||||
s_key2 = load_key(s_key_file2, s_key_format, 0, pass, engine,
|
s_key2 = load_key(s_key_file2, s_key_format, 0, pass, engine,
|
||||||
"second server certificate private key file");
|
"second server certificate private key file");
|
||||||
if (s_key2 == NULL) {
|
if (s_key2 == NULL)
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
|
||||||
|
|
||||||
s_cert2 = load_cert(s_cert_file2, s_cert_format,
|
s_cert2 = load_cert(s_cert_file2, s_cert_format,
|
||||||
"second server certificate file");
|
"second server certificate file");
|
||||||
|
|
||||||
if (s_cert2 == NULL) {
|
if (s_cert2 == NULL)
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#if !defined(OPENSSL_NO_NEXTPROTONEG)
|
#if !defined(OPENSSL_NO_NEXTPROTONEG)
|
||||||
if (next_proto_neg_in) {
|
if (next_proto_neg_in) {
|
||||||
next_proto.data = next_protos_parse(&next_proto.len, next_proto_neg_in);
|
next_proto.data = next_protos_parse(&next_proto.len, next_proto_neg_in);
|
||||||
@@ -1781,12 +1779,9 @@ int s_server_main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (crl_file != NULL) {
|
if (crl_file != NULL) {
|
||||||
X509_CRL *crl;
|
X509_CRL *crl;
|
||||||
crl = load_crl(crl_file, crl_format);
|
crl = load_crl(crl_file, crl_format, "CRL");
|
||||||
if (crl == NULL) {
|
if (crl == NULL)
|
||||||
BIO_puts(bio_err, "Error loading CRL\n");
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
|
||||||
crls = sk_X509_CRL_new_null();
|
crls = sk_X509_CRL_new_null();
|
||||||
if (crls == NULL || !sk_X509_CRL_push(crls, crl)) {
|
if (crls == NULL || !sk_X509_CRL_push(crls, crl)) {
|
||||||
BIO_puts(bio_err, "Error adding CRL\n");
|
BIO_puts(bio_err, "Error adding CRL\n");
|
||||||
@@ -1803,10 +1798,8 @@ int s_server_main(int argc, char *argv[])
|
|||||||
|
|
||||||
s_dkey = load_key(s_dkey_file, s_dkey_format,
|
s_dkey = load_key(s_dkey_file, s_dkey_format,
|
||||||
0, dpass, engine, "second certificate private key file");
|
0, dpass, engine, "second certificate private key file");
|
||||||
if (s_dkey == NULL) {
|
if (s_dkey == NULL)
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
goto end;
|
||||||
}
|
|
||||||
|
|
||||||
s_dcert = load_cert(s_dcert_file, s_dcert_format,
|
s_dcert = load_cert(s_dcert_file, s_dcert_format,
|
||||||
"second server certificate file");
|
"second server certificate file");
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -86,7 +86,7 @@ const OPTIONS s_time_options[] = {
|
|||||||
{"www", OPT_WWW, 's', "Fetch specified page from the site"},
|
{"www", OPT_WWW, 's', "Fetch specified page from the site"},
|
||||||
|
|
||||||
OPT_SECTION("Certificate"),
|
OPT_SECTION("Certificate"),
|
||||||
{"nameopt", OPT_NAMEOPT, 's', "Various certificate name options"},
|
{"nameopt", OPT_NAMEOPT, 's', "Certificate subject/issuer name printing options"},
|
||||||
{"cert", OPT_CERT, '<', "Cert file to use, PEM format assumed"},
|
{"cert", OPT_CERT, '<', "Cert file to use, PEM format assumed"},
|
||||||
{"key", OPT_KEY, '<', "File with key, PEM; default is -cert file"},
|
{"key", OPT_KEY, '<', "File with key, PEM; default is -cert file"},
|
||||||
{"cafile", OPT_CAFILE, '<', "PEM format file of CA's"},
|
{"cafile", OPT_CAFILE, '<', "PEM format file of CA's"},
|
||||||
|
|||||||
+4
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -19,6 +19,9 @@
|
|||||||
#include <openssl/x509_vfy.h>
|
#include <openssl/x509_vfy.h>
|
||||||
#include <openssl/x509v3.h>
|
#include <openssl/x509v3.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(X509)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
static int save_certs(char *signerfile, STACK_OF(X509) *signers);
|
static int save_certs(char *signerfile, STACK_OF(X509) *signers);
|
||||||
static int smime_cb(int ok, X509_STORE_CTX *ctx);
|
static int smime_cb(int ok, X509_STORE_CTX *ctx);
|
||||||
|
|
||||||
|
|||||||
+5
-4
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
@@ -3465,7 +3465,7 @@ int speed_main(int argc, char **argv)
|
|||||||
d = Time_F(STOP);
|
d = Time_F(STOP);
|
||||||
|
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
mr ? "+R8:%ld:%u:%s:%.2f\n" :
|
mr ? "+R10:%ld:%u:%s:%.2f\n" :
|
||||||
"%ld %u bits %s signs in %.2fs \n",
|
"%ld %u bits %s signs in %.2fs \n",
|
||||||
count, sm2_curves[testnum].bits,
|
count, sm2_curves[testnum].bits,
|
||||||
sm2_curves[testnum].name, d);
|
sm2_curves[testnum].name, d);
|
||||||
@@ -3494,7 +3494,7 @@ int speed_main(int argc, char **argv)
|
|||||||
count = run_benchmark(async_jobs, SM2_verify_loop, loopargs);
|
count = run_benchmark(async_jobs, SM2_verify_loop, loopargs);
|
||||||
d = Time_F(STOP);
|
d = Time_F(STOP);
|
||||||
BIO_printf(bio_err,
|
BIO_printf(bio_err,
|
||||||
mr ? "+R9:%ld:%u:%s:%.2f\n"
|
mr ? "+R11:%ld:%u:%s:%.2f\n"
|
||||||
: "%ld %u bits %s verify in %.2fs\n",
|
: "%ld %u bits %s verify in %.2fs\n",
|
||||||
count, sm2_curves[testnum].bits,
|
count, sm2_curves[testnum].bits,
|
||||||
sm2_curves[testnum].name, d);
|
sm2_curves[testnum].name, d);
|
||||||
@@ -3676,7 +3676,7 @@ int speed_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mr)
|
if (mr)
|
||||||
printf("+F6:%u:%u:%s:%f:%f\n",
|
printf("+F7:%u:%u:%s:%f:%f\n",
|
||||||
k, sm2_curves[k].bits, sm2_curves[k].name,
|
k, sm2_curves[k].bits, sm2_curves[k].name,
|
||||||
sm2_results[k][0], sm2_results[k][1]);
|
sm2_results[k][0], sm2_results[k][1]);
|
||||||
else
|
else
|
||||||
@@ -3969,6 +3969,7 @@ static int do_multi(int multi, int size_num)
|
|||||||
p = buf + 4;
|
p = buf + 4;
|
||||||
k = atoi(sstrsep(&p, sep));
|
k = atoi(sstrsep(&p, sep));
|
||||||
sstrsep(&p, sep);
|
sstrsep(&p, sep);
|
||||||
|
sstrsep(&p, sep);
|
||||||
|
|
||||||
d = atof(sstrsep(&p, sep));
|
d = atof(sstrsep(&p, sep));
|
||||||
sm2_results[k][0] += d;
|
sm2_results[k][0] += d;
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2004-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
* Copyright (c) 2004, EdelKey Project. All Rights Reserved.
|
* Copyright (c) 2004, EdelKey Project. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -97,8 +97,8 @@ const OPTIONS ts_options[] = {
|
|||||||
{"inkey", OPT_INKEY, 's', "File with private key for reply"},
|
{"inkey", OPT_INKEY, 's', "File with private key for reply"},
|
||||||
{"signer", OPT_SIGNER, 's', "Signer certificate file"},
|
{"signer", OPT_SIGNER, 's', "Signer certificate file"},
|
||||||
{"chain", OPT_CHAIN, '<', "File with signer CA chain"},
|
{"chain", OPT_CHAIN, '<', "File with signer CA chain"},
|
||||||
{"CApath", OPT_CAPATH, '/', "Path to trusted CA files"},
|
|
||||||
{"CAfile", OPT_CAFILE, '<', "File with trusted CA certs"},
|
{"CAfile", OPT_CAFILE, '<', "File with trusted CA certs"},
|
||||||
|
{"CApath", OPT_CAPATH, '/', "Path to trusted CA files"},
|
||||||
{"CAstore", OPT_CASTORE, ':', "URI to trusted CA store"},
|
{"CAstore", OPT_CASTORE, ':', "URI to trusted CA store"},
|
||||||
{"untrusted", OPT_UNTRUSTED, '<', "File with untrusted certs"},
|
{"untrusted", OPT_UNTRUSTED, '<', "File with untrusted certs"},
|
||||||
{"token_in", OPT_TOKEN_IN, '-', "Input is a PKCS#7 file"},
|
{"token_in", OPT_TOKEN_IN, '-', "Input is a PKCS#7 file"},
|
||||||
|
|||||||
+12
-8
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -18,6 +18,10 @@
|
|||||||
#include <openssl/x509v3.h>
|
#include <openssl/x509v3.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(X509)
|
||||||
|
DEFINE_STACK_OF(X509_CRL)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
static int cb(int ok, X509_STORE_CTX *ctx);
|
static int cb(int ok, X509_STORE_CTX *ctx);
|
||||||
static int check(X509_STORE *ctx, const char *file,
|
static int check(X509_STORE *ctx, const char *file,
|
||||||
STACK_OF(X509) *uchain, STACK_OF(X509) *tchain,
|
STACK_OF(X509) *uchain, STACK_OF(X509) *tchain,
|
||||||
@@ -45,24 +49,24 @@ const OPTIONS verify_options[] = {
|
|||||||
#endif
|
#endif
|
||||||
{"verbose", OPT_VERBOSE, '-',
|
{"verbose", OPT_VERBOSE, '-',
|
||||||
"Print extra information about the operations being performed."},
|
"Print extra information about the operations being performed."},
|
||||||
{"nameopt", OPT_NAMEOPT, 's', "Various certificate name options"},
|
{"nameopt", OPT_NAMEOPT, 's', "Certificate subject/issuer name printing options"},
|
||||||
|
|
||||||
OPT_SECTION("Certificate chain"),
|
OPT_SECTION("Certificate chain"),
|
||||||
{"CApath", OPT_CAPATH, '/', "A directory of trusted certificates"},
|
{"trusted", OPT_TRUSTED, '<', "A file of trusted certificates"},
|
||||||
{"CAfile", OPT_CAFILE, '<', "A file of trusted certificates"},
|
{"CAfile", OPT_CAFILE, '<', "A file of trusted certificates"},
|
||||||
|
{"CApath", OPT_CAPATH, '/', "A directory of files with trusted certificates"},
|
||||||
{"CAstore", OPT_CASTORE, ':', "URI to a store of trusted certificates"},
|
{"CAstore", OPT_CASTORE, ':', "URI to a store of trusted certificates"},
|
||||||
{"no-CAfile", OPT_NOCAFILE, '-',
|
{"no-CAfile", OPT_NOCAFILE, '-',
|
||||||
"Do not load the default certificates file"},
|
"Do not load the default trusted certificates file"},
|
||||||
{"no-CApath", OPT_NOCAPATH, '-',
|
{"no-CApath", OPT_NOCAPATH, '-',
|
||||||
"Do not load certificates from the default certificates directory"},
|
"Do not load trusted certificates from the default directory"},
|
||||||
{"no-CAstore", OPT_NOCAPATH, '-',
|
{"no-CAstore", OPT_NOCAPATH, '-',
|
||||||
"Do not load certificates from the default certificates store"},
|
"Do not load trusted certificates from the default certificates store"},
|
||||||
{"untrusted", OPT_UNTRUSTED, '<', "A file of untrusted certificates"},
|
{"untrusted", OPT_UNTRUSTED, '<', "A file of untrusted certificates"},
|
||||||
{"trusted", OPT_TRUSTED, '<', "A file of trusted certificates"},
|
|
||||||
{"CRLfile", OPT_CRLFILE, '<',
|
{"CRLfile", OPT_CRLFILE, '<',
|
||||||
"File containing one or more CRL's (in PEM format) to load"},
|
"File containing one or more CRL's (in PEM format) to load"},
|
||||||
{"crl_download", OPT_CRL_DOWNLOAD, '-',
|
{"crl_download", OPT_CRL_DOWNLOAD, '-',
|
||||||
"Attempt to download CRL information for this certificate"},
|
"Try downloading CRL information for certificates via their CDP entries"},
|
||||||
{"show_chain", OPT_SHOW_CHAIN, '-',
|
{"show_chain", OPT_SHOW_CHAIN, '-',
|
||||||
"Display information about the certificate chain"},
|
"Display information about the certificate chain"},
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
+8
-12
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -28,6 +28,10 @@
|
|||||||
# include <openssl/dsa.h>
|
# include <openssl/dsa.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
DEFINE_STACK_OF(ASN1_OBJECT)
|
||||||
|
DEFINE_STACK_OF(X509_EXTENSION)
|
||||||
|
DEFINE_STACK_OF_STRING()
|
||||||
|
|
||||||
#undef POSTFIX
|
#undef POSTFIX
|
||||||
#define POSTFIX ".srl"
|
#define POSTFIX ".srl"
|
||||||
#define DEF_DAYS 30
|
#define DEF_DAYS 30
|
||||||
@@ -117,7 +121,7 @@ const OPTIONS x509_options[] = {
|
|||||||
{"issuer_hash_old", OPT_ISSUER_HASH_OLD, '-',
|
{"issuer_hash_old", OPT_ISSUER_HASH_OLD, '-',
|
||||||
"Print old-style (MD5) subject hash value"},
|
"Print old-style (MD5) subject hash value"},
|
||||||
#endif
|
#endif
|
||||||
{"nameopt", OPT_NAMEOPT, 's', "Various certificate name options"},
|
{"nameopt", OPT_NAMEOPT, 's', "Certificate subject/issuer name printing options"},
|
||||||
|
|
||||||
OPT_SECTION("Certificate"),
|
OPT_SECTION("Certificate"),
|
||||||
{"startdate", OPT_STARTDATE, '-', "Set notBefore field"},
|
{"startdate", OPT_STARTDATE, '-', "Set notBefore field"},
|
||||||
@@ -568,18 +572,10 @@ int x509_main(int argc, char **argv)
|
|||||||
|
|
||||||
if (reqfile) {
|
if (reqfile) {
|
||||||
EVP_PKEY *pkey;
|
EVP_PKEY *pkey;
|
||||||
BIO *in;
|
|
||||||
|
|
||||||
in = bio_open_default(infile, 'r', informat);
|
req = load_csr(infile, informat, "certificate request input");
|
||||||
if (in == NULL)
|
if (req == NULL)
|
||||||
goto end;
|
goto end;
|
||||||
req = PEM_read_bio_X509_REQ(in, NULL, NULL, NULL);
|
|
||||||
BIO_free(in);
|
|
||||||
|
|
||||||
if (req == NULL) {
|
|
||||||
ERR_print_errors(bio_err);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((pkey = X509_REQ_get0_pubkey(req)) == NULL) {
|
if ((pkey = X509_REQ_get0_pubkey(req)) == NULL) {
|
||||||
BIO_printf(bio_err, "error unpacking public key\n");
|
BIO_printf(bio_err, "error unpacking public key\n");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 1998-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
@@ -15,10 +15,6 @@
|
|||||||
|
|
||||||
#include "internal/cryptlib.h"
|
#include "internal/cryptlib.h"
|
||||||
|
|
||||||
#ifdef OPENSSL_NO_DEPRECATED_3_0
|
|
||||||
NON_EMPTY_TRANSLATION_UNIT
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include <openssl/aes.h>
|
#include <openssl/aes.h>
|
||||||
#include "aes_local.h"
|
#include "aes_local.h"
|
||||||
|
|
||||||
@@ -301,4 +297,3 @@ void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
|
* Copyright 2008-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
* this file except in compliance with the License. You can obtain a copy
|
* this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2004-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2012-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2010-2019 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2009-2018 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2005-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2005-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2013-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2013-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2009-2016 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2009-2016 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2009-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2012-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2012-2018 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2012-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#! /usr/bin/env perl
|
#! /usr/bin/env perl
|
||||||
# Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.
|
# Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||||
# this file except in compliance with the License. You can obtain a copy
|
# this file except in compliance with the License. You can obtain a copy
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user