diff options
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/tor-checkkey.c | 6 | ||||
-rw-r--r-- | src/tools/tor-gencert.c | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/tools/tor-checkkey.c b/src/tools/tor-checkkey.c index 94c8cbd44c..21de48d01f 100644 --- a/src/tools/tor-checkkey.c +++ b/src/tools/tor-checkkey.c @@ -15,7 +15,7 @@ int main(int c, char **v) { - crypto_pk_env_t *env; + crypto_pk_t *env; char *str; RSA *rsa; int wantdigest=0; @@ -56,7 +56,7 @@ main(int c, char **v) return 1; } - env = crypto_new_pk_env(); + env = crypto_pk_new(); if (crypto_pk_read_public_key_from_string(env, str, strlen(str))<0) { fprintf(stderr, "Couldn't parse key.\n"); return 1; @@ -69,7 +69,7 @@ main(int c, char **v) return 1; printf("%s\n",digest); } else { - rsa = _crypto_pk_env_get_rsa(env); + rsa = _crypto_pk_get_rsa(env); str = BN_bn2hex(rsa->n); printf("%s\n", str); diff --git a/src/tools/tor-gencert.c b/src/tools/tor-gencert.c index 57f82b1bc7..b5c96e556a 100644 --- a/src/tools/tor-gencert.c +++ b/src/tools/tor-gencert.c @@ -222,13 +222,13 @@ static RSA * generate_key(int bits) { RSA *rsa = NULL; - crypto_pk_env_t *env = crypto_new_pk_env(); + crypto_pk_t *env = crypto_pk_new(); if (crypto_pk_generate_key_with_bits(env,bits)<0) goto done; - rsa = _crypto_pk_env_get_rsa(env); + rsa = _crypto_pk_get_rsa(env); rsa = RSAPrivateKey_dup(rsa); done: - crypto_free_pk_env(env); + crypto_pk_free(env); return rsa; } @@ -399,10 +399,10 @@ static int get_fingerprint(EVP_PKEY *pkey, char *out) { int r = 1; - crypto_pk_env_t *pk = _crypto_new_pk_env_rsa(EVP_PKEY_get1_RSA(pkey)); + crypto_pk_t *pk = _crypto_new_pk_from_rsa(EVP_PKEY_get1_RSA(pkey)); if (pk) { r = crypto_pk_get_fingerprint(pk, out, 0); - crypto_free_pk_env(pk); + crypto_pk_free(pk); } return r; } @@ -412,10 +412,10 @@ static int get_digest(EVP_PKEY *pkey, char *out) { int r = 1; - crypto_pk_env_t *pk = _crypto_new_pk_env_rsa(EVP_PKEY_get1_RSA(pkey)); + crypto_pk_t *pk = _crypto_new_pk_from_rsa(EVP_PKEY_get1_RSA(pkey)); if (pk) { r = crypto_pk_get_digest(pk, out); - crypto_free_pk_env(pk); + crypto_pk_free(pk); } return r; } |