|
Electroneum
|
Go to the source code of this file.
Functions | |
| size_t | nsec3_hash_algo_size_supported (int id) |
| int | secalgo_nsec3_hash (int algo, unsigned char *buf, size_t len, unsigned char *res) |
| void | secalgo_hash_sha256 (unsigned char *buf, size_t len, unsigned char *res) |
| size_t | ds_digest_size_supported (int algo) |
| int | secalgo_ds_digest (int algo, unsigned char *buf, size_t len, unsigned char *res) |
| int | dnskey_algo_id_is_supported (int id) |
| enum sec_status | verify_canonrrset (struct sldns_buffer *buf, int algo, unsigned char *sigblock, unsigned int sigblock_len, unsigned char *key, unsigned int keylen, char **reason) |
This file contains helper functions for the validator module. The functions take buffers with raw data and convert to library calls.
Definition in file val_secalgo.h.
| int dnskey_algo_id_is_supported | ( | int | id | ) |
return true if DNSKEY algorithm id is supported
| size_t ds_digest_size_supported | ( | int | algo | ) |
Return size of DS digest according to its hash algorithm.
| algo | DS digest algo. |
| size_t nsec3_hash_algo_size_supported | ( | int | id | ) |
Return size of nsec3 hash algorithm, 0 if not supported
| int secalgo_ds_digest | ( | int | algo, |
| unsigned char * | buf, | ||
| size_t | len, | ||
| unsigned char * | res | ||
| ) |
| algo | the DS digest algo |
| buf | the buffer to digest |
| len | length of buffer to digest. |
| res | result stored here (must have sufficient space). |
| void secalgo_hash_sha256 | ( | unsigned char * | buf, |
| size_t | len, | ||
| unsigned char * | res | ||
| ) |
Calculate the sha256 hash for the data buffer into the result.
| buf | buffer to digest. |
| len | length of the buffer to digest. |
| res | result is stored here (space 256/8 bytes). |
| int secalgo_nsec3_hash | ( | int | algo, |
| unsigned char * | buf, | ||
| size_t | len, | ||
| unsigned char * | res | ||
| ) |
Hash a single hash call of an NSEC3 hash algorithm. Iterations and salt are done by the caller.
| algo | nsec3 hash algorithm. |
| buf | the buffer to digest |
| len | length of buffer to digest. |
| res | result stored here (must have sufficient space). |
| enum sec_status verify_canonrrset | ( | struct sldns_buffer * | buf, |
| int | algo, | ||
| unsigned char * | sigblock, | ||
| unsigned int | sigblock_len, | ||
| unsigned char * | key, | ||
| unsigned int | keylen, | ||
| char ** | reason | ||
| ) |
Check a canonical sig+rrset and signature against a dnskey
| buf | buffer with data to verify, the first rrsig part and the canonicalized rrset. |
| algo | DNSKEY algorithm. |
| sigblock | signature rdata field from RRSIG |
| sigblock_len | length of sigblock data. |
| key | public key data from DNSKEY RR. |
| keylen | length of keydata. |
| reason | bogus reason in more detail. |