10#ifndef RTR_BGPSEC_UTILS_PRIVATE_H
11#define RTR_BGPSEC_UTILS_PRIVATE_H
19#include <openssl/x509.h>
22#define BGPSEC_DBG(fmt, ...) lrtr_dbg("BGPSEC: " fmt, ##__VA_ARGS__)
23#define BGPSEC_DBG1(a) lrtr_dbg("BGPSEC: " a)
28#define SECURE_PATH_SEG_SIZE 6
34#define PRIVATE_KEY_LENGTH 121L
103int hash_byte_sequence(uint8_t *bytes,
size_t bytes_len, uint8_t alg_suite_id,
unsigned char **result_buffer);
void read_stream_at(uint8_t *buff, struct stream *s, uint16_t start, uint16_t len)
int align_byte_sequence(const struct rtr_bgpsec *data, struct stream *s, enum align_type type)
int check_router_keys(const struct rtr_signature_seg *sig_segs, struct spki_table *table)
struct stream * init_stream(uint16_t size)
int ski_is_empty(uint8_t *ski)
int sign_byte_sequence(uint8_t *hash_result, EC_KEY *priv_key, uint8_t alg, struct rtr_signature_seg *new_signature)
uint8_t * get_stream_start(struct stream *s)
int validate_signature(const unsigned char *hash, const struct rtr_signature_seg *sig, struct spki_record *record)
void free_stream(struct stream *s)
struct stream * copy_stream(struct stream *s)
int hash_byte_sequence(uint8_t *bytes, size_t bytes_len, uint8_t alg_suite_id, unsigned char **result_buffer)
uint8_t read_stream(struct stream *s)
int load_public_key(EC_KEY **pub_key, uint8_t *spki)
void ski_to_char(char *ski_str, uint8_t *ski)
size_t req_stream_size(const struct rtr_bgpsec *data, enum align_type type)
int byte_sequence_to_str(char *buffer, uint8_t *bytes, unsigned int bytes_len, unsigned int tabstops)
align_type
Control flag, validation and signing procedures for aligning data differs.
Definition bgpsec_utils_private.h:38
@ SIGNING
Definition bgpsec_utils_private.h:40
@ VALIDATION
Definition bgpsec_utils_private.h:39
int load_private_key(EC_KEY **priv_key, uint8_t *bytes_key)
size_t get_stream_size(struct stream *s)
void read_n_bytes_stream(uint8_t *buff, struct stream *s, uint16_t len)
int bgpsec_segment_to_str(char *buffer, struct rtr_signature_seg *sig_seg, struct rtr_secure_path_seg *sec_path)
int get_sig_seg_size(const struct rtr_signature_seg *sig_segs, enum align_type type)
void write_stream(struct stream *s, void *data, uint16_t len)
uint8_t ski[SKI_SIZE]
Definition rtr_pdus.h:5
uint8_t type
Definition rtr_pdus.h:1
uint8_t spki[SPKI_SIZE]
Definition rtr_pdus.h:7
uint32_t len
Definition rtr_pdus.h:4
The data that is passed to the rtr_mgr_bgpsec_validate_as_path function.
Definition bgpsec.h:125
A single Secure Path Segment.
Definition bgpsec.h:73
A single Signature Segment.
Definition bgpsec.h:88
spki_record.
Definition spkitable.h:38
spki_table.
Definition ht-spkitable_private.h:27