projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update from HEAD.
[oweals/openssl.git]
/
apps
/
rsa.c
diff --git
a/apps/rsa.c
b/apps/rsa.c
index 4e19bc16fb877d019abe2aa65e38be1ed2c90cbb..d5cb7b7212939bb0ec8d885e1b121abb460163d3 100644
(file)
--- a/
apps/rsa.c
+++ b/
apps/rsa.c
@@
-56,6
+56,7
@@
* [including the GNU Public Licence.]
*/
* [including the GNU Public Licence.]
*/
+#include <openssl/opensslconf.h>
#ifndef OPENSSL_NO_RSA
#include <stdio.h>
#include <stdlib.h>
#ifndef OPENSSL_NO_RSA
#include <stdio.h>
#include <stdlib.h>
@@
-68,6
+69,7
@@
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
+#include <openssl/bn.h>
#undef PROG
#define PROG rsa_main
#undef PROG
#define PROG rsa_main
@@
-104,7
+106,9
@@
int MAIN(int argc, char **argv)
char *infile,*outfile,*prog;
char *passargin = NULL, *passargout = NULL;
char *passin = NULL, *passout = NULL;
char *infile,*outfile,*prog;
char *passargin = NULL, *passargout = NULL;
char *passin = NULL, *passout = NULL;
+#ifndef OPENSSL_NO_ENGINE
char *engine=NULL;
char *engine=NULL;
+#endif
int modulus=0;
apps_startup();
int modulus=0;
apps_startup();
@@
-156,11
+160,13
@@
int MAIN(int argc, char **argv)
if (--argc < 1) goto bad;
passargout= *(++argv);
}
if (--argc < 1) goto bad;
passargout= *(++argv);
}
+#ifndef OPENSSL_NO_ENGINE
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
else if (strcmp(*argv,"-engine") == 0)
{
if (--argc < 1) goto bad;
engine= *(++argv);
}
+#endif
else if (strcmp(*argv,"-sgckey") == 0)
sgckey=1;
else if (strcmp(*argv,"-pubin") == 0)
else if (strcmp(*argv,"-sgckey") == 0)
sgckey=1;
else if (strcmp(*argv,"-pubin") == 0)
@@
-212,13
+218,17
@@
bad:
BIO_printf(bio_err," -check verify key consistency\n");
BIO_printf(bio_err," -pubin expect a public key in input file\n");
BIO_printf(bio_err," -pubout output a public key\n");
BIO_printf(bio_err," -check verify key consistency\n");
BIO_printf(bio_err," -pubin expect a public key in input file\n");
BIO_printf(bio_err," -pubout output a public key\n");
+#ifndef OPENSSL_NO_ENGINE
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
+#endif
goto end;
}
ERR_load_crypto_strings();
goto end;
}
ERR_load_crypto_strings();
+#ifndef OPENSSL_NO_ENGINE
e = setup_engine(bio_err, engine, 0);
e = setup_engine(bio_err, engine, 0);
+#endif
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
BIO_printf(bio_err, "Error getting passwords\n");
if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
BIO_printf(bio_err, "Error getting passwords\n");
@@
-299,7
+309,7
@@
bad:
BIO_printf(out,"RSA key ok\n");
else if (r == 0)
{
BIO_printf(out,"RSA key ok\n");
else if (r == 0)
{
- long err;
+
unsigned
long err;
while ((err = ERR_peek_error()) != 0 &&
ERR_GET_LIB(err) == ERR_LIB_RSA &&
while ((err = ERR_peek_error()) != 0 &&
ERR_GET_LIB(err) == ERR_LIB_RSA &&
@@
-369,7
+379,7
@@
end:
if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout);
apps_shutdown();
if(passin) OPENSSL_free(passin);
if(passout) OPENSSL_free(passout);
apps_shutdown();
- EXIT(ret);
+
OPENSSL_
EXIT(ret);
}
#else /* !OPENSSL_NO_RSA */
}
#else /* !OPENSSL_NO_RSA */