The branch master has been updated via d922634d0c63cee01c89869d79306cd2df628855 (commit) via b3795987477f1d478fd8bd20efb812e71b190e8b (commit) via 159f6e7ecfde9e98194d6111c85587b85b6a8fc5 (commit) from bad6b116a2d3c005330e618c726f172fd0fefc2a (commit)
- Log ----------------------------------------------------------------- commit d922634d0c63cee01c89869d79306cd2df628855 Author: Dr. Stephen Henson <st...@openssl.org> Date: Wed Nov 16 23:04:14 2016 +0000 Add conversion test for MSBLOB format. Reviewed-by: Rich Salz <rs...@openssl.org> commit b3795987477f1d478fd8bd20efb812e71b190e8b Author: Dr. Stephen Henson <st...@openssl.org> Date: Wed Nov 16 23:14:30 2016 +0000 Make MSBLOB format work with dsa utility. Reviewed-by: Rich Salz <rs...@openssl.org> commit 159f6e7ecfde9e98194d6111c85587b85b6a8fc5 Author: Dr. Stephen Henson <st...@openssl.org> Date: Wed Nov 16 23:03:43 2016 +0000 Fix MSBLOB format with RSA. Reviewed-by: Rich Salz <rs...@openssl.org> ----------------------------------------------------------------------- Summary of changes: apps/dsa.c | 5 ++--- crypto/pem/pvkfmt.c | 2 +- test/recipes/15-test_dsa.t | 4 ++-- test/recipes/15-test_rsa.t | 2 +- test/recipes/tconversion.pl | 1 + 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/dsa.c b/apps/dsa.c index 7f98512..d88116f 100644 --- a/apps/dsa.c +++ b/apps/dsa.c @@ -37,7 +37,7 @@ typedef enum OPTION_choice { const OPTIONS dsa_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, {"inform", OPT_INFORM, 'f', "Input format, DER PEM PVK"}, - {"outform", OPT_OUTFORM, 'F', "Output format, DER PEM PVK"}, + {"outform", OPT_OUTFORM, 'f', "Output format, DER PEM PVK"}, {"in", OPT_IN, 's', "Input key"}, {"out", OPT_OUT, '>', "Output file"}, {"noout", OPT_NOOUT, '-', "Don't print key out"}, @@ -96,8 +96,7 @@ int dsa_main(int argc, char **argv) infile = opt_arg(); break; case OPT_OUTFORM: - if (!opt_format - (opt_arg(), OPT_FMT_PEMDER | OPT_FMT_PVK, &outformat)) + if (!opt_format(opt_arg(), OPT_FMT_ANY, &outformat)) goto opthelp; break; case OPT_OUT: diff --git a/crypto/pem/pvkfmt.c b/crypto/pem/pvkfmt.c index 416bfc2..248704e 100644 --- a/crypto/pem/pvkfmt.c +++ b/crypto/pem/pvkfmt.c @@ -548,7 +548,7 @@ static void write_rsa(unsigned char **out, RSA *rsa, int ispub) hnbyte = (RSA_bits(rsa) + 15) >> 4; RSA_get0_key(rsa, &n, &e, &d); write_lebn(out, e, 4); - write_lebn(out, n, -1); + write_lebn(out, n, nbyte); if (ispub) return; RSA_get0_factors(rsa, &p, &q); diff --git a/test/recipes/15-test_dsa.t b/test/recipes/15-test_dsa.t index bf3b0d3..2fd236e 100644 --- a/test/recipes/15-test_dsa.t +++ b/test/recipes/15-test_dsa.t @@ -34,7 +34,7 @@ ok(run(test(["dsatest", "-app2_1"])), "running dsatest -app2_1"); tconversion("dsa", srctop_file("test","testdsa.pem"), "pkey"); }; subtest 'dsa conversions -- public key' => sub { - tconversion("dsa", srctop_file("test","testdsapub.pem"), "dsa", - "-pubin", "-pubout"); + tconversion("msb", srctop_file("test","testdsapub.pem"), "dsa", + "-pubin", "-pubout"); }; } diff --git a/test/recipes/15-test_rsa.t b/test/recipes/15-test_rsa.t index cb1172a..a57ce63 100644 --- a/test/recipes/15-test_rsa.t +++ b/test/recipes/15-test_rsa.t @@ -35,7 +35,7 @@ ok(run(app([ 'openssl', 'rsa', '-check', '-in', srctop_file('test', 'testrsa.pem tconversion("rsa", srctop_file("test","testrsa.pem"), "pkey"); }; subtest 'rsa conversions -- public key' => sub { - tconversion("rsa", srctop_file("test","testrsapub.pem"), "rsa", + tconversion("msb", srctop_file("test","testrsapub.pem"), "rsa", "-pubin", "-pubout"); }; } diff --git a/test/recipes/tconversion.pl b/test/recipes/tconversion.pl index 1655cd4..1a308e2 100644 --- a/test/recipes/tconversion.pl +++ b/test/recipes/tconversion.pl @@ -19,6 +19,7 @@ my %conversionforms = ( # Default conversion forms. Other series may be added with # specific test types as key. "*" => [ "d", "p" ], + "msb" => [ "d", "p", "msblob" ], ); sub tconversion { my $testtype = shift; _____ openssl-commits mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits