Lines Matching refs:data
36 void *data;
177 encode_MechType(unsigned char *p, size_t len, const MechType * data, size_t * size)
183 e = encode_oid(p, len, data, &l);
192 decode_MechType(const unsigned char *p, size_t len, MechType * data, size_t * size)
198 memset(data, 0, sizeof(*data));
199 e = decode_oid(p, len, data, &l);
205 free_MechType(data);
210 free_MechType(MechType * data)
212 free_oid(data);
225 encode_MechTypeList(unsigned char *p, size_t len, const MechTypeList * data, size_t * size)
231 for (i = (data)->len - 1; i >= 0; --i) {
234 e = encode_MechType(p, len, &(data)->val[i], &l);
245 decode_MechTypeList(const unsigned char *p, size_t len, MechTypeList * data, size_t * size)
251 memset(data, 0, sizeof(*data));
262 (data)->len = 0;
263 (data)->val = NULL;
265 void *old = (data)->val;
266 (data)->len++;
267 (data)->val = realloc((data)->val, sizeof(*((data)->val)) * (data)->len);
268 if ((data)->val == NULL) {
269 (data)->val = old;
270 (data)->len--;
273 e = decode_MechType(p, len, &(data)->val[(data)->len - 1], &l);
283 free_MechTypeList(data);
288 free_MechTypeList(MechTypeList * data)
290 while ((data)->len) {
291 free_MechType(&(data)->val[(data)->len - 1]);
292 (data)->len--;
294 free((data)->val);
295 (data)->val = NULL;
308 encode_ContextFlags(unsigned char *p, size_t len, const ContextFlags * data, size_t * size)
328 if (data->integFlag)
330 if (data->confFlag)
332 if (data->anonFlag)
334 if (data->sequenceFlag)
336 if (data->replayFlag)
338 if (data->mutualFlag)
340 if (data->delegFlag)
355 decode_ContextFlags(const unsigned char *p, size_t len, ContextFlags * data, size_t * size)
361 memset(data, 0, sizeof(*data));
371 data->delegFlag = (*p >> 7) & 1;
372 data->mutualFlag = (*p >> 6) & 1;
373 data->replayFlag = (*p >> 5) & 1;
374 data->sequenceFlag = (*p >> 4) & 1;
375 data->anonFlag = (*p >> 3) & 1;
376 data->confFlag = (*p >> 2) & 1;
377 data->integFlag = (*p >> 1) & 1;
383 free_ContextFlags(data);
388 free_ContextFlags(ContextFlags * data)
390 (void)data;
414 encode_NegTokenInit(unsigned char *p, size_t len, const NegTokenInit * data, size_t * size)
420 if ((data)->mechListMIC) {
423 e = encode_octet_string(p, len, (data)->mechListMIC, &l);
429 if ((data)->mechToken) {
432 e = encode_octet_string(p, len, (data)->mechToken, &l);
438 if ((data)->reqFlags) {
441 e = encode_ContextFlags(p, len, (data)->reqFlags, &l);
449 e = encode_MechTypeList(p, len, &(data)->mechTypes, &l);
462 decode_NegTokenInit(const unsigned char *p, size_t len, NegTokenInit * data, size_t * size)
468 memset(data, 0, sizeof(*data));
493 e = decode_MechTypeList(p, len, &(data)->mechTypes, &l);
508 (data)->reqFlags = NULL;
520 (data)->reqFlags = malloc(sizeof(*(data)->reqFlags));
521 if ((data)->reqFlags == NULL)
523 e = decode_ContextFlags(p, len, (data)->reqFlags, &l);
538 (data)->mechToken = NULL;
550 (data)->mechToken = malloc(sizeof(*(data)->mechToken));
551 if ((data)->mechToken == NULL)
553 e = decode_octet_string(p, len, (data)->mechToken, &l);
568 (data)->mechListMIC = NULL;
580 (data)->mechListMIC = malloc(sizeof(*(data)->mechListMIC));
581 if ((data)->mechListMIC == NULL)
583 e = decode_octet_string(p, len, (data)->mechListMIC, &l);
602 free_NegTokenInit(data);
607 free_NegTokenInit(NegTokenInit * data)
609 free_MechTypeList(&(data)->mechTypes);
610 if ((data)->reqFlags) {
611 free_ContextFlags((data)->reqFlags);
612 free((data)->reqFlags);
613 (data)->reqFlags = NULL;
615 if ((data)->mechToken) {
616 free_octet_string((data)->mechToken);
617 free((data)->mechToken);
618 (data)->mechToken = NULL;
620 if ((data)->mechListMIC) {
621 free_octet_string((data)->mechListMIC);
622 free((data)->mechListMIC);
623 (data)->mechListMIC = NULL;
637 encode_NegTokenResp(unsigned char *p, size_t len, const NegTokenResp * data, size_t * size)
643 if ((data)->mechListMIC) {
646 e = encode_octet_string(p, len, (data)->mechListMIC, &l);
652 if ((data)->responseToken) {
655 e = encode_octet_string(p, len, (data)->responseToken, &l);
661 if ((data)->supportedMech) {
664 e = encode_MechType(p, len, (data)->supportedMech, &l);
670 if ((data)->negState) {
673 e = encode_enumerated(p, len, (data)->negState, &l);
686 decode_NegTokenResp(const unsigned char *p, size_t len, NegTokenResp * data, size_t * size)
692 memset(data, 0, sizeof(*data));
705 (data)->negState = NULL;
717 (data)->negState = malloc(sizeof(*(data)->negState));
718 if ((data)->negState == NULL)
720 e = decode_enumerated(p, len, (data)->negState, &l);
735 (data)->supportedMech = NULL;
747 (data)->supportedMech = malloc(sizeof(*(data)->supportedMech));
748 if ((data)->supportedMech == NULL)
750 e = decode_MechType(p, len, (data)->supportedMech, &l);
765 (data)->responseToken = NULL;
777 (data)->responseToken = malloc(sizeof(*(data)->responseToken));
778 if ((data)->responseToken == NULL)
780 e = decode_octet_string(p, len, (data)->responseToken, &l);
795 (data)->mechListMIC = NULL;
807 (data)->mechListMIC = malloc(sizeof(*(data)->mechListMIC));
808 if ((data)->mechListMIC == NULL)
810 e = decode_octet_string(p, len, (data)->mechListMIC, &l);
829 free_NegTokenResp(data);
834 free_NegTokenResp(NegTokenResp * data)
836 if ((data)->negState) {
837 free((data)->negState);
838 (data)->negState = NULL;
840 if ((data)->supportedMech) {
841 free_MechType((data)->supportedMech);
842 free((data)->supportedMech);
843 (data)->supportedMech = NULL;
845 if ((data)->responseToken) {
846 free_octet_string((data)->responseToken);
847 free((data)->responseToken);
848 (data)->responseToken = NULL;
850 if ((data)->mechListMIC) {
851 free_octet_string((data)->mechListMIC);
852 free((data)->mechListMIC);
853 (data)->mechListMIC = NULL;