projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Silence Clang warning about unit'd variable
[openssl.git]
/
apps
/
rsa.c
diff --git
a/apps/rsa.c
b/apps/rsa.c
index c8b05e60ce1699e2666a730791b09e6c92cee13a..87cb70254e8047e7695615f8d30909ac771172a0 100644
(file)
--- a/
apps/rsa.c
+++ b/
apps/rsa.c
@@
-254,6
+254,9
@@
int rsa_main(int argc, char **argv)
goto end;
}
goto end;
}
+ if (!app_load_modules(NULL))
+ goto end;
+
if (check && pubin) {
BIO_printf(bio_err, "Only private keys can be checked\n");
goto end;
if (check && pubin) {
BIO_printf(bio_err, "Only private keys can be checked\n");
goto end;
@@
-344,19
+347,14
@@
int rsa_main(int argc, char **argv)
}
# ifndef OPENSSL_NO_RC4
else if (outformat == FORMAT_NETSCAPE) {
}
# ifndef OPENSSL_NO_RC4
else if (outformat == FORMAT_NETSCAPE) {
- unsigned char *p, *
pp
;
- int size;
+ unsigned char *p, *
save
;
+ int size
= i2d_RSA_NET(rsa, NULL, NULL, 0)
;
- i = 1;
- size = i2d_RSA_NET(rsa, NULL, NULL, 0);
- if ((p = OPENSSL_malloc(size)) == NULL) {
- BIO_printf(bio_err, "Memory allocation failure\n");
- goto end;
- }
- pp = p;
+ save = p = app_malloc(size, "RSA i2d buffer");
i2d_RSA_NET(rsa, &p, NULL, 0);
i2d_RSA_NET(rsa, &p, NULL, 0);
- BIO_write(out, (char *)pp, size);
- OPENSSL_free(pp);
+ BIO_write(out, (char *)save, size);
+ OPENSSL_free(save);
+ i = 1;
}
# endif
else if (outformat == FORMAT_PEM) {
}
# endif
else if (outformat == FORMAT_PEM) {
@@
-393,10
+391,8
@@
int rsa_main(int argc, char **argv)
end:
BIO_free_all(out);
RSA_free(rsa);
end:
BIO_free_all(out);
RSA_free(rsa);
- if (passin)
- OPENSSL_free(passin);
- if (passout)
- OPENSSL_free(passout);
+ OPENSSL_free(passin);
+ OPENSSL_free(passout);
return (ret);
}
#else /* !OPENSSL_NO_RSA */
return (ret);
}
#else /* !OPENSSL_NO_RSA */