ported most of the libstrongswan chunk_t macros to pluto

This commit is contained in:
Andreas Steffen
2009-04-17 16:11:33 +00:00
parent c04e75487f
commit 9b91b81870
27 changed files with 273 additions and 250 deletions
+4 -2
View File
@@ -321,10 +321,12 @@ generate_rsa_private_key(int nbits, RSA_private_key_t *key)
size_t n_len = (mpz_sizeinbase(n,2)+BITS_PER_BYTE-1)/BITS_PER_BYTE;
chunk_t e_ch = mpz_to_n(e, e_len);
chunk_t n_ch = mpz_to_n(n, n_len);
form_keyid(e_ch, n_ch, key->pub.keyid, &key->pub.k);
freeanychunk(e_ch);
freeanychunk(n_ch);
free(e_ch.ptr);
free(n_ch.ptr);
}
/* fill in the elements of the RSA private key */
key->p = *p;
key->q = *q;