diff options
author | tpashkin <tpashkin@yandex-team.ru> | 2022-02-10 16:46:41 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:41 +0300 |
commit | 5475379a04e37df30085bd1724f1c57e3f40996f (patch) | |
tree | 95d77e29785a3bd5be6260b1c9d226a551376ecf /contrib/libs/openssl/apps | |
parent | c3d34b9b40eb534dfd2c549342274f3d61844688 (diff) | |
download | ydb-5475379a04e37df30085bd1724f1c57e3f40996f.tar.gz |
Restoring authorship annotation for <tpashkin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/openssl/apps')
32 files changed, 603 insertions, 603 deletions
diff --git a/contrib/libs/openssl/apps/apps.c b/contrib/libs/openssl/apps/apps.c index c06241abb9..18e42a5734 100644 --- a/contrib/libs/openssl/apps/apps.c +++ b/contrib/libs/openssl/apps/apps.c @@ -1962,46 +1962,46 @@ unsigned char *next_protos_parse(size_t *outlen, const char *in) size_t len; unsigned char *out; size_t i, start = 0; - size_t skipped = 0; + size_t skipped = 0; len = strlen(in); - if (len == 0 || len >= 65535) + if (len == 0 || len >= 65535) return NULL; - out = app_malloc(len + 1, "NPN buffer"); + out = app_malloc(len + 1, "NPN buffer"); for (i = 0; i <= len; ++i) { if (i == len || in[i] == ',') { - /* - * Zero-length ALPN elements are invalid on the wire, we could be - * strict and reject the entire string, but just ignoring extra - * commas seems harmless and more friendly. - * - * Every comma we skip in this way puts the input buffer another - * byte ahead of the output buffer, so all stores into the output - * buffer need to be decremented by the number commas skipped. - */ - if (i == start) { - ++start; - ++skipped; - continue; - } + /* + * Zero-length ALPN elements are invalid on the wire, we could be + * strict and reject the entire string, but just ignoring extra + * commas seems harmless and more friendly. + * + * Every comma we skip in this way puts the input buffer another + * byte ahead of the output buffer, so all stores into the output + * buffer need to be decremented by the number commas skipped. + */ + if (i == start) { + ++start; + ++skipped; + continue; + } if (i - start > 255) { OPENSSL_free(out); return NULL; } - out[start-skipped] = (unsigned char)(i - start); + out[start-skipped] = (unsigned char)(i - start); start = i + 1; } else { - out[i + 1 - skipped] = in[i]; + out[i + 1 - skipped] = in[i]; } } - if (len <= skipped) { - OPENSSL_free(out); - return NULL; - } - - *outlen = len + 1 - skipped; + if (len <= skipped) { + OPENSSL_free(out); + return NULL; + } + + *outlen = len + 1 - skipped; return out; } diff --git a/contrib/libs/openssl/apps/apps.h b/contrib/libs/openssl/apps/apps.h index 34c3fd8633..99486aa622 100644 --- a/contrib/libs/openssl/apps/apps.h +++ b/contrib/libs/openssl/apps/apps.h @@ -7,8 +7,8 @@ * https://www.openssl.org/source/license.html */ -#ifndef OSSL_APPS_H -# define OSSL_APPS_H +#ifndef OSSL_APPS_H +# define OSSL_APPS_H # include "e_os.h" /* struct timeval for DTLS */ # include "internal/nelem.h" diff --git a/contrib/libs/openssl/apps/dgst.c b/contrib/libs/openssl/apps/dgst.c index e595f7d818..5884d2c165 100644 --- a/contrib/libs/openssl/apps/dgst.c +++ b/contrib/libs/openssl/apps/dgst.c @@ -19,7 +19,7 @@ #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/hmac.h> -#include <ctype.h> +#include <ctype.h> #undef BUFSIZE #define BUFSIZE 1024*8 @@ -28,15 +28,15 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, EVP_PKEY *key, unsigned char *sigin, int siglen, const char *sig_name, const char *md_name, const char *file); -static void show_digests(const OBJ_NAME *name, void *bio_); - -struct doall_dgst_digests { - BIO *bio; - int n; -}; +static void show_digests(const OBJ_NAME *name, void *bio_); +struct doall_dgst_digests { + BIO *bio; + int n; +}; + typedef enum OPTION_choice { - OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, OPT_LIST, + OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, OPT_LIST, OPT_C, OPT_R, OPT_OUT, OPT_SIGN, OPT_PASSIN, OPT_VERIFY, OPT_PRVERIFY, OPT_SIGNATURE, OPT_KEYFORM, OPT_ENGINE, OPT_ENGINE_IMPL, OPT_HEX, OPT_BINARY, OPT_DEBUG, OPT_FIPS_FINGERPRINT, @@ -50,7 +50,7 @@ const OPTIONS dgst_options[] = { {OPT_HELP_STR, 1, '-', " file... files to digest (default is stdin)\n"}, {"help", OPT_HELP, '-', "Display this summary"}, - {"list", OPT_LIST, '-', "List digests"}, + {"list", OPT_LIST, '-', "List digests"}, {"c", OPT_C, '-', "Print the digest with separating colons"}, {"r", OPT_R, '-', "Print the digest in coreutils format"}, {"out", OPT_OUT, '>', "Output to filename rather than stdout"}, @@ -99,7 +99,7 @@ int dgst_main(int argc, char **argv) int i, ret = 1, out_bin = -1, want_pub = 0, do_verify = 0; unsigned char *buf = NULL, *sigbuf = NULL; int engine_impl = 0; - struct doall_dgst_digests dec; + struct doall_dgst_digests dec; prog = opt_progname(argv[0]); buf = app_malloc(BUFSIZE, "I/O buffer"); @@ -117,15 +117,15 @@ int dgst_main(int argc, char **argv) opt_help(dgst_options); ret = 0; goto end; - case OPT_LIST: - BIO_printf(bio_out, "Supported digests:\n"); - dec.bio = bio_out; - dec.n = 0; - OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_MD_METH, - show_digests, &dec); - BIO_printf(bio_out, "\n"); - ret = 0; - goto end; + case OPT_LIST: + BIO_printf(bio_out, "Supported digests:\n"); + dec.bio = bio_out; + dec.n = 0; + OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_MD_METH, + show_digests, &dec); + BIO_printf(bio_out, "\n"); + ret = 0; + goto end; case OPT_C: separator = 1; break; @@ -431,86 +431,86 @@ int dgst_main(int argc, char **argv) return ret; } -static void show_digests(const OBJ_NAME *name, void *arg) -{ - struct doall_dgst_digests *dec = (struct doall_dgst_digests *)arg; - const EVP_MD *md = NULL; - - /* Filter out signed digests (a.k.a signature algorithms) */ - if (strstr(name->name, "rsa") != NULL || strstr(name->name, "RSA") != NULL) - return; - - if (!islower((unsigned char)*name->name)) - return; - - /* Filter out message digests that we cannot use */ - md = EVP_get_digestbyname(name->name); - if (md == NULL) - return; - - BIO_printf(dec->bio, "-%-25s", name->name); - if (++dec->n == 3) { - BIO_printf(dec->bio, "\n"); - dec->n = 0; - } else { - BIO_printf(dec->bio, " "); - } -} - -/* - * The newline_escape_filename function performs newline escaping for any - * filename that contains a newline. This function also takes a pointer - * to backslash. The backslash pointer is a flag to indicating whether a newline - * is present in the filename. If a newline is present, the backslash flag is - * set and the output format will contain a backslash at the beginning of the - * digest output. This output format is to replicate the output format found - * in the '*sum' checksum programs. This aims to preserve backward - * compatibility. - */ -static const char *newline_escape_filename(const char *file, int * backslash) -{ - size_t i, e = 0, length = strlen(file), newline_count = 0, mem_len = 0; - char *file_cpy = NULL; - - for (i = 0; i < length; i++) - if (file[i] == '\n') - newline_count++; - - mem_len = length + newline_count + 1; - file_cpy = app_malloc(mem_len, file); - i = 0; - - while(e < length) { - const char c = file[e]; - if (c == '\n') { - file_cpy[i++] = '\\'; - file_cpy[i++] = 'n'; - *backslash = 1; - } else { - file_cpy[i++] = c; - } - e++; - } - file_cpy[i] = '\0'; - return (const char*)file_cpy; -} - - +static void show_digests(const OBJ_NAME *name, void *arg) +{ + struct doall_dgst_digests *dec = (struct doall_dgst_digests *)arg; + const EVP_MD *md = NULL; + + /* Filter out signed digests (a.k.a signature algorithms) */ + if (strstr(name->name, "rsa") != NULL || strstr(name->name, "RSA") != NULL) + return; + + if (!islower((unsigned char)*name->name)) + return; + + /* Filter out message digests that we cannot use */ + md = EVP_get_digestbyname(name->name); + if (md == NULL) + return; + + BIO_printf(dec->bio, "-%-25s", name->name); + if (++dec->n == 3) { + BIO_printf(dec->bio, "\n"); + dec->n = 0; + } else { + BIO_printf(dec->bio, " "); + } +} + +/* + * The newline_escape_filename function performs newline escaping for any + * filename that contains a newline. This function also takes a pointer + * to backslash. The backslash pointer is a flag to indicating whether a newline + * is present in the filename. If a newline is present, the backslash flag is + * set and the output format will contain a backslash at the beginning of the + * digest output. This output format is to replicate the output format found + * in the '*sum' checksum programs. This aims to preserve backward + * compatibility. + */ +static const char *newline_escape_filename(const char *file, int * backslash) +{ + size_t i, e = 0, length = strlen(file), newline_count = 0, mem_len = 0; + char *file_cpy = NULL; + + for (i = 0; i < length; i++) + if (file[i] == '\n') + newline_count++; + + mem_len = length + newline_count + 1; + file_cpy = app_malloc(mem_len, file); + i = 0; + + while(e < length) { + const char c = file[e]; + if (c == '\n') { + file_cpy[i++] = '\\'; + file_cpy[i++] = 'n'; + *backslash = 1; + } else { + file_cpy[i++] = c; + } + e++; + } + file_cpy[i] = '\0'; + return (const char*)file_cpy; +} + + int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, EVP_PKEY *key, unsigned char *sigin, int siglen, const char *sig_name, const char *md_name, const char *file) { - size_t len = BUFSIZE; - int i, backslash = 0, ret = 1; - unsigned char *sigbuf = NULL; + size_t len = BUFSIZE; + int i, backslash = 0, ret = 1; + unsigned char *sigbuf = NULL; while (BIO_pending(bp) || !BIO_eof(bp)) { i = BIO_read(bp, (char *)buf, BUFSIZE); if (i < 0) { BIO_printf(bio_err, "Read Error in %s\n", file); ERR_print_errors(bio_err); - goto end; + goto end; } if (i == 0) break; @@ -523,51 +523,51 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, BIO_printf(out, "Verified OK\n"); } else if (i == 0) { BIO_printf(out, "Verification Failure\n"); - goto end; + goto end; } else { BIO_printf(bio_err, "Error Verifying Data\n"); ERR_print_errors(bio_err); - goto end; + goto end; } - ret = 0; - goto end; + ret = 0; + goto end; } if (key != NULL) { EVP_MD_CTX *ctx; - int pkey_len; + int pkey_len; BIO_get_md_ctx(bp, &ctx); - pkey_len = EVP_PKEY_size(key); - if (pkey_len > BUFSIZE) { - len = pkey_len; - sigbuf = app_malloc(len, "Signature buffer"); - buf = sigbuf; - } + pkey_len = EVP_PKEY_size(key); + if (pkey_len > BUFSIZE) { + len = pkey_len; + sigbuf = app_malloc(len, "Signature buffer"); + buf = sigbuf; + } if (!EVP_DigestSignFinal(ctx, buf, &len)) { BIO_printf(bio_err, "Error Signing Data\n"); ERR_print_errors(bio_err); - goto end; + goto end; } } else { len = BIO_gets(bp, (char *)buf, BUFSIZE); if ((int)len < 0) { ERR_print_errors(bio_err); - goto end; + goto end; } } if (binout) { BIO_write(out, buf, len); } else if (sep == 2) { - file = newline_escape_filename(file, &backslash); - - if (backslash == 1) - BIO_puts(out, "\\"); - + file = newline_escape_filename(file, &backslash); + + if (backslash == 1) + BIO_puts(out, "\\"); + for (i = 0; i < (int)len; i++) BIO_printf(out, "%02x", buf[i]); - + BIO_printf(out, " *%s\n", file); - OPENSSL_free((char *)file); + OPENSSL_free((char *)file); } else { if (sig_name != NULL) { BIO_puts(out, sig_name); @@ -586,11 +586,11 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout, } BIO_printf(out, "\n"); } - - ret = 0; - end: - if (sigbuf != NULL) - OPENSSL_clear_free(sigbuf, len); - - return ret; + + ret = 0; + end: + if (sigbuf != NULL) + OPENSSL_clear_free(sigbuf, len); + + return ret; } diff --git a/contrib/libs/openssl/apps/dhparam.c b/contrib/libs/openssl/apps/dhparam.c index 98c73214b5..a2562a9779 100644 --- a/contrib/libs/openssl/apps/dhparam.c +++ b/contrib/libs/openssl/apps/dhparam.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2020 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 * this file except in compliance with the License. You can obtain a copy @@ -8,24 +8,24 @@ */ #include <openssl/opensslconf.h> -#include <stdio.h> -#include <stdlib.h> -#include <time.h> -#include <string.h> -#include "apps.h" -#include "progs.h" -#include <openssl/bio.h> -#include <openssl/err.h> -#include <openssl/bn.h> -#include <openssl/dh.h> -#include <openssl/x509.h> -#include <openssl/pem.h> - -#ifndef OPENSSL_NO_DSA -# include <openssl/dsa.h> -#endif - -#define DEFBITS 2048 +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <string.h> +#include "apps.h" +#include "progs.h" +#include <openssl/bio.h> +#include <openssl/err.h> +#include <openssl/bn.h> +#include <openssl/dh.h> +#include <openssl/x509.h> +#include <openssl/pem.h> + +#ifndef OPENSSL_NO_DSA +# include <openssl/dsa.h> +#endif + +#define DEFBITS 2048 static int dh_cb(int p, int n, BN_GENCB *cb); @@ -52,13 +52,13 @@ const OPTIONS dhparam_options[] = { {"C", OPT_C, '-', "Print C code"}, {"2", OPT_2, '-', "Generate parameters using 2 as the generator value"}, {"5", OPT_5, '-', "Generate parameters using 5 as the generator value"}, -#ifndef OPENSSL_NO_DSA +#ifndef OPENSSL_NO_DSA {"dsaparam", OPT_DSAPARAM, '-', "Read or generate DSA parameters, convert to DH"}, -#endif -#ifndef OPENSSL_NO_ENGINE +#endif +#ifndef OPENSSL_NO_ENGINE {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"}, -#endif +#endif {NULL} }; @@ -142,13 +142,13 @@ int dhparam_main(int argc, char **argv) if (g && !num) num = DEFBITS; -#ifndef OPENSSL_NO_DSA +#ifndef OPENSSL_NO_DSA if (dsaparam && g) { BIO_printf(bio_err, "generator may not be chosen for DSA parameters\n"); goto end; } -#endif +#endif out = bio_open_default(outfile, 'w', outformat); if (out == NULL) @@ -169,7 +169,7 @@ int dhparam_main(int argc, char **argv) BN_GENCB_set(cb, dh_cb, bio_err); -#ifndef OPENSSL_NO_DSA +#ifndef OPENSSL_NO_DSA if (dsaparam) { DSA *dsa = DSA_new(); @@ -192,7 +192,7 @@ int dhparam_main(int argc, char **argv) goto end; } } else -#endif +#endif { dh = DH_new(); BIO_printf(bio_err, @@ -213,7 +213,7 @@ int dhparam_main(int argc, char **argv) if (in == NULL) goto end; -#ifndef OPENSSL_NO_DSA +#ifndef OPENSSL_NO_DSA if (dsaparam) { DSA *dsa; @@ -235,7 +235,7 @@ int dhparam_main(int argc, char **argv) goto end; } } else -#endif +#endif { if (informat == FORMAT_ASN1) { /* diff --git a/contrib/libs/openssl/apps/dsa.c b/contrib/libs/openssl/apps/dsa.c index c7884df166..f167af44d5 100644 --- a/contrib/libs/openssl/apps/dsa.c +++ b/contrib/libs/openssl/apps/dsa.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2020 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 * this file except in compliance with the License. You can obtain a copy @@ -8,19 +8,19 @@ */ #include <openssl/opensslconf.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> -#include "apps.h" -#include "progs.h" -#include <openssl/bio.h> -#include <openssl/err.h> -#include <openssl/dsa.h> -#include <openssl/evp.h> -#include <openssl/x509.h> -#include <openssl/pem.h> -#include <openssl/bn.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include "apps.h" +#include "progs.h" +#include <openssl/bio.h> +#include <openssl/err.h> +#include <openssl/dsa.h> +#include <openssl/evp.h> +#include <openssl/x509.h> +#include <openssl/pem.h> +#include <openssl/bn.h> typedef enum OPTION_choice { OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, @@ -45,14 +45,14 @@ const OPTIONS dsa_options[] = { {"passin", OPT_PASSIN, 's', "Input file pass phrase source"}, {"passout", OPT_PASSOUT, 's', "Output file pass phrase source"}, {"", OPT_CIPHER, '-', "Any supported cipher"}, -#ifndef OPENSSL_NO_RC4 +#ifndef OPENSSL_NO_RC4 {"pvk-strong", OPT_PVK_STRONG, '-', "Enable 'Strong' PVK encoding level (default)"}, {"pvk-weak", OPT_PVK_WEAK, '-', "Enable 'Weak' PVK encoding level"}, {"pvk-none", OPT_PVK_NONE, '-', "Don't enforce PVK encoding"}, -#endif -#ifndef OPENSSL_NO_ENGINE +#endif +#ifndef OPENSSL_NO_ENGINE {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"}, -#endif +#endif {NULL} }; @@ -67,9 +67,9 @@ int dsa_main(int argc, char **argv) OPTION_CHOICE o; int informat = FORMAT_PEM, outformat = FORMAT_PEM, text = 0, noout = 0; int i, modulus = 0, pubin = 0, pubout = 0, ret = 1; -#ifndef OPENSSL_NO_RC4 +#ifndef OPENSSL_NO_RC4 int pvk_encr = 2; -#endif +#endif int private = 0; prog = opt_init(argc, argv, dsa_options); @@ -210,7 +210,7 @@ int dsa_main(int argc, char **argv) i = PEM_write_bio_DSAPrivateKey(out, dsa, enc, NULL, 0, NULL, passout); } -#ifndef OPENSSL_NO_RSA +#ifndef OPENSSL_NO_RSA } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) { EVP_PKEY *pk; pk = EVP_PKEY_new(); @@ -225,13 +225,13 @@ int dsa_main(int argc, char **argv) goto end; } assert(private); -# ifdef OPENSSL_NO_RC4 +# ifdef OPENSSL_NO_RC4 BIO_printf(bio_err, "PVK format not supported\n"); EVP_PKEY_free(pk); goto end; -# else +# else i = i2b_PVK_bio(out, pk, pvk_encr, 0, passout); -# endif +# endif } else if (pubin || pubout) { i = i2b_PublicKey_bio(out, pk); } else { @@ -239,7 +239,7 @@ int dsa_main(int argc, char **argv) i = i2b_PrivateKey_bio(out, pk); } EVP_PKEY_free(pk); -#endif +#endif } else { BIO_printf(bio_err, "bad output format specified for outfile\n"); goto end; diff --git a/contrib/libs/openssl/apps/dsaparam.c b/contrib/libs/openssl/apps/dsaparam.c index 75589ac6bc..4699f14f40 100644 --- a/contrib/libs/openssl/apps/dsaparam.c +++ b/contrib/libs/openssl/apps/dsaparam.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2020 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 * this file except in compliance with the License. You can obtain a copy @@ -8,18 +8,18 @@ */ #include <openssl/opensslconf.h> -#include <stdio.h> -#include <stdlib.h> -#include <time.h> -#include <string.h> -#include "apps.h" -#include "progs.h" -#include <openssl/bio.h> -#include <openssl/err.h> -#include <openssl/bn.h> -#include <openssl/dsa.h> -#include <openssl/x509.h> -#include <openssl/pem.h> +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <string.h> +#include "apps.h" +#include "progs.h" +#include <openssl/bio.h> +#include <openssl/err.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); @@ -40,9 +40,9 @@ const OPTIONS dsaparam_options[] = { {"noout", OPT_NOOUT, '-', "No output"}, {"genkey", OPT_GENKEY, '-', "Generate a DSA key"}, OPT_R_OPTIONS, -#ifndef OPENSSL_NO_ENGINE +#ifndef OPENSSL_NO_ENGINE {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"}, -#endif +#endif {NULL} }; diff --git a/contrib/libs/openssl/apps/ec.c b/contrib/libs/openssl/apps/ec.c index 0c8ed750cc..bc376c0850 100644 --- a/contrib/libs/openssl/apps/ec.c +++ b/contrib/libs/openssl/apps/ec.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -8,15 +8,15 @@ */ #include <openssl/opensslconf.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "apps.h" -#include "progs.h" -#include <openssl/bio.h> -#include <openssl/err.h> -#include <openssl/evp.h> -#include <openssl/pem.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "apps.h" +#include "progs.h" +#include <openssl/bio.h> +#include <openssl/err.h> +#include <openssl/evp.h> +#include <openssl/pem.h> static OPT_PAIR conv_forms[] = { {"compressed", POINT_CONVERSION_COMPRESSED}, @@ -58,9 +58,9 @@ const OPTIONS ec_options[] = { "Specifies the way the ec parameters are encoded"}, {"conv_form", OPT_CONV_FORM, 's', "Specifies the point conversion form "}, {"", OPT_CIPHER, '-', "Any supported cipher"}, -#ifndef OPENSSL_NO_ENGINE +#ifndef OPENSSL_NO_ENGINE {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"}, -#endif +#endif {NULL} }; diff --git a/contrib/libs/openssl/apps/ecparam.c b/contrib/libs/openssl/apps/ecparam.c index 58fbeb95c9..350047f327 100644 --- a/contrib/libs/openssl/apps/ecparam.c +++ b/contrib/libs/openssl/apps/ecparam.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 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 * * Licensed under the OpenSSL license (the "License"). You may not use @@ -9,18 +9,18 @@ */ #include <openssl/opensslconf.h> -#include <stdio.h> -#include <stdlib.h> -#include <time.h> -#include <string.h> -#include "apps.h" -#include "progs.h" -#include <openssl/bio.h> -#include <openssl/err.h> -#include <openssl/bn.h> -#include <openssl/ec.h> -#include <openssl/x509.h> -#include <openssl/pem.h> +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <string.h> +#include "apps.h" +#include "progs.h" +#include <openssl/bio.h> +#include <openssl/err.h> +#include <openssl/bn.h> +#include <openssl/ec.h> +#include <openssl/x509.h> +#include <openssl/pem.h> typedef enum OPTION_choice { OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, @@ -51,9 +51,9 @@ const OPTIONS ecparam_options[] = { "Specifies the way the ec parameters are encoded"}, {"genkey", OPT_GENKEY, '-', "Generate ec key"}, OPT_R_OPTIONS, -#ifndef OPENSSL_NO_ENGINE +#ifndef OPENSSL_NO_ENGINE {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"}, -#endif +#endif {NULL} }; diff --git a/contrib/libs/openssl/apps/enc.c b/contrib/libs/openssl/apps/enc.c index 65710771a0..afbf3d4b0a 100644 --- a/contrib/libs/openssl/apps/enc.c +++ b/contrib/libs/openssl/apps/enc.c @@ -50,8 +50,8 @@ typedef enum OPTION_choice { const OPTIONS enc_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, - {"list", OPT_LIST, '-', "List ciphers"}, - {"ciphers", OPT_LIST, '-', "Alias for -list"}, + {"list", OPT_LIST, '-', "List ciphers"}, + {"ciphers", OPT_LIST, '-', "Alias for -list"}, {"in", OPT_IN, '<', "Input file"}, {"out", OPT_OUT, '>', "Output file"}, {"pass", OPT_PASS, 's', "Passphrase source"}, diff --git a/contrib/libs/openssl/apps/engine.c b/contrib/libs/openssl/apps/engine.c index 746cace354..486c163d89 100644 --- a/contrib/libs/openssl/apps/engine.c +++ b/contrib/libs/openssl/apps/engine.c @@ -1,5 +1,5 @@ /* - * Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -8,15 +8,15 @@ */ #include <openssl/opensslconf.h> -#include "apps.h" -#include "progs.h" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <openssl/err.h> -#include <openssl/engine.h> -#include <openssl/ssl.h> -#include <openssl/store.h> +#include "apps.h" +#include "progs.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <openssl/err.h> +#include <openssl/engine.h> +#include <openssl/ssl.h> +#include <openssl/store.h> typedef enum OPTION_choice { OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, diff --git a/contrib/libs/openssl/apps/gendsa.c b/contrib/libs/openssl/apps/gendsa.c index ec57c92a94..e81be66d91 100644 --- a/contrib/libs/openssl/apps/gendsa.c +++ b/contrib/libs/openssl/apps/gendsa.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2020 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 * this file except in compliance with the License. You can obtain a copy @@ -8,18 +8,18 @@ */ #include <openssl/opensslconf.h> -#include <stdio.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include "apps.h" -#include "progs.h" -#include <openssl/bio.h> -#include <openssl/err.h> -#include <openssl/bn.h> -#include <openssl/dsa.h> -#include <openssl/x509.h> -#include <openssl/pem.h> +#include <stdio.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include "apps.h" +#include "progs.h" +#include <openssl/bio.h> +#include <openssl/err.h> +#include <openssl/bn.h> +#include <openssl/dsa.h> +#include <openssl/x509.h> +#include <openssl/pem.h> typedef enum OPTION_choice { OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, @@ -35,9 +35,9 @@ const OPTIONS gendsa_options[] = { {"passout", OPT_PASSOUT, 's', "Output file pass phrase source"}, OPT_R_OPTIONS, {"", 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"}, -#endif +#endif {NULL} }; diff --git a/contrib/libs/openssl/apps/genrsa.c b/contrib/libs/openssl/apps/genrsa.c index e34a2f7ab9..d74f4e3360 100644 --- a/contrib/libs/openssl/apps/genrsa.c +++ b/contrib/libs/openssl/apps/genrsa.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2020 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 * this file except in compliance with the License. You can obtain a copy @@ -8,23 +8,23 @@ */ #include <openssl/opensslconf.h> -#include <stdio.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include "apps.h" -#include "progs.h" -#include <openssl/bio.h> -#include <openssl/err.h> -#include <openssl/bn.h> -#include <openssl/rsa.h> -#include <openssl/evp.h> -#include <openssl/x509.h> -#include <openssl/pem.h> -#include <openssl/rand.h> - -#define DEFBITS 2048 -#define DEFPRIMES 2 +#include <stdio.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include "apps.h" +#include "progs.h" +#include <openssl/bio.h> +#include <openssl/err.h> +#include <openssl/bn.h> +#include <openssl/rsa.h> +#include <openssl/evp.h> +#include <openssl/x509.h> +#include <openssl/pem.h> +#include <openssl/rand.h> + +#define DEFBITS 2048 +#define DEFPRIMES 2 static int genrsa_cb(int p, int n, BN_GENCB *cb); @@ -44,9 +44,9 @@ const OPTIONS genrsa_options[] = { OPT_R_OPTIONS, {"passout", OPT_PASSOUT, 's', "Output file pass phrase source"}, {"", 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"}, -#endif +#endif {"primes", OPT_PRIMES, 'p', "Specify number of primes"}, {NULL} }; diff --git a/contrib/libs/openssl/apps/ocsp.c b/contrib/libs/openssl/apps/ocsp.c index 27ec94fa6b..6a48c60f9b 100644 --- a/contrib/libs/openssl/apps/ocsp.c +++ b/contrib/libs/openssl/apps/ocsp.c @@ -1,5 +1,5 @@ /* - * Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -9,62 +9,62 @@ #include <openssl/opensslconf.h> -#ifdef OPENSSL_SYS_VMS -# define _XOPEN_SOURCE_EXTENDED/* So fd_set and friends get properly defined +#ifdef OPENSSL_SYS_VMS +# define _XOPEN_SOURCE_EXTENDED/* So fd_set and friends get properly defined * on OpenVMS */ -#endif +#endif -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> -#include <ctype.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <ctype.h> /* Needs to be included before the openssl headers */ -#include "apps.h" -#include "progs.h" -#include "internal/sockets.h" -#include <openssl/e_os2.h> -#include <openssl/crypto.h> -#include <openssl/err.h> -#include <openssl/ssl.h> -#include <openssl/evp.h> -#include <openssl/bn.h> -#include <openssl/x509v3.h> -#include <openssl/rand.h> +#include "apps.h" +#include "progs.h" +#include "internal/sockets.h" +#include <openssl/e_os2.h> +#include <openssl/crypto.h> +#include <openssl/err.h> +#include <openssl/ssl.h> +#include <openssl/evp.h> +#include <openssl/bn.h> +#include <openssl/x509v3.h> +#include <openssl/rand.h> #ifndef HAVE_FORK -#if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) -# define HAVE_FORK 0 -#else -# define HAVE_FORK 1 -#endif +#if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) +# define HAVE_FORK 0 +#else +# define HAVE_FORK 1 #endif +#endif #if HAVE_FORK -#undef NO_FORK +#undef NO_FORK #else -#define NO_FORK +#define NO_FORK #endif -#if !defined(NO_FORK) && !defined(OPENSSL_NO_SOCK) \ +#if !defined(NO_FORK) && !defined(OPENSSL_NO_SOCK) \ && !defined(OPENSSL_NO_POSIX_IO) -# define OCSP_DAEMON -# include <sys/types.h> -# include <sys/wait.h> -# include <syslog.h> -# include <signal.h> -# define MAXERRLEN 1000 /* limit error text sent to syslog to 1000 bytes */ -#else -# undef LOG_INFO -# undef LOG_WARNING -# undef LOG_ERR -# define LOG_INFO 0 -# define LOG_WARNING 1 -# define LOG_ERR 2 -#endif - -#if defined(OPENSSL_SYS_VXWORKS) +# define OCSP_DAEMON +# include <sys/types.h> +# include <sys/wait.h> +# include <syslog.h> +# include <signal.h> +# define MAXERRLEN 1000 /* limit error text sent to syslog to 1000 bytes */ +#else +# undef LOG_INFO +# undef LOG_WARNING +# undef LOG_ERR +# define LOG_INFO 0 +# define LOG_WARNING 1 +# define LOG_ERR 2 +#endif + +#if defined(OPENSSL_SYS_VXWORKS) /* not supported */ int setpgid(pid_t pid, pid_t pgid) { @@ -77,9 +77,9 @@ pid_t fork(void) errno = ENOSYS; return (pid_t) -1; } -#endif +#endif /* Maximum leeway in validity period: default 5 minutes */ -#define MAX_VALIDITY_PERIOD (5 * 60) +#define MAX_VALIDITY_PERIOD (5 * 60) static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, const EVP_MD *cert_id_md, X509 *issuer, @@ -106,20 +106,20 @@ static void log_message(int level, const char *fmt, ...); static char *prog; static int multi = 0; -#ifdef OCSP_DAEMON +#ifdef OCSP_DAEMON static int acfd = (int) INVALID_SOCKET; static int index_changed(CA_DB *); static void spawn_loop(void); static int print_syslog(const char *str, size_t len, void *levPtr); -static void socket_timeout(int signum); -#endif +static void socket_timeout(int signum); +#endif -#ifndef OPENSSL_NO_SOCK +#ifndef OPENSSL_NO_SOCK static OCSP_RESPONSE *query_responder(BIO *cbio, const char *host, const char *path, const STACK_OF(CONF_VALUE) *headers, OCSP_REQUEST *req, int req_timeout); -#endif +#endif typedef enum OPTION_choice { OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, @@ -157,9 +157,9 @@ const OPTIONS ocsp_options[] = { "Don't include any certificates in response"}, {"resp_key_id", OPT_RESP_KEY_ID, '-', "Identify response by signing certificate key ID"}, -#ifdef OCSP_DAEMON +#ifdef OCSP_DAEMON {"multi", OPT_MULTI, 'p', "run multiple responder processes"}, -#endif +#endif {"no_certs", OPT_NO_CERTS, '-', "Don't include any certificates in signed request"}, {"no_signature_verify", OPT_NO_SIGNATURE_VERIFY, '-', @@ -508,9 +508,9 @@ int ocsp_main(int argc, char **argv) trailing_md = 1; break; case OPT_MULTI: -#ifdef OCSP_DAEMON +#ifdef OCSP_DAEMON multi = atoi(opt_arg()); -#endif +#endif break; } } @@ -590,11 +590,11 @@ int ocsp_main(int argc, char **argv) } } -#ifdef OCSP_DAEMON +#ifdef OCSP_DAEMON if (multi && acbio != NULL) spawn_loop(); if (acbio != NULL && req_timeout > 0) - signal(SIGALRM, socket_timeout); + signal(SIGALRM, socket_timeout); #endif if (acbio != NULL) @@ -603,7 +603,7 @@ int ocsp_main(int argc, char **argv) redo_accept: if (acbio != NULL) { -#ifdef OCSP_DAEMON +#ifdef OCSP_DAEMON if (index_changed(rdb)) { CA_DB *newrdb = load_index(ridx_filename, NULL); @@ -616,7 +616,7 @@ redo_accept: ridx_filename); } } -#endif +#endif req = NULL; if (!do_responder(&req, &cbio, acbio, req_timeout)) @@ -685,16 +685,16 @@ redo_accept: if (cbio != NULL) send_ocsp_response(cbio, resp); } else if (host != NULL) { -#ifndef OPENSSL_NO_SOCK +#ifndef OPENSSL_NO_SOCK resp = process_responder(req, host, path, port, use_ssl, headers, req_timeout); if (resp == NULL) goto end; -#else +#else BIO_printf(bio_err, "Error creating connect BIO - sockets not supported.\n"); goto end; -#endif +#endif } else if (respin != NULL) { derbio = bio_open_default(respin, 'r', FORMAT_ASN1); if (derbio == NULL) @@ -837,7 +837,7 @@ log_message(int level, const char *fmt, ...) va_list ap; va_start(ap, fmt); -#ifdef OCSP_DAEMON +#ifdef OCSP_DAEMON if (multi) { char buf[1024]; if (vsnprintf(buf, sizeof(buf), fmt, ap) > 0) { @@ -846,7 +846,7 @@ log_message(int level, const char *fmt, ...) if (level >= LOG_ERR) ERR_print_errors_cb(print_syslog, &level); } -#endif +#endif if (!multi) { BIO_printf(bio_err, "%s: ", prog); BIO_vprintf(bio_err, fmt, ap); @@ -855,7 +855,7 @@ log_message(int level, const char *fmt, ...) va_end(ap); } -#ifdef OCSP_DAEMON +#ifdef OCSP_DAEMON static int print_syslog(const char *str, size_t len, void *levPtr) { @@ -1008,7 +1008,7 @@ static void spawn_loop(void) syslog(LOG_INFO, "terminating on signal: %d", termsig); killall(0, kidpids); } -#endif +#endif static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, const EVP_MD *cert_id_md, X509 *issuer, @@ -1288,11 +1288,11 @@ static char **lookup_serial(CA_DB *db, ASN1_INTEGER *ser) static BIO *init_responder(const char *port) { -#ifdef OPENSSL_NO_SOCK +#ifdef OPENSSL_NO_SOCK BIO_printf(bio_err, "Error setting up accept BIO - sockets not supported.\n"); return NULL; -#else +#else BIO *acbio = NULL, *bufbio = NULL; bufbio = BIO_new(BIO_f_buffer()); @@ -1319,10 +1319,10 @@ static BIO *init_responder(const char *port) BIO_free_all(acbio); BIO_free(bufbio); return NULL; -#endif +#endif } -#ifndef OPENSSL_NO_SOCK +#ifndef OPENSSL_NO_SOCK /* * Decode %xx URL-decoding in-place. Ignores mal-formed sequences. */ @@ -1346,22 +1346,22 @@ static int urldecode(char *p) *out = '\0'; return (int)(out - save); } -#endif +#endif -#ifdef OCSP_DAEMON -static void socket_timeout(int signum) +#ifdef OCSP_DAEMON +static void socket_timeout(int signum) { if (acfd != (int)INVALID_SOCKET) (void)shutdown(acfd, SHUT_RD); } -#endif +#endif static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio, int timeout) { -#ifdef OPENSSL_NO_SOCK +#ifdef OPENSSL_NO_SOCK return 0; -#else +#else int len; OCSP_REQUEST *req = NULL; char inbuf[2048], reqbuf[2048]; @@ -1379,12 +1379,12 @@ static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio, *pcbio = cbio; client = BIO_get_peer_name(cbio); -# ifdef OCSP_DAEMON +# ifdef OCSP_DAEMON if (timeout > 0) { (void) BIO_get_fd(cbio, &acfd); alarm(timeout); } -# endif +# endif /* Read the request line. */ len = BIO_gets(cbio, reqbuf, sizeof(reqbuf)); @@ -1447,11 +1447,11 @@ static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio, break; } -# ifdef OCSP_DAEMON +# ifdef OCSP_DAEMON /* Clear alarm before we close the client socket */ alarm(0); timeout = 0; -# endif +# endif /* Try to read OCSP request */ if (getbio != NULL) { @@ -1467,13 +1467,13 @@ static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio, *preq = req; out: -# ifdef OCSP_DAEMON +# ifdef OCSP_DAEMON if (timeout > 0) alarm(0); acfd = (int)INVALID_SOCKET; -# endif +# endif return 1; -#endif +#endif } static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp) @@ -1489,7 +1489,7 @@ static int send_ocsp_response(BIO *cbio, OCSP_RESPONSE *resp) return 1; } -#ifndef OPENSSL_NO_SOCK +#ifndef OPENSSL_NO_SOCK static OCSP_RESPONSE *query_responder(BIO *cbio, const char *host, const char *path, const STACK_OF(CONF_VALUE) *headers, diff --git a/contrib/libs/openssl/apps/openssl.c b/contrib/libs/openssl/apps/openssl.c index ff7b759a40..b04985c356 100644 --- a/contrib/libs/openssl/apps/openssl.c +++ b/contrib/libs/openssl/apps/openssl.c @@ -164,13 +164,13 @@ int main(int argc, char *argv[]) } prog = prog_init(); - if (prog == NULL) { - BIO_printf(bio_err, - "FATAL: Startup failure (dev note: prog_init() failed)\n"); - ERR_print_errors(bio_err); - ret = 1; - goto end; - } + if (prog == NULL) { + BIO_printf(bio_err, + "FATAL: Startup failure (dev note: prog_init() failed)\n"); + ERR_print_errors(bio_err); + ret = 1; + goto end; + } pname = opt_progname(argv[0]); /* first check the program name */ diff --git a/contrib/libs/openssl/apps/passwd.c b/contrib/libs/openssl/apps/passwd.c index d741d05335..7fe4f60822 100644 --- a/contrib/libs/openssl/apps/passwd.c +++ b/contrib/libs/openssl/apps/passwd.c @@ -807,7 +807,7 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p, (*salt_p)[i] = cov_2char[(*salt_p)[i] & 0x3f]; /* 6 bits */ (*salt_p)[i] = 0; # ifdef CHARSET_EBCDIC - /* The password encryption function will convert back to ASCII */ + /* The password encryption function will convert back to ASCII */ ascii2ebcdic(*salt_p, *salt_p, saltlen); # endif } diff --git a/contrib/libs/openssl/apps/pkcs12.c b/contrib/libs/openssl/apps/pkcs12.c index 8c5d963b8c..875b5152dc 100644 --- a/contrib/libs/openssl/apps/pkcs12.c +++ b/contrib/libs/openssl/apps/pkcs12.c @@ -1,5 +1,5 @@ /* - * Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -8,21 +8,21 @@ */ #include <openssl/opensslconf.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "apps.h" -#include "progs.h" -#include <openssl/crypto.h> -#include <openssl/err.h> -#include <openssl/pem.h> -#include <openssl/pkcs12.h> - -#define NOKEYS 0x1 -#define NOCERTS 0x2 -#define INFO 0x4 -#define CLCERTS 0x8 -#define CACERTS 0x10 +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "apps.h" +#include "progs.h" +#include <openssl/crypto.h> +#include <openssl/err.h> +#include <openssl/pem.h> +#include <openssl/pkcs12.h> + +#define NOKEYS 0x1 +#define NOCERTS 0x2 +#define INFO 0x4 +#define CLCERTS 0x8 +#define CACERTS 0x10 #define PASSWD_BUF_SIZE 2048 @@ -37,7 +37,7 @@ int dump_certs_pkeys_bags(BIO *out, const STACK_OF(PKCS12_SAFEBAG) *bags, int dump_certs_pkeys_bag(BIO *out, const PKCS12_SAFEBAG *bags, const char *pass, int passlen, int options, char *pempass, const EVP_CIPHER *enc); -void print_attribute(BIO *out, const ASN1_TYPE *av); +void print_attribute(BIO *out, const ASN1_TYPE *av); int print_attribs(BIO *out, const STACK_OF(X509_ATTRIBUTE) *attrlst, const char *name); void hex_prin(BIO *out, unsigned char *buf, int len); @@ -70,15 +70,15 @@ const OPTIONS pkcs12_options[] = { {"chain", OPT_CHAIN, '-', "Add certificate chain"}, {"twopass", OPT_TWOPASS, '-', "Separate MAC, encryption passwords"}, {"nomacver", OPT_NOMACVER, '-', "Don't verify MAC"}, -#ifndef OPENSSL_NO_RC2 +#ifndef OPENSSL_NO_RC2 {"descert", OPT_DESCERT, '-', "Encrypt output with 3DES (default RC2-40)"}, {"certpbe", OPT_CERTPBE, 's', "Certificate PBE algorithm (default RC2-40)"}, -#else +#else {"descert", OPT_DESCERT, '-', "Encrypt output with 3DES (the default)"}, {"certpbe", OPT_CERTPBE, 's', "Certificate PBE algorithm (default 3DES)"}, -#endif +#endif {"export", OPT_EXPORT, '-', "Output PKCS12 file"}, {"noiter", OPT_NOITER, '-', "Don't use encryption iteration"}, {"maciter", OPT_MACITER, '-', "Use MAC iteration"}, @@ -109,9 +109,9 @@ const OPTIONS pkcs12_options[] = { {"no-CApath", OPT_NOCAPATH, '-', "Do not load certificates from the default certificates directory"}, {"", OPT_CIPHER, '-', "Any supported cipher"}, -#ifndef OPENSSL_NO_ENGINE +#ifndef OPENSSL_NO_ENGINE {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"}, -#endif +#endif {NULL} }; @@ -122,11 +122,11 @@ int pkcs12_main(int argc, char **argv) char pass[PASSWD_BUF_SIZE] = "", macpass[PASSWD_BUF_SIZE] = ""; int export_cert = 0, options = 0, chain = 0, twopass = 0, keytype = 0; int iter = PKCS12_DEFAULT_ITER, maciter = PKCS12_DEFAULT_ITER; -#ifndef OPENSSL_NO_RC2 +#ifndef OPENSSL_NO_RC2 int cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC; -#else +#else int cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; -#endif +#endif int key_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; int ret = 1, macver = 1, add_lmk = 0, private = 0; int noprompt = 0; @@ -875,38 +875,38 @@ int cert_load(BIO *in, STACK_OF(X509) *sk) return ret; } -/* Generalised x509 attribute value print */ - -void print_attribute(BIO *out, const ASN1_TYPE *av) -{ - char *value; - - switch (av->type) { - case V_ASN1_BMPSTRING: - value = OPENSSL_uni2asc(av->value.bmpstring->data, - av->value.bmpstring->length); - BIO_printf(out, "%s\n", value); - OPENSSL_free(value); - break; - - case V_ASN1_OCTET_STRING: - hex_prin(out, av->value.octet_string->data, - av->value.octet_string->length); - BIO_printf(out, "\n"); - break; - - case V_ASN1_BIT_STRING: - hex_prin(out, av->value.bit_string->data, - av->value.bit_string->length); - BIO_printf(out, "\n"); - break; - - default: - BIO_printf(out, "<Unsupported tag %d>\n", av->type); - break; - } -} - +/* Generalised x509 attribute value print */ + +void print_attribute(BIO *out, const ASN1_TYPE *av) +{ + char *value; + + switch (av->type) { + case V_ASN1_BMPSTRING: + value = OPENSSL_uni2asc(av->value.bmpstring->data, + av->value.bmpstring->length); + BIO_printf(out, "%s\n", value); + OPENSSL_free(value); + break; + + case V_ASN1_OCTET_STRING: + hex_prin(out, av->value.octet_string->data, + av->value.octet_string->length); + BIO_printf(out, "\n"); + break; + + case V_ASN1_BIT_STRING: + hex_prin(out, av->value.bit_string->data, + av->value.bit_string->length); + BIO_printf(out, "\n"); + break; + + default: + BIO_printf(out, "<Unsupported tag %d>\n", av->type); + break; + } +} + /* Generalised attribute print: handle PKCS#8 and bag attributes */ int print_attribs(BIO *out, const STACK_OF(X509_ATTRIBUTE) *attrlst, @@ -914,7 +914,7 @@ int print_attribs(BIO *out, const STACK_OF(X509_ATTRIBUTE) *attrlst, { X509_ATTRIBUTE *attr; ASN1_TYPE *av; - int i, j, attr_nid; + int i, j, attr_nid; if (!attrlst) { BIO_printf(out, "%s: <No Attributes>\n", name); return 1; @@ -938,10 +938,10 @@ int print_attribs(BIO *out, const STACK_OF(X509_ATTRIBUTE) *attrlst, } if (X509_ATTRIBUTE_count(attr)) { - for (j = 0; j < X509_ATTRIBUTE_count(attr); j++) - { - av = X509_ATTRIBUTE_get0_type(attr, j); - print_attribute(out, av); + for (j = 0; j < X509_ATTRIBUTE_count(attr); j++) + { + av = X509_ATTRIBUTE_get0_type(attr, j); + print_attribute(out, av); } } else { BIO_printf(out, "<No Values>\n"); diff --git a/contrib/libs/openssl/apps/pkeyutl.c b/contrib/libs/openssl/apps/pkeyutl.c index 831e14dab4..a055a92503 100644 --- a/contrib/libs/openssl/apps/pkeyutl.c +++ b/contrib/libs/openssl/apps/pkeyutl.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -299,7 +299,7 @@ int pkeyutl_main(int argc, char **argv) /* Sanity check the input */ if (buf_inlen > EVP_MAX_MD_SIZE && (pkey_op == EVP_PKEY_OP_SIGN - || pkey_op == EVP_PKEY_OP_VERIFY)) { + || pkey_op == EVP_PKEY_OP_VERIFY)) { BIO_printf(bio_err, "Error: The input data looks too long to be a hash\n"); goto end; diff --git a/contrib/libs/openssl/apps/rehash.c b/contrib/libs/openssl/apps/rehash.c index fc1dffe974..fd53baf4f0 100644 --- a/contrib/libs/openssl/apps/rehash.c +++ b/contrib/libs/openssl/apps/rehash.c @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved. * Copyright (c) 2013-2014 Timo Teräs <timo.teras@gmail.com> * * Licensed under the OpenSSL license (the "License"). You may not use @@ -274,19 +274,19 @@ static int do_file(const char *filename, const char *fullpath, enum Hash h) if (x->x509 != NULL) { type = TYPE_CERT; name = X509_get_subject_name(x->x509); - if (!X509_digest(x->x509, evpmd, digest, NULL)) { - BIO_printf(bio_err, "out of memory\n"); - ++errs; - goto end; - } + if (!X509_digest(x->x509, evpmd, digest, NULL)) { + BIO_printf(bio_err, "out of memory\n"); + ++errs; + goto end; + } } else if (x->crl != NULL) { type = TYPE_CRL; name = X509_CRL_get_issuer(x->crl); - if (!X509_CRL_digest(x->crl, evpmd, digest, NULL)) { - BIO_printf(bio_err, "out of memory\n"); - ++errs; - goto end; - } + if (!X509_CRL_digest(x->crl, evpmd, digest, NULL)) { + BIO_printf(bio_err, "out of memory\n"); + ++errs; + goto end; + } } else { ++errs; goto end; diff --git a/contrib/libs/openssl/apps/req.c b/contrib/libs/openssl/apps/req.c index a603907cd5..61fc72e311 100644 --- a/contrib/libs/openssl/apps/req.c +++ b/contrib/libs/openssl/apps/req.c @@ -200,12 +200,12 @@ static int duplicated(LHASH_OF(OPENSSL_STRING) *addexts, char *kv) *p = '\0'; /* Finally have a clean "key"; see if it's there [by attempt to add it]. */ - p = (char *)lh_OPENSSL_STRING_insert(addexts, (OPENSSL_STRING*)kv); - if (p != NULL) { - OPENSSL_free(p); - return 1; - } else if (lh_OPENSSL_STRING_error(addexts)) { - OPENSSL_free(kv); + p = (char *)lh_OPENSSL_STRING_insert(addexts, (OPENSSL_STRING*)kv); + if (p != NULL) { + OPENSSL_free(p); + return 1; + } else if (lh_OPENSSL_STRING_error(addexts)) { + OPENSSL_free(kv); return -1; } @@ -438,14 +438,14 @@ int req_main(int argc, char **argv) if (verbose) BIO_printf(bio_err, "Using configuration from %s\n", template); - if ((req_conf = app_load_config(template)) == NULL) - goto end; + if ((req_conf = app_load_config(template)) == NULL) + goto end; if (addext_bio) { if (verbose) BIO_printf(bio_err, "Using additional configuration from command line\n"); - if ((addext_conf = app_load_config_bio(addext_bio, NULL)) == NULL) - goto end; + if ((addext_conf = app_load_config_bio(addext_bio, NULL)) == NULL) + goto end; } if (template != default_config_file && !app_load_modules(req_conf)) goto end; diff --git a/contrib/libs/openssl/apps/rsa.c b/contrib/libs/openssl/apps/rsa.c index aeda917cc7..7cde90b750 100644 --- a/contrib/libs/openssl/apps/rsa.c +++ b/contrib/libs/openssl/apps/rsa.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2020 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 * this file except in compliance with the License. You can obtain a copy @@ -8,19 +8,19 @@ */ #include <openssl/opensslconf.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> -#include "apps.h" -#include "progs.h" -#include <openssl/bio.h> -#include <openssl/err.h> -#include <openssl/rsa.h> -#include <openssl/evp.h> -#include <openssl/x509.h> -#include <openssl/pem.h> -#include <openssl/bn.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include "apps.h" +#include "progs.h" +#include <openssl/bio.h> +#include <openssl/err.h> +#include <openssl/rsa.h> +#include <openssl/evp.h> +#include <openssl/x509.h> +#include <openssl/pem.h> +#include <openssl/bn.h> typedef enum OPTION_choice { OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, @@ -49,14 +49,14 @@ const OPTIONS rsa_options[] = { {"modulus", OPT_MODULUS, '-', "Print the RSA key modulus"}, {"check", OPT_CHECK, '-', "Verify key consistency"}, {"", OPT_CIPHER, '-', "Any supported cipher"}, -#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_RC4) +#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_RC4) {"pvk-strong", OPT_PVK_STRONG, '-', "Enable 'Strong' PVK encoding level (default)"}, {"pvk-weak", OPT_PVK_WEAK, '-', "Enable 'Weak' PVK encoding level"}, {"pvk-none", OPT_PVK_NONE, '-', "Don't enforce PVK encoding"}, -#endif -#ifndef OPENSSL_NO_ENGINE +#endif +#ifndef OPENSSL_NO_ENGINE {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"}, -#endif +#endif {NULL} }; @@ -71,9 +71,9 @@ int rsa_main(int argc, char **argv) int i, private = 0; int informat = FORMAT_PEM, outformat = FORMAT_PEM, text = 0, check = 0; int noout = 0, modulus = 0, pubin = 0, pubout = 0, ret = 1; -#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_RC4) +#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_RC4) int pvk_encr = 2; -#endif +#endif OPTION_CHOICE o; prog = opt_init(argc, argv, rsa_options); @@ -126,9 +126,9 @@ int rsa_main(int argc, char **argv) case OPT_PVK_STRONG: /* pvk_encr:= 2 */ case OPT_PVK_WEAK: /* pvk_encr:= 1 */ case OPT_PVK_NONE: /* pvk_encr:= 0 */ -#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_RC4) +#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_RC4) pvk_encr = (o - OPT_PVK_NONE); -#endif +#endif break; case OPT_NOOUT: noout = 1; @@ -261,7 +261,7 @@ int rsa_main(int argc, char **argv) i = PEM_write_bio_RSAPrivateKey(out, rsa, enc, NULL, 0, NULL, passout); } -#ifndef OPENSSL_NO_DSA +#ifndef OPENSSL_NO_DSA } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) { EVP_PKEY *pk; pk = EVP_PKEY_new(); @@ -276,13 +276,13 @@ int rsa_main(int argc, char **argv) goto end; } assert(private); -# ifdef OPENSSL_NO_RC4 +# ifdef OPENSSL_NO_RC4 BIO_printf(bio_err, "PVK format not supported\n"); EVP_PKEY_free(pk); goto end; -# else +# else i = i2b_PVK_bio(out, pk, pvk_encr, 0, passout); -# endif +# endif } else if (pubin || pubout) { i = i2b_PublicKey_bio(out, pk); } else { @@ -290,7 +290,7 @@ int rsa_main(int argc, char **argv) i = i2b_PrivateKey_bio(out, pk); } EVP_PKEY_free(pk); -#endif +#endif } else { BIO_printf(bio_err, "bad output format specified for outfile\n"); goto end; diff --git a/contrib/libs/openssl/apps/rsautl.c b/contrib/libs/openssl/apps/rsautl.c index 0c0fa8eba3..5686e0170f 100644 --- a/contrib/libs/openssl/apps/rsautl.c +++ b/contrib/libs/openssl/apps/rsautl.c @@ -1,5 +1,5 @@ /* - * Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -8,21 +8,21 @@ */ #include <openssl/opensslconf.h> -#include "apps.h" -#include "progs.h" -#include <string.h> -#include <openssl/err.h> -#include <openssl/pem.h> -#include <openssl/rsa.h> +#include "apps.h" +#include "progs.h" +#include <string.h> +#include <openssl/err.h> +#include <openssl/pem.h> +#include <openssl/rsa.h> -#define RSA_SIGN 1 -#define RSA_VERIFY 2 -#define RSA_ENCRYPT 3 -#define RSA_DECRYPT 4 +#define RSA_SIGN 1 +#define RSA_VERIFY 2 +#define RSA_ENCRYPT 3 +#define RSA_DECRYPT 4 -#define KEY_PRIVKEY 1 -#define KEY_PUBKEY 2 -#define KEY_CERT 3 +#define KEY_PRIVKEY 1 +#define KEY_PUBKEY 2 +#define KEY_CERT 3 typedef enum OPTION_choice { OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, @@ -56,9 +56,9 @@ const OPTIONS rsautl_options[] = { {"decrypt", OPT_DECRYPT, '-', "Decrypt with private key"}, {"passin", OPT_PASSIN, 's', "Input file pass phrase source"}, OPT_R_OPTIONS, -#ifndef OPENSSL_NO_ENGINE +#ifndef OPENSSL_NO_ENGINE {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"}, -#endif +#endif {NULL} }; diff --git a/contrib/libs/openssl/apps/s_cb.c b/contrib/libs/openssl/apps/s_cb.c index dee1b2e5b4..fef2b25ace 100644 --- a/contrib/libs/openssl/apps/s_cb.c +++ b/contrib/libs/openssl/apps/s_cb.c @@ -188,7 +188,7 @@ static STRINT_PAIR cert_type_list[] = { {"RSA fixed ECDH", TLS_CT_RSA_FIXED_ECDH}, {"ECDSA fixed ECDH", TLS_CT_ECDSA_FIXED_ECDH}, {"GOST01 Sign", TLS_CT_GOST01_SIGN}, - {"GOST12 Sign", TLS_CT_GOST12_SIGN}, + {"GOST12 Sign", TLS_CT_GOST12_SIGN}, {NULL} }; diff --git a/contrib/libs/openssl/apps/s_server.c b/contrib/libs/openssl/apps/s_server.c index 938e244222..e372e32e02 100644 --- a/contrib/libs/openssl/apps/s_server.c +++ b/contrib/libs/openssl/apps/s_server.c @@ -1915,7 +1915,7 @@ int s_server_main(int argc, char *argv[]) BIO_printf(bio_s_out, "Setting secondary ctx parameters\n"); if (sdebug) - ssl_ctx_security_debug(ctx2, sdebug); + ssl_ctx_security_debug(ctx2, sdebug); if (session_id_prefix) { if (strlen(session_id_prefix) >= 32) @@ -3216,12 +3216,12 @@ static int www_body(int s, int stype, int prot, unsigned char *context) if (e[0] == ' ') break; - if (e[0] == ':') { - /* Windows drive. We treat this the same way as ".." */ - dot = -1; - break; - } - + if (e[0] == ':') { + /* Windows drive. We treat this the same way as ".." */ + dot = -1; + break; + } + switch (dot) { case 1: dot = (e[0] == '.') ? 2 : 0; @@ -3230,11 +3230,11 @@ static int www_body(int s, int stype, int prot, unsigned char *context) dot = (e[0] == '.') ? 3 : 0; break; case 3: - dot = (e[0] == '/' || e[0] == '\\') ? -1 : 0; + dot = (e[0] == '/' || e[0] == '\\') ? -1 : 0; break; } if (dot == 0) - dot = (e[0] == '/' || e[0] == '\\') ? 1 : 0; + dot = (e[0] == '/' || e[0] == '\\') ? 1 : 0; } dot = (dot == 3) || (dot == -1); /* filename contains ".." * component */ @@ -3248,11 +3248,11 @@ static int www_body(int s, int stype, int prot, unsigned char *context) if (dot) { BIO_puts(io, text); - BIO_printf(io, "'%s' contains '..' or ':'\r\n", p); + BIO_printf(io, "'%s' contains '..' or ':'\r\n", p); break; } - if (*p == '/' || *p == '\\') { + if (*p == '/' || *p == '\\') { BIO_puts(io, text); BIO_printf(io, "'%s' is an invalid path\r\n", p); break; diff --git a/contrib/libs/openssl/apps/s_time.c b/contrib/libs/openssl/apps/s_time.c index 1235e545c2..1935725c2f 100644 --- a/contrib/libs/openssl/apps/s_time.c +++ b/contrib/libs/openssl/apps/s_time.c @@ -62,7 +62,7 @@ const OPTIONS s_time_options[] = { {"key", OPT_KEY, '<', "File with key, PEM; default is -cert file"}, {"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"}, + {"CAfile", OPT_CAFILE, '<', "PEM format file of CA's"}, {"no-CAfile", OPT_NOCAFILE, '-', "Do not load the default certificates file"}, {"no-CApath", OPT_NOCAPATH, '-', diff --git a/contrib/libs/openssl/apps/speed.c b/contrib/libs/openssl/apps/speed.c index d4ae7ab7bf..0aa380c47b 100644 --- a/contrib/libs/openssl/apps/speed.c +++ b/contrib/libs/openssl/apps/speed.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2020 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 * * Licensed under the OpenSSL license (the "License"). You may not use @@ -2410,7 +2410,7 @@ int speed_main(int argc, char **argv) print_message(names[D_CBC_128_CML], c[D_CBC_128_CML][testnum], lengths[testnum], seconds.sym); Time_F(START); - for (count = 0; COND(c[D_CBC_128_CML][testnum]); count++) + for (count = 0; COND(c[D_CBC_128_CML][testnum]); count++) Camellia_cbc_encrypt(loopargs[0].buf, loopargs[0].buf, (size_t)lengths[testnum], &camellia_ks1, iv, CAMELLIA_ENCRYPT); @@ -2432,7 +2432,7 @@ int speed_main(int argc, char **argv) exit(1); } Time_F(START); - for (count = 0; COND(c[D_CBC_192_CML][testnum]); count++) + for (count = 0; COND(c[D_CBC_192_CML][testnum]); count++) Camellia_cbc_encrypt(loopargs[0].buf, loopargs[0].buf, (size_t)lengths[testnum], &camellia_ks2, iv, CAMELLIA_ENCRYPT); @@ -2450,7 +2450,7 @@ int speed_main(int argc, char **argv) print_message(names[D_CBC_256_CML], c[D_CBC_256_CML][testnum], lengths[testnum], seconds.sym); Time_F(START); - for (count = 0; COND(c[D_CBC_256_CML][testnum]); count++) + for (count = 0; COND(c[D_CBC_256_CML][testnum]); count++) Camellia_cbc_encrypt(loopargs[0].buf, loopargs[0].buf, (size_t)lengths[testnum], &camellia_ks3, iv, CAMELLIA_ENCRYPT); @@ -2470,7 +2470,7 @@ int speed_main(int argc, char **argv) print_message(names[D_CBC_IDEA], c[D_CBC_IDEA][testnum], lengths[testnum], seconds.sym); Time_F(START); - for (count = 0; COND(c[D_CBC_IDEA][testnum]); count++) + for (count = 0; COND(c[D_CBC_IDEA][testnum]); count++) IDEA_cbc_encrypt(loopargs[0].buf, loopargs[0].buf, (size_t)lengths[testnum], &idea_ks, iv, IDEA_ENCRYPT); @@ -2490,7 +2490,7 @@ int speed_main(int argc, char **argv) print_message(names[D_CBC_SEED], c[D_CBC_SEED][testnum], lengths[testnum], seconds.sym); Time_F(START); - for (count = 0; COND(c[D_CBC_SEED][testnum]); count++) + for (count = 0; COND(c[D_CBC_SEED][testnum]); count++) SEED_cbc_encrypt(loopargs[0].buf, loopargs[0].buf, (size_t)lengths[testnum], &seed_ks, iv, 1); d = Time_F(STOP); @@ -2513,7 +2513,7 @@ int speed_main(int argc, char **argv) exit(1); } Time_F(START); - for (count = 0; COND(c[D_CBC_RC2][testnum]); count++) + for (count = 0; COND(c[D_CBC_RC2][testnum]); count++) RC2_cbc_encrypt(loopargs[0].buf, loopargs[0].buf, (size_t)lengths[testnum], &rc2_ks, iv, RC2_ENCRYPT); @@ -2537,7 +2537,7 @@ int speed_main(int argc, char **argv) exit(1); } Time_F(START); - for (count = 0; COND(c[D_CBC_RC5][testnum]); count++) + for (count = 0; COND(c[D_CBC_RC5][testnum]); count++) RC5_32_cbc_encrypt(loopargs[0].buf, loopargs[0].buf, (size_t)lengths[testnum], &rc5_ks, iv, RC5_ENCRYPT); @@ -2557,7 +2557,7 @@ int speed_main(int argc, char **argv) print_message(names[D_CBC_BF], c[D_CBC_BF][testnum], lengths[testnum], seconds.sym); Time_F(START); - for (count = 0; COND(c[D_CBC_BF][testnum]); count++) + for (count = 0; COND(c[D_CBC_BF][testnum]); count++) BF_cbc_encrypt(loopargs[0].buf, loopargs[0].buf, (size_t)lengths[testnum], &bf_ks, iv, BF_ENCRYPT); @@ -2577,7 +2577,7 @@ int speed_main(int argc, char **argv) print_message(names[D_CBC_CAST], c[D_CBC_CAST][testnum], lengths[testnum], seconds.sym); Time_F(START); - for (count = 0; COND(c[D_CBC_CAST][testnum]); count++) + for (count = 0; COND(c[D_CBC_CAST][testnum]); count++) CAST_cbc_encrypt(loopargs[0].buf, loopargs[0].buf, (size_t)lengths[testnum], &cast_ks, iv, CAST_ENCRYPT); @@ -3004,7 +3004,7 @@ int speed_main(int argc, char **argv) pctx = NULL; } if (kctx == NULL || /* keygen ctx is not null */ - EVP_PKEY_keygen_init(kctx) <= 0/* init keygen ctx */ ) { + EVP_PKEY_keygen_init(kctx) <= 0/* init keygen ctx */ ) { ecdh_checks = 0; BIO_printf(bio_err, "ECDH keygen failure.\n"); ERR_print_errors(bio_err); @@ -3012,12 +3012,12 @@ int speed_main(int argc, char **argv) break; } - if (EVP_PKEY_keygen(kctx, &key_A) <= 0 || /* generate secret key A */ - EVP_PKEY_keygen(kctx, &key_B) <= 0 || /* generate secret key B */ + if (EVP_PKEY_keygen(kctx, &key_A) <= 0 || /* generate secret key A */ + EVP_PKEY_keygen(kctx, &key_B) <= 0 || /* generate secret key B */ !(ctx = EVP_PKEY_CTX_new(key_A, NULL)) || /* derivation ctx from skeyA */ - EVP_PKEY_derive_init(ctx) <= 0 || /* init derivation ctx */ - EVP_PKEY_derive_set_peer(ctx, key_B) <= 0 || /* set peer pubkey in ctx */ - EVP_PKEY_derive(ctx, NULL, &outlen) <= 0 || /* determine max length */ + EVP_PKEY_derive_init(ctx) <= 0 || /* init derivation ctx */ + EVP_PKEY_derive_set_peer(ctx, key_B) <= 0 || /* set peer pubkey in ctx */ + EVP_PKEY_derive(ctx, NULL, &outlen) <= 0 || /* determine max length */ outlen == 0 || /* ensure outlen is a valid size */ outlen > MAX_ECDH_SIZE /* avoid buffer overflow */ ) { ecdh_checks = 0; @@ -3104,8 +3104,8 @@ int speed_main(int argc, char **argv) if ((ed_pctx = EVP_PKEY_CTX_new_id(test_ed_curves[testnum].nid, NULL)) == NULL - || EVP_PKEY_keygen_init(ed_pctx) <= 0 - || EVP_PKEY_keygen(ed_pctx, &ed_pkey) <= 0) { + || EVP_PKEY_keygen_init(ed_pctx) <= 0 + || EVP_PKEY_keygen(ed_pctx, &ed_pkey) <= 0) { st = 0; EVP_PKEY_CTX_free(ed_pctx); break; @@ -3393,7 +3393,7 @@ static void print_message(const char *s, long num, int length, int tm) mr ? "+DT:%s:%d:%d\n" : "Doing %s for %ds on %d size blocks: ", s, tm, length); (void)BIO_flush(bio_err); - run = 1; + run = 1; alarm(tm); #else BIO_printf(bio_err, @@ -3411,7 +3411,7 @@ static void pkey_print_message(const char *str, const char *str2, long num, mr ? "+DTP:%d:%s:%s:%d\n" : "Doing %u bits %s %s's for %ds: ", bits, str, str2, tm); (void)BIO_flush(bio_err); - run = 1; + run = 1; alarm(tm); #else BIO_printf(bio_err, @@ -3584,7 +3584,7 @@ static int do_multi(int multi, int size_num) p = buf + 4; k = atoi(sstrsep(&p, sep)); sstrsep(&p, sep); - sstrsep(&p, sep); + sstrsep(&p, sep); d = atof(sstrsep(&p, sep)); eddsa_results[k][0] += d; @@ -3642,7 +3642,7 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher, int lengths_single, for (j = 0; j < num; j++) { print_message(alg_name, 0, mblengths[j], seconds->sym); Time_F(START); - for (count = 0; run && count < 0x7fffffff; count++) { + for (count = 0; run && count < 0x7fffffff; count++) { unsigned char aad[EVP_AEAD_TLS1_AAD_LEN]; EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM mb_param; size_t len = mblengths[j]; diff --git a/contrib/libs/openssl/apps/srp.c b/contrib/libs/openssl/apps/srp.c index 6c58173879..a1ed9ba231 100644 --- a/contrib/libs/openssl/apps/srp.c +++ b/contrib/libs/openssl/apps/srp.c @@ -1,5 +1,5 @@ /* - * Copyright 2004-2020 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. * * Licensed under the OpenSSL license (the "License"). You may not use @@ -12,24 +12,24 @@ */ #include <openssl/opensslconf.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <openssl/conf.h> -#include <openssl/bio.h> -#include <openssl/err.h> -#include <openssl/txt_db.h> -#include <openssl/buffer.h> -#include <openssl/srp.h> -#include "apps.h" -#include "progs.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <openssl/conf.h> +#include <openssl/bio.h> +#include <openssl/err.h> +#include <openssl/txt_db.h> +#include <openssl/buffer.h> +#include <openssl/srp.h> +#include "apps.h" +#include "progs.h" -#define BASE_SECTION "srp" -#define CONFIG_FILE "openssl.cnf" +#define BASE_SECTION "srp" +#define CONFIG_FILE "openssl.cnf" -#define ENV_DATABASE "srpvfile" -#define ENV_DEFAULT_SRP "default_srp" +#define ENV_DATABASE "srpvfile" +#define ENV_DEFAULT_SRP "default_srp" static int get_index(CA_DB *db, char *id, char type) { @@ -208,9 +208,9 @@ const OPTIONS srp_options[] = { {"passin", OPT_PASSIN, 's', "Input file pass phrase source"}, {"passout", OPT_PASSOUT, 's', "Output file pass phrase source"}, OPT_R_OPTIONS, -#ifndef OPENSSL_NO_ENGINE +#ifndef OPENSSL_NO_ENGINE {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"}, -#endif +#endif {NULL} }; diff --git a/contrib/libs/openssl/apps/timeouts.h b/contrib/libs/openssl/apps/timeouts.h index 7e606cba0b..c18f6439ed 100644 --- a/contrib/libs/openssl/apps/timeouts.h +++ b/contrib/libs/openssl/apps/timeouts.h @@ -7,11 +7,11 @@ * https://www.openssl.org/source/license.html */ -#ifndef OSSL_APPS_TIMEOUTS_H -# define OSSL_APPS_TIMEOUTS_H +#ifndef OSSL_APPS_TIMEOUTS_H +# define OSSL_APPS_TIMEOUTS_H /* numbers in us */ # define DGRAM_RCV_TIMEOUT 250000 # define DGRAM_SND_TIMEOUT 250000 -#endif /* ! OSSL_APPS_TIMEOUTS_H */ +#endif /* ! OSSL_APPS_TIMEOUTS_H */ diff --git a/contrib/libs/openssl/apps/ts.c b/contrib/libs/openssl/apps/ts.c index 66a0c810e0..92a5163bb7 100644 --- a/contrib/libs/openssl/apps/ts.c +++ b/contrib/libs/openssl/apps/ts.c @@ -1,5 +1,5 @@ /* - * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -8,26 +8,26 @@ */ #include <openssl/opensslconf.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "apps.h" -#include "progs.h" -#include <openssl/bio.h> -#include <openssl/err.h> -#include <openssl/pem.h> -#include <openssl/rand.h> -#include <openssl/ts.h> -#include <openssl/bn.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "apps.h" +#include "progs.h" +#include <openssl/bio.h> +#include <openssl/err.h> +#include <openssl/pem.h> +#include <openssl/rand.h> +#include <openssl/ts.h> +#include <openssl/bn.h> /* Request nonce length, in bits (must be a multiple of 8). */ -#define NONCE_LENGTH 64 +#define NONCE_LENGTH 64 /* Name of config entry that defines the OID file. */ -#define ENV_OID_FILE "oid_file" +#define ENV_OID_FILE "oid_file" /* Is |EXACTLY_ONE| of three pointers set? */ -#define EXACTLY_ONE(a, b, c) \ +#define EXACTLY_ONE(a, b, c) \ (( a && !b && !c) || \ ( b && !a && !c) || \ ( c && !a && !b)) @@ -111,9 +111,9 @@ const OPTIONS ts_options[] = { {"CAfile", OPT_CAFILE, '<', "File with trusted CA certs"}, {"untrusted", OPT_UNTRUSTED, '<', "File with untrusted certs"}, {"", OPT_MD, '-', "Any supported digest"}, -#ifndef OPENSSL_NO_ENGINE +#ifndef OPENSSL_NO_ENGINE {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"}, -#endif +#endif {OPT_HELP_STR, 1, '-', "\nOptions specific to 'ts -verify': \n"}, OPT_V_OPTIONS, {OPT_HELP_STR, 1, '-', "\n"}, @@ -134,11 +134,11 @@ static char* opt_helplist[] = { " [-signer tsa_cert.pem] [-inkey private_key.pem]", " [-chain certs_file.pem] [-tspolicy oid]", " [-in file] [-token_in] [-out file] [-token_out]", -#ifndef OPENSSL_NO_ENGINE +#ifndef OPENSSL_NO_ENGINE " [-text] [-engine id]", -#else +#else " [-text]", -#endif +#endif " or", "ts -verify -CApath dir -CAfile file.pem -untrusted file.pem", " [-data file] [-digest hexstring]", @@ -279,8 +279,8 @@ int ts_main(int argc, char **argv) goto end; } - if ((conf = load_config_file(configfile)) == NULL) - goto end; + if ((conf = load_config_file(configfile)) == NULL) + goto end; if (configfile != default_config_file && !app_load_modules(conf)) goto end; @@ -679,10 +679,10 @@ static TS_RESP *create_response(CONF *conf, const char *section, const char *eng goto end; if (!TS_CONF_set_serial(conf, section, serial_cb, resp_ctx)) goto end; -#ifndef OPENSSL_NO_ENGINE +#ifndef OPENSSL_NO_ENGINE if (!TS_CONF_set_crypto_device(conf, section, engine)) goto end; -#endif +#endif if (!TS_CONF_set_signer_cert(conf, section, signer, resp_ctx)) goto end; if (!TS_CONF_set_certs(conf, section, chain, resp_ctx)) diff --git a/contrib/libs/openssl/apps/vms_term_sock.c b/contrib/libs/openssl/apps/vms_term_sock.c index 1dc4b155aa..53c7fa747e 100644 --- a/contrib/libs/openssl/apps/vms_term_sock.c +++ b/contrib/libs/openssl/apps/vms_term_sock.c @@ -37,7 +37,7 @@ # include <starlet.h> # include <iodef.h> # ifdef __alpha -# error #include <iosbdef.h> +# error #include <iosbdef.h> # else typedef struct _iosb { /* Copied from IOSBDEF.H for Alpha */ # pragma __nomember_alignment @@ -82,7 +82,7 @@ typedef struct _iosb { /* Copied from IOSBDEF.H for Alpha */ # endif /* End of IOSBDEF */ -# error #include <efndef.h> +# error #include <efndef.h> # include <stdlib.h> # include <ssdef.h> # include <time.h> diff --git a/contrib/libs/openssl/apps/vms_term_sock.h b/contrib/libs/openssl/apps/vms_term_sock.h index e092b18eaa..b5a1a00fcd 100644 --- a/contrib/libs/openssl/apps/vms_term_sock.h +++ b/contrib/libs/openssl/apps/vms_term_sock.h @@ -8,8 +8,8 @@ * https://www.openssl.org/source/license.html */ -#ifndef OSSL_APPS_VMS_TERM_SOCK_H -# define OSSL_APPS_VMS_TERM_SOCK_H +#ifndef OSSL_APPS_VMS_TERM_SOCK_H +# define OSSL_APPS_VMS_TERM_SOCK_H /* ** Terminal Socket Function Codes diff --git a/contrib/libs/openssl/apps/x509.c b/contrib/libs/openssl/apps/x509.c index 1043eba0c8..8cb2edc1e0 100644 --- a/contrib/libs/openssl/apps/x509.c +++ b/contrib/libs/openssl/apps/x509.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2020 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 * this file except in compliance with the License. You can obtain a copy @@ -72,7 +72,7 @@ const OPTIONS x509_options[] = { {"outform", OPT_OUTFORM, 'f', "Output format - default PEM (one of DER or PEM)"}, {"out", OPT_OUT, '>', "Output file - default stdout"}, - {"keyform", OPT_KEYFORM, 'E', "Private key format - default PEM"}, + {"keyform", OPT_KEYFORM, 'E', "Private key format - default PEM"}, {"passin", OPT_PASSIN, 's', "Private key password/pass-phrase source"}, {"serial", OPT_SERIAL, '-', "Print serial number value"}, {"subject_hash", OPT_HASH, '-', "Print subject hash value"}, @@ -107,7 +107,7 @@ const OPTIONS x509_options[] = { {"checkend", OPT_CHECKEND, 'M', "Check whether the cert expires in the next arg seconds"}, {OPT_MORE_STR, 1, 1, "Exit 1 if so, 0 if not"}, - {"signkey", OPT_SIGNKEY, 's', "Self sign cert with arg"}, + {"signkey", OPT_SIGNKEY, 's', "Self sign cert with arg"}, {"x509toreq", OPT_X509TOREQ, '-', "Output a certification request object"}, {"req", OPT_REQ, '-', "Input is a certificate request, sign and output"}, @@ -130,7 +130,7 @@ const OPTIONS x509_options[] = { {"checkemail", OPT_CHECKEMAIL, 's', "Check certificate matches email"}, {"checkip", OPT_CHECKIP, 's', "Check certificate matches ipaddr"}, {"CAform", OPT_CAFORM, 'F', "CA format - default PEM"}, - {"CAkeyform", OPT_CAKEYFORM, 'E', "CA key format - default PEM"}, + {"CAkeyform", OPT_CAKEYFORM, 'E', "CA key format - default PEM"}, {"sigopt", OPT_SIGOPT, 's', "Signature parameter in n:v form"}, {"force_pubkey", OPT_FORCE_PUBKEY, '<', "Force the Key to put inside certificate"}, {"next_serial", OPT_NEXT_SERIAL, '-', "Increment current certificate serial number"}, @@ -217,7 +217,7 @@ int x509_main(int argc, char **argv) goto opthelp; break; case OPT_KEYFORM: - if (!opt_format(opt_arg(), OPT_FMT_PDE, &keyformat)) + if (!opt_format(opt_arg(), OPT_FMT_PDE, &keyformat)) goto opthelp; break; case OPT_CAFORM: @@ -225,7 +225,7 @@ int x509_main(int argc, char **argv) goto opthelp; break; case OPT_CAKEYFORM: - if (!opt_format(opt_arg(), OPT_FMT_PDE, &CAkeyformat)) + if (!opt_format(opt_arg(), OPT_FMT_PDE, &CAkeyformat)) goto opthelp; break; case OPT_OUT: diff --git a/contrib/libs/openssl/apps/ya.make b/contrib/libs/openssl/apps/ya.make index e6b81c6b18..a2c994d2d9 100644 --- a/contrib/libs/openssl/apps/ya.make +++ b/contrib/libs/openssl/apps/ya.make @@ -14,7 +14,7 @@ LICENSE_TEXTS(.yandex_meta/licenses.list.txt) PEERDIR( contrib/libs/openssl - contrib/libs/openssl/crypto + contrib/libs/openssl/crypto ) ADDINCL( @@ -23,23 +23,23 @@ ADDINCL( contrib/libs/openssl/include ) -NO_COMPILER_WARNINGS() - -NO_RUNTIME() - +NO_COMPILER_WARNINGS() + +NO_RUNTIME() + CFLAGS( - -DAESNI_ASM + -DAESNI_ASM -DECP_NISTZ256_ASM -DKECCAK1600_ASM -DOPENSSL_BN_ASM_MONT -DOPENSSL_CPUID_OBJ - -DOPENSSL_PIC + -DOPENSSL_PIC -DPOLY1305_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM - -DZLIB + -DZLIB ) IF (OS_DARWIN AND ARCH_X86_64 OR OS_LINUX AND ARCH_AARCH64 OR OS_LINUX AND ARCH_X86_64) |