![]() |
ndn-lite
|
#include "sign-on-basic-client.h"
#include "sign-on-basic-sec-intf-setter.h"
#include <string.h>
#include "../../ndn-error-code.h"
#include "../../ndn-constants.h"
#include "../../encode/tlv.h"
#include "../../encode/decoder.h"
#include "sign-on-basic-consts.h"
#include "security/sign-on-basic-sec-consts.h"
#include "sign-on-basic-impl-consts.h"
#include "variants/ecc_256/sign-on-basic-ecc-256-consts.h"
Functions | |
int | sign_on_basic_client_init (uint8_t variant, sign_on_basic_client_t *sign_on_basic_client, const uint8_t *device_identifier_p, uint32_t device_identifier_len, const uint8_t *device_capabilities_p, uint32_t device_capabilities_len, const uint8_t *secure_sign_on_code_p, const uint8_t *KS_pub_p, uint32_t KS_pub_len, const uint8_t *KS_pri_p, uint32_t KS_pri_len) |
Initialize state for a sign_on_basic_client_t. More... | |
int | cnstrct_btstrp_rqst (uint8_t *buf_p, uint32_t buf_len, uint32_t *output_len_p, sign_on_basic_client_t *sign_on_basic_client) |
Construct a bootstrapping request. More... | |
int | prcs_btstrp_rqst_rspns (const uint8_t *btstrp_rqst_rspns_buf_p, uint32_t btstrp_rqst_rspns_buf_len, sign_on_basic_client_t *sign_on_basic_client) |
Process a bootstrapping request response. More... | |
int | cnstrct_cert_rqst (uint8_t *buf_p, uint32_t buf_len, uint32_t *output_len_p, sign_on_basic_client_t *sign_on_basic_client) |
Construct a certificate request. More... | |
int | prcs_cert_rqst_rspns (const uint8_t *cert_rqst_rspns_buf_p, uint32_t cert_rqst_rspns_buf_len, sign_on_basic_client_t *sign_on_basic_client) |
Process a certificate request response. More... | |
int | cnstrct_fin_msg (uint8_t *buf_p, uint32_t buf_len, uint32_t *output_len_p, sign_on_basic_client_t *sign_on_basic_client) |
Construct a sign-on basic finish message (this lets the controller know sign-on was completed successfully. More... | |
int cnstrct_btstrp_rqst | ( | uint8_t * | buf_p, |
uint32_t | buf_len, | ||
uint32_t * | output_len_p, | ||
sign_on_basic_client_t * | sign_on_basic_client | ||
) |
Construct a bootstrapping request.
For a given sign on exchange: Should be called after sign_on_basic_client_init. Should be called before prcs_btstrp_rqst_rspns, cnstrct_cert_rqst, and prcs_cert_rqst_rspns.
[in] | buf_p | Pre allocated buffer to use in generating bootstrapping request. |
[in] | buf_len | Length of pre allocated buffer. |
[in] | output_len_p | Pointer to variable that will be filled with length of generated bootstrapping request upon successful construction. |
[in] | sign_on_basic_client | Reference to the sign_on_basic_client_t to use in construction. |
int cnstrct_cert_rqst | ( | uint8_t * | buf_p, |
uint32_t | buf_len, | ||
uint32_t * | output_len_p, | ||
sign_on_basic_client_t * | sign_on_basic_client | ||
) |
Construct a certificate request.
For a given sign on exchange: Should be called after sign_on_basic_client_init, and prcs_btstrp_rqst_rspns. Should be called before prcs_cert_rqst_rspns.
[in] | buf_p | Pre allocated buffer to use in generating certificate request. |
[in] | buf_len | Length of pre allocated buffer. |
[in] | output_len_p | Pointer to variable that will be filled with length of generated certificate request upon successful construction. |
[in] | sign_on_basic_client | Reference to the sign_on_basic_client_t to use in construction. |
int cnstrct_fin_msg | ( | uint8_t * | buf_p, |
uint32_t | buf_len, | ||
uint32_t * | output_len_p, | ||
sign_on_basic_client_t * | sign_on_basic_client | ||
) |
Construct a sign-on basic finish message (this lets the controller know sign-on was completed successfully.
For a given sign on exchange: Should be called after sign_on_basic_client_init, prcs_btstrp_rqst_rspns, cnstrct_cert_rqst, and prcs_cert_rqst_rspns. Should be called last in the sign-on process.
[in] | buf_p | Pre allocated buffer to use in generating finish message. |
[in] | buf_len | Length of pre allocated buffer. |
[in] | output_len_p | Pointer to variable that will be filled with length of generated finish message upon successful construction. |
[in] | sign_on_basic_client | Reference to the sign_on_basic_client_t to use in construction. |
int prcs_btstrp_rqst_rspns | ( | const uint8_t * | btstrp_rqst_rspns_buf_p, |
uint32_t | btstrp_rqst_rspns_buf_len, | ||
sign_on_basic_client_t * | sign_on_basic_client | ||
) |
Process a bootstrapping request response.
For a given sign on exchange: Should be called after sign_on_basic_client_init and prcs_btstrp_rqst_rspns. Should be called before cnstrct_cert_rqst, and prcs_cert_rqst_rspns.
[in] | btstrp_rqst_rspns_buf_p | Buffer that holds the bootstrapping request response. |
[in] | btstrp_rqst_rspns_buf_len | Length of the bootstrapping request response. |
[in] | sign_on_basic_client | Reference to the sign_on_basic_client_t to modify while processing. |
int prcs_cert_rqst_rspns | ( | const uint8_t * | cert_rqst_rspns_buf_p, |
uint32_t | cert_rqst_rspns_buf_len, | ||
sign_on_basic_client_t * | sign_on_basic_client | ||
) |
Process a certificate request response.
For a given sign on exchange: Should be called after sign_on_basic_client_init, prcs_btstrp_rqst_rspns, and cnstrct_cert_rqst. Should be called before cnstrct_fin_msg.
[in] | cert_rqst_rspns_buf_p | Buffer that holds the certificate request response. |
[in] | cert_rqst_rspns_buf_len | Length of the certificate request response. |
[in] | sign_on_basic_client | Reference to the sign_on_basic_client_t to modify while processing. |
int sign_on_basic_client_init | ( | uint8_t | variant, |
sign_on_basic_client_t * | sign_on_basic_client, | ||
const uint8_t * | device_identifier_p, | ||
uint32_t | device_identifier_len, | ||
const uint8_t * | device_capabilities_p, | ||
uint32_t | device_capabilities_len, | ||
const uint8_t * | secure_sign_on_code_p, | ||
const uint8_t * | KS_pub_p, | ||
uint32_t | KS_pub_len, | ||
const uint8_t * | KS_pri_p, | ||
uint32_t | KS_pri_len | ||
) |
Initialize state for a sign_on_basic_client_t.
All buffers passed in will be copied into the sign_on_basic_client basic client.
[in] | variant | This is the variant of the Sign-On basic protocol that you want to initialize. This will change the function pointers that are passed to sign_on_basic_sec_intf to do security related operations, like signature generation. See secure-sign-on-basic-consts.h for all of the variants, as |
well as descriptions.
[in] | sign_on_basic_client | Reference to the sign_on_basic_client_t to be initialized. |
[in] | device_identifier_p | See the sign_on_basic_client_t documentation. |
[in] | device_identifier_len | " " |
[in] | device_capabilities_p | " " |
[in] | device_capabilities_len | " " |
[in] | secure_sign_on_code_p | " " |
[in] | KS_pub_p | " " |
[in] | KS_pub_len | " " |
[in] | KS_pri_p | " " |
[in] | KS_pri_len | " " |