diff options
author | jsorg71 <jsorg71> | 2007-06-08 06:54:46 +0000 |
---|---|---|
committer | jsorg71 <jsorg71> | 2007-06-08 06:54:46 +0000 |
commit | 023a32252d46d18ce05743858a6aff65612b0cf5 (patch) | |
tree | 54439b898eb08bb1f52efb229922703909990483 /keygen/keygen.c | |
parent | ddba72271fda9e82dd45c501cb43a952bfdd50c4 (diff) | |
download | xrdp-proprietary-023a32252d46d18ce05743858a6aff65612b0cf5.tar.gz xrdp-proprietary-023a32252d46d18ce05743858a6aff65612b0cf5.zip |
warnings
Diffstat (limited to 'keygen/keygen.c')
-rwxr-xr-x | keygen/keygen.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/keygen/keygen.c b/keygen/keygen.c index c3dd99fd..58f7caad 100755 --- a/keygen/keygen.c +++ b/keygen/keygen.c @@ -53,6 +53,8 @@ key_gen(void) char* e_data; char* n_data; char* d_data; + unsigned char* p; + int len; int e_len; int n_len; int d_len; @@ -64,10 +66,11 @@ key_gen(void) e_data = 0; n_data = 0; d_data = 0; - error = 0; my_ctx = BN_CTX_new(); my_e = BN_new(); - BN_bin2bn((unsigned char*)g_rev_exponent, sizeof(g_rev_exponent), my_e); + p = (unsigned char*)g_rev_exponent; + len = sizeof(g_rev_exponent); + BN_bin2bn(p, len, my_e); my_key = RSA_new(); g_writeln(""); g_writeln("Generating %d bit rsa key...", MY_KEY_SIZE); @@ -82,7 +85,8 @@ key_gen(void) if (e_len > 0) { e_data = (char*)g_malloc(e_len, 0); - BN_bn2bin(my_key->e, (unsigned char*)e_data); + p = (unsigned char*)e_data; + BN_bn2bin(my_key->e, p); g_writeln("public exponent size %d bytes", e_len); g_hexdump(e_data, e_len); g_writeln(""); @@ -91,7 +95,8 @@ key_gen(void) if (n_len > 0) { n_data = (char*)g_malloc(n_len, 0); - BN_bn2bin(my_key->n, (unsigned char*)n_data); + p = (unsigned char*)n_data; + BN_bn2bin(my_key->n, p); g_writeln("public modulus size %d bytes", n_len); g_hexdump(n_data, n_len); g_writeln(""); @@ -100,7 +105,8 @@ key_gen(void) if (d_len > 0) { d_data = (char*)g_malloc(d_len, 0); - BN_bn2bin(my_key->d, (unsigned char*)d_data); + p = (unsigned char*)d_data; + BN_bn2bin(my_key->d, p); g_writeln("private exponent size %d bytes", d_len); g_hexdump(d_data, d_len); g_writeln(""); |