15 #define DISABLE_DEBUGLOG
18 #include "sigtail_p.h"
20 #include <gwenhywfar/misc.h>
21 #include <gwenhywfar/debug.h>
22 #include <gwenhywfar/tag16.h>
43 if (st->pSignature && st->lSignature)
68 const char *subtagPtr;
80 if (subtagLen && subtagPtr) {
82 case GWEN_SIGTAIL_TLV_SIGNATURE:
83 st->pSignature=(uint8_t*)malloc(subtagLen);
84 memmove(st->pSignature, subtagPtr, subtagLen);
85 st->lSignature=subtagLen;
88 case GWEN_SIGTAIL_TLV_SIGNUM:
89 if (sscanf(subtagPtr,
"%d", &i)==1)
90 st->signatureNumber=i;
120 if (st->pSignature && st->lSignature)
122 (
const char*)st->pSignature,
126 snprintf(numbuf,
sizeof(numbuf),
"%d", st->signatureNumber);
142 return st->pSignature;
149 return st->lSignature;
156 if (st->pSignature && st->lSignature)
157 free(st->pSignature);
159 st->pSignature=(uint8_t*)malloc(l);
160 memmove(st->pSignature, p, l);
173 return st->signatureNumber;
180 st->signatureNumber=i;
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
int GWEN_SigTail_GetSignatureNumber(const GWEN_SIGTAIL *st)
void GWEN_SigTail_SetSignatureNumber(GWEN_SIGTAIL *st, int i)
#define GWEN_FREE_OBJECT(varname)
#define DBG_WARN(dbg_logger, format, args...)
void GWEN_SigTail_SetSignature(GWEN_SIGTAIL *st, const uint8_t *p, uint32_t l)
unsigned int GWEN_Tag16_GetTagSize(const GWEN_TAG16 *tlv)
uint32_t GWEN_Buffer_GetPos(const GWEN_BUFFER *bf)
struct GWEN_TAG16 GWEN_TAG16
void GWEN_Tag16_DirectlyToBuffer(unsigned int tagType, const char *p, int size, GWEN_BUFFER *buf)
GWEN_SIGTAIL * GWEN_SigTail_new(void)
const void * GWEN_Tag16_GetTagData(const GWEN_TAG16 *tlv)
#define GWEN_NEW_OBJECT(typ, varname)
struct GWEN_SIGTAIL GWEN_SIGTAIL
const uint8_t * GWEN_SigTail_GetSignaturePtr(const GWEN_SIGTAIL *st)
int GWEN_Buffer_AppendByte(GWEN_BUFFER *bf, char c)
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
unsigned int GWEN_Tag16_GetTagLength(const GWEN_TAG16 *tlv)
unsigned int GWEN_Tag16_GetTagType(const GWEN_TAG16 *tlv)
int GWEN_SigTail_toBuffer(const GWEN_SIGTAIL *st, GWEN_BUFFER *buf, uint8_t tagType)
#define DBG_INFO(dbg_logger, format, args...)
uint32_t GWEN_SigTail_GetSignatureLen(const GWEN_SIGTAIL *st)
#define GWEN_LIST_INIT(t, element)
GWEN_SIGTAIL * GWEN_SigTail_fromBuffer(const uint8_t *p, uint32_t l)
#define GWEN_LIST_FUNCTIONS(t, pr)
void GWEN_SigTail_free(GWEN_SIGTAIL *st)
void GWEN_Tag16_free(GWEN_TAG16 *tlv)
#define GWEN_LIST_FINI(t, element)
GWEN_TAG16 * GWEN_Tag16_fromBuffer2(const uint8_t *p, uint32_t l, int doCopy)