"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "apps/genrsa.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).

genrsa.c  (openssl-1.1.1f):genrsa.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_RSA #include <stdio.h>
NON_EMPTY_TRANSLATION_UNIT #include <string.h>
#else #include <sys/types.h>
#include <sys/stat.h>
# include <stdio.h> #include "apps.h"
# include <string.h> #include "progs.h"
# include <sys/types.h> #include <openssl/bio.h>
# include <sys/stat.h> #include <openssl/err.h>
# include "apps.h" #include <openssl/bn.h>
# include "progs.h" #include <openssl/rsa.h>
# include <openssl/bio.h> #include <openssl/evp.h>
# include <openssl/err.h> #include <openssl/x509.h>
# include <openssl/bn.h> #include <openssl/pem.h>
# include <openssl/rsa.h> #include <openssl/rand.h>
# include <openssl/evp.h>
# include <openssl/x509.h>
# include <openssl/pem.h>
# include <openssl/rand.h>
# define DEFBITS 2048 #define DEFBITS 2048
# define DEFPRIMES 2 #define DEFPRIMES 2
static int genrsa_cb(int p, int n, BN_GENCB *cb); static int genrsa_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_3, OPT_F4, OPT_ENGINE, OPT_3, OPT_F4, OPT_ENGINE,
OPT_OUT, OPT_PASSOUT, OPT_CIPHER, OPT_PRIMES, OPT_OUT, OPT_PASSOUT, OPT_CIPHER, OPT_PRIMES,
OPT_R_ENUM OPT_R_ENUM
} OPTION_CHOICE; } OPTION_CHOICE;
const OPTIONS genrsa_options[] = { const OPTIONS genrsa_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"3", OPT_3, '-', "Use 3 for the E value"}, {"3", OPT_3, '-', "Use 3 for the E value"},
{"F4", OPT_F4, '-', "Use F4 (0x10001) for the E value"}, {"F4", OPT_F4, '-', "Use F4 (0x10001) for the E value"},
{"f4", OPT_F4, '-', "Use F4 (0x10001) for the E value"}, {"f4", OPT_F4, '-', "Use F4 (0x10001) for the E value"},
{"out", OPT_OUT, '>', "Output the key to specified file"}, {"out", OPT_OUT, '>', "Output the key to specified file"},
OPT_R_OPTIONS, OPT_R_OPTIONS,
{"passout", OPT_PASSOUT, 's', "Output file pass phrase source"}, {"passout", OPT_PASSOUT, 's', "Output file pass phrase source"},
{"", OPT_CIPHER, '-', "Encrypt the output with any supported cipher"}, {"", OPT_CIPHER, '-', "Encrypt the output with any supported cipher"},
# ifndef OPENSSL_NO_ENGINE #ifndef OPENSSL_NO_ENGINE
{"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"}, {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"},
# endif #endif
{"primes", OPT_PRIMES, 'p', "Specify number of primes"}, {"primes", OPT_PRIMES, 'p', "Specify number of primes"},
{NULL} {NULL}
}; };
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; PW_CB_DATA cb_data;
ENGINE *eng = NULL; ENGINE *eng = NULL;
BIGNUM *bn = BN_new(); BIGNUM *bn = BN_new();
skipping to change at line 201 skipping to change at line 197
if (p == 1) if (p == 1)
c = '+'; c = '+';
if (p == 2) if (p == 2)
c = '*'; c = '*';
if (p == 3) if (p == 3)
c = '\n'; c = '\n';
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. 6 change blocks. 
23 lines changed or deleted 19 lines changed or added

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