"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "apps/dsaparam.c" between
openssl-1.1.1f.tar.gz and openssl-1.1.1g.tar.gz

About: OpenSSL is a toolkit implementing the Transport Layer Security (TLS) protocols (including SSLv3) as well as a full-strength general purpose cryptographic library. Long Term Support (LTS) version (includes support for TLSv1.3).

dsaparam.c  (openssl-1.1.1f):dsaparam.c  (openssl-1.1.1g)
/* /*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * Copyright 1995-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
* in the file LICENSE in the source distribution or at * in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html * https://www.openssl.org/source/license.html
*/ */
#include <openssl/opensslconf.h> #include <openssl/opensslconf.h>
#ifdef OPENSSL_NO_DSA #include <stdio.h>
NON_EMPTY_TRANSLATION_UNIT #include <stdlib.h>
#else #include <time.h>
#include <string.h>
# include <stdio.h> #include "apps.h"
# include <stdlib.h> #include "progs.h"
# include <time.h> #include <openssl/bio.h>
# include <string.h> #include <openssl/err.h>
# include "apps.h" #include <openssl/bn.h>
# include "progs.h" #include <openssl/dsa.h>
# include <openssl/bio.h> #include <openssl/x509.h>
# include <openssl/err.h> #include <openssl/pem.h>
# include <openssl/bn.h>
# include <openssl/dsa.h>
# include <openssl/x509.h>
# include <openssl/pem.h>
static int dsa_cb(int p, int n, BN_GENCB *cb); static int dsa_cb(int p, int n, BN_GENCB *cb);
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_TEXT, OPT_C, OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_TEXT, OPT_C,
OPT_NOOUT, OPT_GENKEY, OPT_ENGINE, OPT_R_ENUM OPT_NOOUT, OPT_GENKEY, OPT_ENGINE, OPT_R_ENUM
} OPTION_CHOICE; } OPTION_CHOICE;
const OPTIONS dsaparam_options[] = { const OPTIONS dsaparam_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"inform", OPT_INFORM, 'F', "Input format - DER or PEM"}, {"inform", OPT_INFORM, 'F', "Input format - DER or PEM"},
{"in", OPT_IN, '<', "Input file"}, {"in", OPT_IN, '<', "Input file"},
{"outform", OPT_OUTFORM, 'F', "Output format - DER or PEM"}, {"outform", OPT_OUTFORM, 'F', "Output format - DER or PEM"},
{"out", OPT_OUT, '>', "Output file"}, {"out", OPT_OUT, '>', "Output file"},
{"text", OPT_TEXT, '-', "Print as text"}, {"text", OPT_TEXT, '-', "Print as text"},
{"C", OPT_C, '-', "Output C code"}, {"C", OPT_C, '-', "Output C code"},
{"noout", OPT_NOOUT, '-', "No output"}, {"noout", OPT_NOOUT, '-', "No output"},
{"genkey", OPT_GENKEY, '-', "Generate a DSA key"}, {"genkey", OPT_GENKEY, '-', "Generate a DSA key"},
OPT_R_OPTIONS, OPT_R_OPTIONS,
# ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
{"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"}, {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"},
# endif #endif
{NULL} {NULL}
}; };
int dsaparam_main(int argc, char **argv) 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; BN_GENCB *cb = NULL;
int numbits = -1, num = 0, genkey = 0; int numbits = -1, num = 0, genkey = 0;
skipping to change at line 258 skipping to change at line 254
static int dsa_cb(int p, int n, BN_GENCB *cb) static int dsa_cb(int p, int n, BN_GENCB *cb)
{ {
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(BN_GENCB_get_arg(cb), &c, 1);
(void)BIO_flush(BN_GENCB_get_arg(cb)); (void)BIO_flush(BN_GENCB_get_arg(cb));
return 1; return 1;
} }
#endif
 End of changes. 5 change blocks. 
19 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)