#include "common.h"
Go to the source code of this file.
Functions | |
void | huge_init (void) |
Call this function at the beginning. | |
void | huge_close (void) |
Call this when servent is shutdown. | |
void | request_sha1 (struct shared_file *) |
External interface to call for getting the hash for a shared_file. | |
gboolean | sha1_is_cached (const struct shared_file *sf) |
External interface to check whether the sha1 for shared_file is known. | |
gboolean | huge_improbable_sha1 (const gchar *buf, size_t len) |
Test whether the SHA1 in its base32/binary form is improbable. | |
gboolean | huge_sha1_extract32 (const gchar *buf, size_t len, gchar *retval, gpointer header, gboolean check_old) |
huge_sha1_extract32 | |
void | huge_collect_locations (gchar *sha1, struct header *header) |
|
Call this when servent is shutdown.
|
|
|
|
Test whether the SHA1 in its base32/binary form is improbable. This is used to detect "urn:sha1:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" and things using the same pattern with other letters, as being rather improbable hashes. |
|
Call this function at the beginning.
|
|
huge_sha1_extract32 Validate `len' bytes starting from `buf' as a proper base32 encoding of a SHA1 hash, and write decoded value in `retval'. Also make sure that the SHA1 is not an improbable value. `header' is the header of the packet where we found the SHA1, so that we may trace errors if needed. When `check_old' is true, check the encoding against an earlier version of the base32 alphabet.
|
|
External interface to call for getting the hash for a shared_file.
|
|
External interface to check whether the sha1 for shared_file is known.
|