]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Remove unused check_fingerprint_syntax
authorNick Mathewson <nickm@torproject.org>
Sat, 2 Mar 2013 03:01:26 +0000 (22:01 -0500)
committerNick Mathewson <nickm@torproject.org>
Sat, 2 Mar 2013 03:01:26 +0000 (22:01 -0500)
src/common/crypto.c
src/common/crypto.h
src/test/test_crypto.c

index 8d374004cea1c19f00b3c84ca18f4d851dc4bfac..2f9f3ad7d71d25a5f44f92e2f756c8cbc59a5ec3 100644 (file)
@@ -1294,23 +1294,6 @@ crypto_pk_get_fingerprint(crypto_pk_t *pk, char *fp_out, int add_space)
   return 0;
 }
 
-/** Return true iff <b>s</b> is in the correct format for a fingerprint.
- */
-int
-crypto_pk_check_fingerprint_syntax(const char *s)
-{
-  int i;
-  for (i = 0; i < FINGERPRINT_LEN; ++i) {
-    if ((i%5) == 4) {
-      if (!TOR_ISSPACE(s[i])) return 0;
-    } else {
-      if (!TOR_ISXDIGIT(s[i])) return 0;
-    }
-  }
-  if (s[FINGERPRINT_LEN]) return 0;
-  return 1;
-}
-
 /* symmetric crypto */
 
 /** Return a pointer to the key set for the cipher in <b>env</b>.
index 1976549610b32719cf5b347299a9444bc225119e..ee356c64bd3fce627d140ed8f9b51d990bfa04e2 100644 (file)
@@ -183,7 +183,6 @@ crypto_pk_t *crypto_pk_asn1_decode(const char *str, size_t len);
 int crypto_pk_get_digest(crypto_pk_t *pk, char *digest_out);
 int crypto_pk_get_all_digests(crypto_pk_t *pk, digests_t *digests_out);
 int crypto_pk_get_fingerprint(crypto_pk_t *pk, char *fp_out,int add_space);
-int crypto_pk_check_fingerprint_syntax(const char *s);
 
 /* symmetric crypto */
 const char *crypto_cipher_get_key(crypto_cipher_t *env);
index 1f12c87ace039c53dd2f574d6d912cc15af522e4..645fc9f8a676b6befe875024ef10a5e3fd18dcc5 100644 (file)
@@ -608,22 +608,6 @@ test_crypto_formats(void)
     tor_free(data2);
   }
 
-  /* Check fingerprint */
-  {
-    test_assert(crypto_pk_check_fingerprint_syntax(
-                "ABCD 1234 ABCD 5678 0000 ABCD 1234 ABCD 5678 0000"));
-    test_assert(!crypto_pk_check_fingerprint_syntax(
-                "ABCD 1234 ABCD 5678 0000 ABCD 1234 ABCD 5678 000"));
-    test_assert(!crypto_pk_check_fingerprint_syntax(
-                "ABCD 1234 ABCD 5678 0000 ABCD 1234 ABCD 5678 00000"));
-    test_assert(!crypto_pk_check_fingerprint_syntax(
-                "ABCD 1234 ABCD 5678 0000 ABCD1234 ABCD 5678 0000"));
-    test_assert(!crypto_pk_check_fingerprint_syntax(
-                "ABCD 1234 ABCD 5678 0000 ABCD1234 ABCD 5678 00000"));
-    test_assert(!crypto_pk_check_fingerprint_syntax(
-                "ACD 1234 ABCD 5678 0000 ABCD 1234 ABCD 5678 00000"));
-  }
-
  done:
   tor_free(data1);
   tor_free(data2);