Lines Matching refs:data
28 void *data;
169 encode_MechType(unsigned char *p, size_t len, const MechType * data, size_t * size)
175 e = encode_oid(p, len, data, &l);
184 decode_MechType(const unsigned char *p, size_t len, MechType * data, size_t * size)
190 memset(data, 0, sizeof(*data));
191 e = decode_oid(p, len, data, &l);
197 free_MechType(data);
202 free_MechType(MechType * data)
204 free_oid(data);
217 encode_MechTypeList(unsigned char *p, size_t len, const MechTypeList * data, size_t * size)
223 for (i = (data)->len - 1; i >= 0; --i) {
226 e = encode_MechType(p, len, &(data)->val[i], &l);
237 decode_MechTypeList(const unsigned char *p, size_t len, MechTypeList * data, size_t * size)
243 memset(data, 0, sizeof(*data));
254 (data)->len = 0;
255 (data)->val = NULL;
257 void *old = (data)->val;
258 (data)->len++;
259 (data)->val = realloc((data)->val, sizeof(*((data)->val)) * (data)->len);
260 if ((data)->val == NULL) {
261 (data)->val = old;
262 (data)->len--;
265 e = decode_MechType(p, len, &(data)->val[(data)->len - 1], &l);
275 free_MechTypeList(data);
280 free_MechTypeList(MechTypeList * data)
282 while ((data)->len) {
283 free_MechType(&(data)->val[(data)->len - 1]);
284 (data)->len--;
286 free((data)->val);
287 (data)->val = NULL;
300 encode_ContextFlags(unsigned char *p, size_t len, const ContextFlags * data, size_t * size)
320 if (data->integFlag)
322 if (data->confFlag)
324 if (data->anonFlag)
326 if (data->sequenceFlag)
328 if (data->replayFlag)
330 if (data->mutualFlag)
332 if (data->delegFlag)
347 decode_ContextFlags(const unsigned char *p, size_t len, ContextFlags * data, size_t * size)
353 memset(data, 0, sizeof(*data));
363 data->delegFlag = (*p >> 7) & 1;
364 data->mutualFlag = (*p >> 6) & 1;
365 data->replayFlag = (*p >> 5) & 1;
366 data->sequenceFlag = (*p >> 4) & 1;
367 data->anonFlag = (*p >> 3) & 1;
368 data->confFlag = (*p >> 2) & 1;
369 data->integFlag = (*p >> 1) & 1;
375 free_ContextFlags(data);
380 free_ContextFlags(ContextFlags * data)
382 (void)data;
406 encode_NegTokenInit(unsigned char *p, size_t len, const NegTokenInit * data, size_t * size)
412 if ((data)->mechListMIC) {
415 e = encode_octet_string(p, len, (data)->mechListMIC, &l);
421 if ((data)->mechToken) {
424 e = encode_octet_string(p, len, (data)->mechToken, &l);
430 if ((data)->reqFlags) {
433 e = encode_ContextFlags(p, len, (data)->reqFlags, &l);
441 e = encode_MechTypeList(p, len, &(data)->mechTypes, &l);
454 decode_NegTokenInit(const unsigned char *p, size_t len, NegTokenInit * data, size_t * size)
460 memset(data, 0, sizeof(*data));
485 e = decode_MechTypeList(p, len, &(data)->mechTypes, &l);
500 (data)->reqFlags = NULL;
512 (data)->reqFlags = malloc(sizeof(*(data)->reqFlags));
513 if ((data)->reqFlags == NULL)
515 e = decode_ContextFlags(p, len, (data)->reqFlags, &l);
530 (data)->mechToken = NULL;
542 (data)->mechToken = malloc(sizeof(*(data)->mechToken));
543 if ((data)->mechToken == NULL)
545 e = decode_octet_string(p, len, (data)->mechToken, &l);
560 (data)->mechListMIC = NULL;
572 (data)->mechListMIC = malloc(sizeof(*(data)->mechListMIC));
573 if ((data)->mechListMIC == NULL)
575 e = decode_octet_string(p, len, (data)->mechListMIC, &l);
594 free_NegTokenInit(data);
599 free_NegTokenInit(NegTokenInit * data)
601 free_MechTypeList(&(data)->mechTypes);
602 if ((data)->reqFlags) {
603 free_ContextFlags((data)->reqFlags);
604 free((data)->reqFlags);
605 (data)->reqFlags = NULL;
607 if ((data)->mechToken) {
608 free_octet_string((data)->mechToken);
609 free((data)->mechToken);
610 (data)->mechToken = NULL;
612 if ((data)->mechListMIC) {
613 free_octet_string((data)->mechListMIC);
614 free((data)->mechListMIC);
615 (data)->mechListMIC = NULL;
629 encode_NegTokenResp(unsigned char *p, size_t len, const NegTokenResp * data, size_t * size)
635 if ((data)->mechListMIC) {
638 e = encode_octet_string(p, len, (data)->mechListMIC, &l);
644 if ((data)->responseToken) {
647 e = encode_octet_string(p, len, (data)->responseToken, &l);
653 if ((data)->supportedMech) {
656 e = encode_MechType(p, len, (data)->supportedMech, &l);
662 if ((data)->negState) {
665 e = encode_enumerated(p, len, (data)->negState, &l);
678 decode_NegTokenResp(const unsigned char *p, size_t len, NegTokenResp * data, size_t * size)
684 memset(data, 0, sizeof(*data));
697 (data)->negState = NULL;
709 (data)->negState = malloc(sizeof(*(data)->negState));
710 if ((data)->negState == NULL)
712 e = decode_enumerated(p, len, (data)->negState, &l);
727 (data)->supportedMech = NULL;
739 (data)->supportedMech = malloc(sizeof(*(data)->supportedMech));
740 if ((data)->supportedMech == NULL)
742 e = decode_MechType(p, len, (data)->supportedMech, &l);
757 (data)->responseToken = NULL;
769 (data)->responseToken = malloc(sizeof(*(data)->responseToken));
770 if ((data)->responseToken == NULL)
772 e = decode_octet_string(p, len, (data)->responseToken, &l);
787 (data)->mechListMIC = NULL;
799 (data)->mechListMIC = malloc(sizeof(*(data)->mechListMIC));
800 if ((data)->mechListMIC == NULL)
802 e = decode_octet_string(p, len, (data)->mechListMIC, &l);
821 free_NegTokenResp(data);
826 free_NegTokenResp(NegTokenResp * data)
828 if ((data)->negState) {
829 free((data)->negState);
830 (data)->negState = NULL;
832 if ((data)->supportedMech) {
833 free_MechType((data)->supportedMech);
834 free((data)->supportedMech);
835 (data)->supportedMech = NULL;
837 if ((data)->responseToken) {
838 free_octet_string((data)->responseToken);
839 free((data)->responseToken);
840 (data)->responseToken = NULL;
842 if ((data)->mechListMIC) {
843 free_octet_string((data)->mechListMIC);
844 free((data)->mechListMIC);
845 (data)->mechListMIC = NULL;