authinfo
struct dvd_authinfo *authinfo;
authinfo = (struct dvd_authinfo *)addr;
error = cdreportkey(periph, authinfo);
error = cdsendkey(periph, authinfo);
struct dvd_authinfo *authinfo);
struct dvd_authinfo *authinfo);
cdreportkey(struct cam_periph *periph, struct dvd_authinfo *authinfo)
switch (authinfo->format) {
lba = authinfo->lba;
/* agid */ authinfo->agid,
/* key_format */ authinfo->format,
switch(authinfo->format) {
authinfo->agid = (agid_data->agid & RKD_AGID_MASK) >>
bcopy(chal_data->challenge_key, authinfo->keychal,
sizeof(authinfo->keychal)));
bcopy(key1_data->key1, authinfo->keychal,
min(sizeof(key1_data->key1), sizeof(authinfo->keychal)));
authinfo->cpm = (title_data->byte0 & RKD_TITLE_CPM) >>
authinfo->cp_sec = (title_data->byte0 & RKD_TITLE_CP_SEC) >>
authinfo->cgms = (title_data->byte0 & RKD_TITLE_CMGS_MASK) >>
bcopy(title_data->title_key, authinfo->keychal,
sizeof(authinfo->keychal)));
authinfo->asf = asf_data->success & RKD_ASF_SUCCESS;
authinfo->reg_type = (rpc_data->byte4 & RKD_RPC_TYPE_MASK) >>
authinfo->vend_rsts =
authinfo->user_rsts = rpc_data->byte4 & RKD_RPC_USER_RESET_MASK;
authinfo->region = rpc_data->region_mask;
authinfo->rpc_scheme = rpc_data->rpc_scheme1;
cdsendkey(struct cam_periph *periph, struct dvd_authinfo *authinfo)
switch(authinfo->format) {
bcopy(authinfo->keychal, challenge_data->challenge_key,
min(sizeof(authinfo->keychal),
bcopy(authinfo->keychal, key2_data->key1,
min(sizeof(authinfo->keychal), sizeof(key2_data->key1)));
rpc_data->region_code = authinfo->region;
/* agid */ authinfo->agid,
/* key_format */ authinfo->format,
if (keyid == stcb->asoc.authinfo.assoc_keyid) {
sctp_free_key(stcb->asoc.authinfo.assoc_key);
stcb->asoc.authinfo.assoc_key = NULL;
if (keyid == stcb->asoc.authinfo.recv_keyid) {
sctp_free_key(stcb->asoc.authinfo.recv_key);
stcb->asoc.authinfo.recv_key = NULL;
if (keyid == stcb->asoc.authinfo.active_keyid)
stcb->asoc.authinfo.active_keyid = keyid;
if (keyid == stcb->asoc.authinfo.active_keyid)
if (stcb->asoc.authinfo.random != NULL)
sctp_free_key(stcb->asoc.authinfo.random);
stcb->asoc.authinfo.random = new_key;
stcb->asoc.authinfo.random_len = random_len;
sctp_clear_cachedkeys(stcb, stcb->asoc.authinfo.assoc_keyid);
sctp_clear_cachedkeys(stcb, stcb->asoc.authinfo.recv_keyid);
stcb->asoc.authinfo.active_keyid = stcb->sctp_ep->sctp_ep.default_keyid;
if ((keyid != stcb->asoc.authinfo.assoc_keyid) ||
(stcb->asoc.authinfo.assoc_key == NULL)) {
if (stcb->asoc.authinfo.assoc_key != NULL) {
sctp_free_key(stcb->asoc.authinfo.assoc_key);
stcb->asoc.authinfo.assoc_key =
sctp_compute_hashkey(stcb->asoc.authinfo.random,
stcb->asoc.authinfo.peer_random, key);
stcb->asoc.authinfo.assoc_keyid = keyid;
stcb->asoc.authinfo.assoc_keyid);
sctp_print_key(stcb->asoc.authinfo.assoc_key,
(void)sctp_compute_hmac_m(stcb->asoc.peer_hmac_id, stcb->asoc.authinfo.assoc_key,
if ((stcb->asoc.authinfo.recv_key == NULL) ||
(stcb->asoc.authinfo.recv_keyid != shared_key_id)) {
if (stcb->asoc.authinfo.recv_keyid != shared_key_id) {
if (stcb->asoc.authinfo.recv_key != NULL)
sctp_free_key(stcb->asoc.authinfo.recv_key);
stcb->asoc.authinfo.recv_key =
sctp_compute_hashkey(stcb->asoc.authinfo.random,
stcb->asoc.authinfo.peer_random, skey->key);
stcb->asoc.authinfo.recv_keyid = shared_key_id;
sctp_print_key(stcb->asoc.authinfo.recv_key, "Recv Key");
(void)sctp_compute_hmac_m(hmac_id, stcb->asoc.authinfo.recv_key,
auth->auth_altkeynumber = stcb->asoc.authinfo.recv_keyid;
stcb->asoc.authinfo.active_keyid = inp->sctp_ep.default_keyid;
if (stcb->asoc.authinfo.random != NULL)
sctp_free_key(stcb->asoc.authinfo.random);
stcb->asoc.authinfo.random = new_key;
stcb->asoc.authinfo.random_len = random_len;
sctp_free_authinfo(sctp_authinfo_t *authinfo)
if (authinfo == NULL)
if (authinfo->random != NULL)
sctp_free_key(authinfo->random);
if (authinfo->peer_random != NULL)
sctp_free_key(authinfo->peer_random);
if (authinfo->assoc_key != NULL)
sctp_free_key(authinfo->assoc_key);
if (authinfo->recv_key != NULL)
sctp_free_key(authinfo->recv_key);
extern void sctp_free_authinfo(sctp_authinfo_t *authinfo);
m_out, auth_offset, auth, stcb->asoc.authinfo.active_keyid, 1, 0, 0,
sp->auth_keyid = stcb->asoc.authinfo.active_keyid;
struct sctp_authinfo authinfo;
m_copydata(control, cmsg_data_off, sizeof(struct sctp_authinfo), (caddr_t)&authinfo);
sndrcvinfo->sinfo_keynumber = authinfo.auth_keynumber;
if (stcb->asoc.authinfo.random != NULL) {
parameter_len = (uint16_t)sizeof(struct sctp_auth_random) + stcb->asoc.authinfo.random_len;
memcpy(randp, stcb->asoc.authinfo.random->key, parameter_len);
sp->auth_keyid = stcb->asoc.authinfo.active_keyid;
auth_keyid = stcb->asoc.authinfo.active_keyid;
stcb->asoc.authinfo.active_keyid,
stcb->asoc.authinfo.active_keyid,
auth_keyid = stcb->asoc.authinfo.active_keyid;
auth_offset, auth, stcb->asoc.authinfo.active_keyid,
sctp_free_authinfo(&asoc->authinfo);
if (stcb->asoc.authinfo.peer_random != NULL)
sctp_free_key(stcb->asoc.authinfo.peer_random);
stcb->asoc.authinfo.peer_random = new_key;
sctp_clear_cachedkeys(stcb, stcb->asoc.authinfo.assoc_keyid);
sctp_clear_cachedkeys(stcb, stcb->asoc.authinfo.recv_keyid);
sctp_authinfo_t authinfo; /* randoms, cached keys */
scact->scact_keynumber = stcb->asoc.authinfo.active_keyid;
asoc->authinfo.random = NULL;
asoc->authinfo.active_keyid = 0;
asoc->authinfo.assoc_key = NULL;
asoc->authinfo.assoc_keyid = 0;
asoc->authinfo.recv_key = NULL;
asoc->authinfo.recv_keyid = 0;
void *authinfo; /* authentication information */
if (rp->authinfo)
free(rp->authinfo);
struct authinfo *authp = (struct authinfo *)vauthp;
auth_Init(struct authinfo *authp, struct physical *p, auth_func req,
memset(authp, '\0', sizeof(struct authinfo));
auth_StartReq(struct authinfo *authp)
auth_StopTimer(struct authinfo *authp)
auth_ReadHeader(struct authinfo *authp, struct mbuf *bp)
auth_ReadName(struct authinfo *authp, struct mbuf *bp, size_t len)
struct authinfo;
typedef void (*auth_func)(struct authinfo *);
extern void auth_Init(struct authinfo *, struct physical *,
extern void auth_StopTimer(struct authinfo *);
extern void auth_StartReq(struct authinfo *);
extern struct mbuf *auth_ReadHeader(struct authinfo *, struct mbuf *);
extern struct mbuf *auth_ReadName(struct authinfo *, struct mbuf *, size_t);
chap_ChallengeInit(struct authinfo *authp)
chap_Challenge(struct authinfo *authp)
chap_Success(struct authinfo *authp)
chap_Failure(struct authinfo *authp)
struct authinfo auth;
struct authinfo pap; /* Authentication using pap */
SendPapCode(struct authinfo *authp, int code, const char *message)
pap_Success(struct authinfo *authp)
pap_Failure(struct authinfo *authp)
pap_Init(struct authinfo *pap, struct physical *p)
struct authinfo *authp = &p->dl->pap;
pap_Req(struct authinfo *authp)
struct authinfo;
extern void pap_Init(struct authinfo *, struct physical *);
radius_Authenticate(struct radius *r, struct authinfo *authp, const char *name,
extern int radius_Authenticate(struct radius *, struct authinfo *,
struct authinfo *auth; /* Tell this about success/failure */