Merge remote-tracking branch 'origin/maint-0.2.2'

This commit is contained in:
Nick Mathewson
2011-06-03 11:36:21 -04:00
5 changed files with 21 additions and 3 deletions
+11
View File
@@ -777,6 +777,17 @@ crypto_pk_keysize(crypto_pk_env_t *env)
return (size_t) RSA_size(env->key);
}
/** Return the size of the public key modulus of <b>env</b>, in bits. */
int
crypto_pk_num_bits(crypto_pk_env_t *env)
{
tor_assert(env);
tor_assert(env->key);
tor_assert(env->key->n);
return BN_num_bits(env->key->n);
}
/** Increase the reference count of <b>env</b>, and return it.
*/
crypto_pk_env_t *
+1
View File
@@ -119,6 +119,7 @@ int crypto_pk_write_private_key_to_filename(crypto_pk_env_t *env,
int crypto_pk_check_key(crypto_pk_env_t *env);
int crypto_pk_cmp_keys(crypto_pk_env_t *a, crypto_pk_env_t *b);
size_t crypto_pk_keysize(crypto_pk_env_t *env);
int crypto_pk_num_bits(crypto_pk_env_t *env);
crypto_pk_env_t *crypto_pk_dup_key(crypto_pk_env_t *orig);
crypto_pk_env_t *crypto_pk_copy_full(crypto_pk_env_t *orig);
int crypto_pk_key_is_private(const crypto_pk_env_t *key);