]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
squash! Add crypto_pk_check_key_public_exponent function
authorNick Mathewson <nickm@torproject.org>
Mon, 16 May 2011 18:44:23 +0000 (14:44 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 16 May 2011 18:45:06 +0000 (14:45 -0400)
Rename crypto_pk_check_key_public_exponent to crypto_pk_public_exponent_ok:
it's nice to name predicates s.t. you can tell how to interpret true
and false.

src/common/crypto.c
src/common/crypto.h
src/or/routerparse.c

index 6761fd71f348c123cc07d4a32a6c4079968a13a0..dffa2c7807dcf2e99f222b3092f434f176c34ba3 100644 (file)
@@ -660,7 +660,7 @@ crypto_pk_key_is_private(const crypto_pk_env_t *key)
  * equals 65537.
  */
 int
-crypto_pk_check_key_public_exponent(crypto_pk_env_t *env)
+crypto_pk_public_exponent_ok(crypto_pk_env_t *env)
 {
   tor_assert(env);
   tor_assert(env->key);
index 0fcd067ae11b7f32cd0e84e448d2ce436257c810..8604a8db590f4a366dc3a955eaa85418760a8461 100644 (file)
@@ -92,7 +92,7 @@ size_t crypto_pk_keysize(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);
-int crypto_pk_check_key_public_exponent(crypto_pk_env_t *env);
+int crypto_pk_public_exponent_ok(crypto_pk_env_t *env);
 
 int crypto_pk_public_encrypt(crypto_pk_env_t *env, char *to, size_t tolen,
                              const char *from, size_t fromlen, int padding);
index ceef054af09c9facb41738bb2446b385b16aafc2..19f9e38a9a92eb4b1f6b86f2d4f42bd6679670bd 100644 (file)
@@ -1326,7 +1326,7 @@ router_parse_entry_from_string(const char *s, const char *end,
     goto err;
 
   tok = find_by_keyword(tokens, K_ONION_KEY);
-  if (!crypto_pk_check_key_public_exponent(tok->key)) {
+  if (!crypto_pk_public_exponent_ok(tok->key)) {
     log_warn(LD_DIR,
              "Relay's onion key had invalid exponent.");
     goto err;
@@ -3976,7 +3976,7 @@ rend_parse_introduction_points(rend_service_descriptor_t *parsed,
     }
     /* Parse onion key. */
     tok = find_by_keyword(tokens, R_IPO_ONION_KEY);
-    if (!crypto_pk_check_key_public_exponent(tok->key)) {
+    if (!crypto_pk_public_exponent_ok(tok->key)) {
       log_warn(LD_REND,
                "Introduction point's onion key had invalid exponent.");
       rend_intro_point_free(intro);
@@ -3986,7 +3986,7 @@ rend_parse_introduction_points(rend_service_descriptor_t *parsed,
     tok->key = NULL; /* Prevent free */
     /* Parse service key. */
     tok = find_by_keyword(tokens, R_IPO_SERVICE_KEY);
-    if (!crypto_pk_check_key_public_exponent(tok->key)) {
+    if (!crypto_pk_public_exponent_ok(tok->key)) {
       log_warn(LD_REND,
                "Introduction point key had invalid exponent.");
       rend_intro_point_free(intro);