Tor 0.4.9.8
Loading...
Searching...
No Matches
signing.c File Reference

Code to sign directory objects. More...

Go to the source code of this file.

Macros

#define BEGIN_END_OVERHEAD_LEN   64
 

Functions

char * router_get_dirobj_signature (const char *digest, size_t digest_len, const crypto_pk_t *private_key)
 
int router_append_dirobj_signature (char *buf, size_t buf_len, const char *digest, size_t digest_len, crypto_pk_t *private_key)
 

Detailed Description

Code to sign directory objects.

Definition in file signing.c.

Function Documentation

◆ router_append_dirobj_signature()

int router_append_dirobj_signature ( char * buf,
size_t buf_len,
const char * digest,
size_t digest_len,
crypto_pk_t * private_key )

Helper: used to generate signatures for routers, directories and network-status objects. Given a digest in digest and a secret private_key, generate a PKCS1-padded signature, BASE64-encode it, surround it with --—BEGIN/END--— pairs, and write it to the buf_len-byte buffer at buf. Return 0 on success, -1 on failure.

Definition at line 79 of file signing.c.

Referenced by extrainfo_dump_to_string_rsa_sig_helper().

◆ router_get_dirobj_signature()

char * router_get_dirobj_signature ( const char * digest,
size_t digest_len,
const crypto_pk_t * private_key )

Helper: used to generate signatures for routers, directories and network-status objects. Given a digest_len-byte digest in digest and a secret private_key, generate an PKCS1-padded signature, BASE64-encode it, surround it with --—BEGIN/END--— pairs, and return the new signature on success or NULL on failure.

Definition at line 22 of file signing.c.

Referenced by format_networkstatus_vote(), networkstatus_compute_consensus(), router_append_dirobj_signature(), and router_dump_router_to_string().