15#define DISABLE_DEBUGLOG
20#include <gwenhywfar/misc.h>
21#include <gwenhywfar/debug.h>
22#include <gwenhywfar/tag16.h>
71 const char *subtagPtr;
83 if (subtagLen && subtagPtr) {
85 case GWEN_SIGHEAD_TLV_KEYNAME:
86 sh->keyName=(
char *)malloc(subtagLen+1);
87 memmove(sh->keyName, subtagPtr, subtagLen);
88 sh->keyName[subtagLen]=0;
91 case GWEN_SIGHEAD_TLV_KEYNUM:
92 if (sscanf(subtagPtr,
"%d", &i)==1)
96 case GWEN_SIGHEAD_TLV_KEYVER:
97 if (sscanf(subtagPtr,
"%d", &i)==1)
101 case GWEN_SIGHEAD_TLV_DATETIME:
106 strncpy(dt, (
const char *) subtagPtr,
sizeof(dt)-1);
109 if (sh->dateTime==
NULL) {
124 case GWEN_SIGHEAD_TLV_SIGPROFILE:
125 if (sscanf(subtagPtr,
"%d", &i)==1)
126 sh->signatureProfile=i;
129 case GWEN_SIGHEAD_TLV_SIGNUM:
130 if (sscanf(subtagPtr,
"%d", &i)==1)
131 sh->signatureNumber=i;
165 snprintf(numbuf,
sizeof(numbuf),
"%d", sh->keyNumber);
168 snprintf(numbuf,
sizeof(numbuf),
"%d", sh->keyVersion);
182 snprintf(numbuf,
sizeof(numbuf),
"%d", sh->signatureProfile);
185 snprintf(numbuf,
sizeof(numbuf),
"%d", sh->signatureNumber);
212 sh->keyName=strdup(s);
222 return sh->keyNumber;
238 return sh->keyVersion;
274 return sh->signatureProfile;
282 sh->signatureProfile=i;
290 return sh->signatureNumber;
298 sh->signatureNumber=i;
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
uint32_t GWEN_Buffer_GetPos(const GWEN_BUFFER *bf)
void GWEN_Buffer_free(GWEN_BUFFER *bf)
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
int GWEN_Buffer_AppendByte(GWEN_BUFFER *bf, char c)
#define DBG_INFO(dbg_logger, format,...)
#define DBG_ERROR(dbg_logger, format,...)
#define DBG_WARN(dbg_logger, format,...)
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
struct GWEN_TIME GWEN_TIME
GWENHYWFAR_API int GWEN_Time_toUtcString(const GWEN_TIME *t, const char *tmpl, GWEN_BUFFER *buf)
GWENHYWFAR_API GWEN_TIME * GWEN_Time_fromUtcString(const char *s, const char *tmpl)
GWENHYWFAR_API void GWEN_Time_free(GWEN_TIME *t)
GWENHYWFAR_API GWEN_TIME * GWEN_Time_dup(const GWEN_TIME *t)
#define GWEN_LIST_FINI(t, element)
#define GWEN_LIST_FUNCTIONS(t, pr)
#define GWEN_LIST_INIT(t, element)
#define GWEN_FREE_OBJECT(varname)
#define GWEN_NEW_OBJECT(typ, varname)
void GWEN_SigHead_SetSignatureNumber(GWEN_SIGHEAD *sh, int i)
void GWEN_SigHead_SetDateTime(GWEN_SIGHEAD *sh, const GWEN_TIME *ti)
void GWEN_SigHead_SetSignatureProfile(GWEN_SIGHEAD *sh, int i)
int GWEN_SigHead_GetKeyVersion(const GWEN_SIGHEAD *sh)
const char * GWEN_SigHead_GetKeyName(const GWEN_SIGHEAD *sh)
GWEN_SIGHEAD * GWEN_SigHead_fromBuffer(const uint8_t *p, uint32_t l)
void GWEN_SigHead_SetKeyName(GWEN_SIGHEAD *sh, const char *s)
int GWEN_SigHead_GetKeyNumber(const GWEN_SIGHEAD *sh)
void GWEN_SigHead_SetKeyNumber(GWEN_SIGHEAD *sh, int i)
void GWEN_SigHead_SetKeyVersion(GWEN_SIGHEAD *sh, int i)
void GWEN_SigHead_free(GWEN_SIGHEAD *sh)
int GWEN_SigHead_GetSignatureProfile(const GWEN_SIGHEAD *sh)
GWEN_SIGHEAD * GWEN_SigHead_new(void)
const GWEN_TIME * GWEN_SigHead_GetDateTime(const GWEN_SIGHEAD *sh)
int GWEN_SigHead_GetSignatureNumber(const GWEN_SIGHEAD *sh)
int GWEN_SigHead_toBuffer(const GWEN_SIGHEAD *sh, GWEN_BUFFER *buf, uint8_t tagType)
struct GWEN_SIGHEAD GWEN_SIGHEAD
void GWEN_Tag16_DirectlyToBuffer(unsigned int tagType, const char *p, int size, GWEN_BUFFER *buf)
unsigned int GWEN_Tag16_GetTagLength(const GWEN_TAG16 *tag)
const void * GWEN_Tag16_GetTagData(const GWEN_TAG16 *tag)
void GWEN_Tag16_free(GWEN_TAG16 *tag)
unsigned int GWEN_Tag16_GetTagType(const GWEN_TAG16 *tag)
GWEN_TAG16 * GWEN_Tag16_fromBuffer2(const uint8_t *bufferPtr, uint32_t bufferLen, int doCopy)
unsigned int GWEN_Tag16_GetTagSize(const GWEN_TAG16 *tag)
struct GWEN_TAG16 GWEN_TAG16