diff options
author | Beat Bolli <dev@drbeat.li> | 2016-11-19 00:10:05 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-06-08 11:54:15 +0100 |
commit | 2947af32a0ec6666efd5b287ac4609ba3a984f0d (patch) | |
tree | 7f024902fa2741965c415283a734267fcd083976 /doc/man3/EVP_PKEY_keygen.pod | |
parent | 52df25cf2e656146cb3b206d8220124f0417d03f (diff) | |
download | openssl-new-2947af32a0ec6666efd5b287ac4609ba3a984f0d.tar.gz |
doc/man3: use the documented coding style in the example code
Adjust brace placement, whitespace after keywords, indentation and empty
lines after variable declarations according to
https://www.openssl.org/policies/codingstyle.html.
Indent literal sections by exactly one space.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1956)
Diffstat (limited to 'doc/man3/EVP_PKEY_keygen.pod')
-rw-r--r-- | doc/man3/EVP_PKEY_keygen.pod | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/doc/man3/EVP_PKEY_keygen.pod b/doc/man3/EVP_PKEY_keygen.pod index ed4a3e1db8..f7c788570a 100644 --- a/doc/man3/EVP_PKEY_keygen.pod +++ b/doc/man3/EVP_PKEY_keygen.pod @@ -100,15 +100,15 @@ Generate a 2048 bit RSA key: EVP_PKEY *pkey = NULL; ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL); if (!ctx) - /* Error occurred */ + /* Error occurred */ if (EVP_PKEY_keygen_init(ctx) <= 0) - /* Error */ + /* Error */ if (EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, 2048) <= 0) - /* Error */ + /* Error */ /* Generate key */ if (EVP_PKEY_keygen(ctx, &pkey) <= 0) - /* Error */ + /* Error */ Generate a key from a set of parameters: @@ -120,13 +120,13 @@ Generate a key from a set of parameters: /* Assumed param is set up already */ ctx = EVP_PKEY_CTX_new(param); if (!ctx) - /* Error occurred */ + /* Error occurred */ if (EVP_PKEY_keygen_init(ctx) <= 0) - /* Error */ + /* Error */ /* Generate key */ if (EVP_PKEY_keygen(ctx, &pkey) <= 0) - /* Error */ + /* Error */ Example of generation callback for OpenSSL public key implementations: @@ -135,19 +135,22 @@ Example of generation callback for OpenSSL public key implementations: EVP_PKEY_CTX_set_app_data(ctx, status_bio); static int genpkey_cb(EVP_PKEY_CTX *ctx) - { - char c = '*'; - BIO *b = EVP_PKEY_CTX_get_app_data(ctx); - int p; - p = EVP_PKEY_CTX_get_keygen_info(ctx, 0); - if (p == 0) c = '.'; - if (p == 1) c = '+'; - if (p == 2) c = '*'; - if (p == 3) c = '\n'; - BIO_write(b, &c, 1); - (void)BIO_flush(b); - return 1; - } + { + char c = '*'; + BIO *b = EVP_PKEY_CTX_get_app_data(ctx); + int p = EVP_PKEY_CTX_get_keygen_info(ctx, 0); + if (p == 0) + c = '.'; + if (p == 1) + c = '+'; + if (p == 2) + c = '*'; + if (p == 3) + c = '\n'; + BIO_write(b, &c, 1); + (void)BIO_flush(b); + return 1; + } =head1 SEE ALSO |