aboutsummaryrefslogtreecommitdiffstats
path: root/doc/man3/PKCS12_newpass.pod
diff options
context:
space:
mode:
authorBeat Bolli <dev@drbeat.li>2016-11-19 00:10:05 +0100
committerMatt Caswell <matt@openssl.org>2017-06-08 11:54:15 +0100
commit2947af32a0ec6666efd5b287ac4609ba3a984f0d (patch)
tree7f024902fa2741965c415283a734267fcd083976 /doc/man3/PKCS12_newpass.pod
parent52df25cf2e656146cb3b206d8220124f0417d03f (diff)
downloadopenssl-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/PKCS12_newpass.pod')
-rw-r--r--doc/man3/PKCS12_newpass.pod64
1 files changed, 32 insertions, 32 deletions
diff --git a/doc/man3/PKCS12_newpass.pod b/doc/man3/PKCS12_newpass.pod
index 6b22fd7280..5c8eaf79ac 100644
--- a/doc/man3/PKCS12_newpass.pod
+++ b/doc/man3/PKCS12_newpass.pod
@@ -47,38 +47,38 @@ the result to a new file.
int main(int argc, char **argv)
{
- FILE *fp;
- PKCS12 *p12;
- if (argc != 5) {
- fprintf(stderr, "Usage: pkread p12file password newpass opfile\n");
- return 1;
- }
- if ((fp = fopen(argv[1], "rb")) == NULL) {
- fprintf(stderr, "Error opening file %s\n", argv[1]);
- return 1;
- }
- p12 = d2i_PKCS12_fp(fp, NULL);
- fclose(fp);
- if (p12 == NULL) {
- fprintf(stderr, "Error reading PKCS#12 file\n");
- ERR_print_errors_fp(stderr);
- return 1;
- }
- if (PKCS12_newpass(p12, argv[2], argv[3]) == 0) {
- fprintf(stderr, "Error changing password\n");
- ERR_print_errors_fp(stderr);
- PKCS12_free(p12);
- return 1;
- }
- if ((fp = fopen(argv[4], "wb")) == NULL) {
- fprintf(stderr, "Error opening file %s\n", argv[4]);
- PKCS12_free(p12);
- return 1;
- }
- i2d_PKCS12_fp(fp, p12);
- PKCS12_free(p12);
- fclose(fp);
- return 0;
+ FILE *fp;
+ PKCS12 *p12;
+ if (argc != 5) {
+ fprintf(stderr, "Usage: pkread p12file password newpass opfile\n");
+ return 1;
+ }
+ if ((fp = fopen(argv[1], "rb")) == NULL) {
+ fprintf(stderr, "Error opening file %s\n", argv[1]);
+ return 1;
+ }
+ p12 = d2i_PKCS12_fp(fp, NULL);
+ fclose(fp);
+ if (p12 == NULL) {
+ fprintf(stderr, "Error reading PKCS#12 file\n");
+ ERR_print_errors_fp(stderr);
+ return 1;
+ }
+ if (PKCS12_newpass(p12, argv[2], argv[3]) == 0) {
+ fprintf(stderr, "Error changing password\n");
+ ERR_print_errors_fp(stderr);
+ PKCS12_free(p12);
+ return 1;
+ }
+ if ((fp = fopen(argv[4], "wb")) == NULL) {
+ fprintf(stderr, "Error opening file %s\n", argv[4]);
+ PKCS12_free(p12);
+ return 1;
+ }
+ i2d_PKCS12_fp(fp, p12);
+ PKCS12_free(p12);
+ fclose(fp);
+ return 0;
}