Commit 2a31d041 authored by ASN.1 Documenter's avatar ASN.1 Documenter
Browse files

initial commit

parent 24555cd9
Loading
Loading
Loading
Loading

Makefile

0 → 100755
+2 −0
Original line number Original line Diff line number Diff line
all clean:
	$(MAKE) -C certgen $@

certgen/Makefile

0 → 100755
+21 −0
Original line number Original line Diff line number Diff line
######################################################################
##
##  Created by: Denis Filatov
##
##  Copyleft (c) 2015
##  This code is provided under the CeCill-C license agreement.
######################################################################
PROJECTROOT    = ..
BUILDROOT      = ../build
PROJECT        = certgen
DEBUG          = yes
bins           = certgen keygen
sources       := certgen.c ecc_openssl.c mkgmtime.c
cflags        += -Wno-pointer-sign -Wno-enum-compare
sources-WIN32  := applink.c
#sources-CYGWIN := applink.c
packages      += cshared openssl
predirs       := asncodec
includes      += asncodec
libs          += $(outdir)/libItsCertAsn.a
include ../common.mk

certgen/applink.c

0 → 100755
+102 −0
Original line number Original line Diff line number Diff line
#define _CRT_SECURE_NO_WARNINGS
#define APPLINK_STDIN	1
#define APPLINK_STDOUT	2
#define APPLINK_STDERR	3
#define APPLINK_FPRINTF	4
#define APPLINK_FGETS	5
#define APPLINK_FREAD	6
#define APPLINK_FWRITE	7
#define APPLINK_FSETMOD	8
#define APPLINK_FEOF	9
#define APPLINK_FCLOSE 	10	/* should not be used */

#define APPLINK_FOPEN	11	/* solely for completeness */
#define APPLINK_FSEEK	12
#define APPLINK_FTELL	13
#define APPLINK_FFLUSH	14
#define APPLINK_FERROR	15
#define APPLINK_CLEARERR 16
#define APPLINK_FILENO	17	/* to be used with below */

#define APPLINK_OPEN	18	/* formally can't be used, as flags can vary */
#define APPLINK_READ	19
#define APPLINK_WRITE	20
#define APPLINK_LSEEK	21
#define APPLINK_CLOSE	22
#define APPLINK_MAX	22	/* always same as last macro */

#ifndef APPMACROS_ONLY
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#ifdef _MSC_VER
#define fileno _fileno
#define open _open
#define read _read
#define write _write
#define lseek _lseek
#define close _close
#else
#include <unistd.h>
#endif
static void *app_stdin(void)		{ return stdin;  }
static void *app_stdout(void)		{ return stdout; }
static void *app_stderr(void)		{ return stderr; }
static int   app_feof(FILE *fp)		{ return feof(fp); }
static int   app_ferror(FILE *fp)	{ return ferror(fp); }
static void  app_clearerr(FILE *fp)	{ clearerr(fp); }
static int   app_fileno(FILE *fp)	{ return fileno(fp); }
static int   app_fsetmod(FILE *fp,char mod) { return _setmode (fileno(fp),mod=='b'?O_BINARY:O_TEXT); }
#ifdef __cplusplus
extern "C" {
#endif

__declspec(dllexport)
void **
#if defined(__BORLANDC__)
__stdcall	/* __stdcall appears to be the only way to get the name
		 * decoration right with Borland C. Otherwise it works
		 * purely incidentally, as we pass no parameters. */
#else
__cdecl
#endif
OPENSSL_Applink(void)
{ static int once=1;
  static void *OPENSSL_ApplinkTable[APPLINK_MAX+1]={(void *)APPLINK_MAX};

    if (once)
    {	OPENSSL_ApplinkTable[APPLINK_STDIN]	= app_stdin;
	OPENSSL_ApplinkTable[APPLINK_STDOUT]	= app_stdout;
	OPENSSL_ApplinkTable[APPLINK_STDERR]	= app_stderr;
	OPENSSL_ApplinkTable[APPLINK_FPRINTF]	= fprintf;
	OPENSSL_ApplinkTable[APPLINK_FGETS]	= fgets;
	OPENSSL_ApplinkTable[APPLINK_FREAD]	= fread;
	OPENSSL_ApplinkTable[APPLINK_FWRITE]	= fwrite;
	OPENSSL_ApplinkTable[APPLINK_FSETMOD]	= app_fsetmod;
	OPENSSL_ApplinkTable[APPLINK_FEOF]	= app_feof;
	OPENSSL_ApplinkTable[APPLINK_FCLOSE]	= fclose;

	OPENSSL_ApplinkTable[APPLINK_FOPEN]	= fopen;
	OPENSSL_ApplinkTable[APPLINK_FSEEK]	= fseek;
	OPENSSL_ApplinkTable[APPLINK_FTELL]	= ftell;
	OPENSSL_ApplinkTable[APPLINK_FFLUSH]	= fflush;
	OPENSSL_ApplinkTable[APPLINK_FERROR]	= app_ferror;
	OPENSSL_ApplinkTable[APPLINK_CLEARERR]	= app_clearerr;
	OPENSSL_ApplinkTable[APPLINK_FILENO]	= app_fileno;

	OPENSSL_ApplinkTable[APPLINK_OPEN]	= open;
	OPENSSL_ApplinkTable[APPLINK_READ]	= read;
	OPENSSL_ApplinkTable[APPLINK_WRITE]	= write;
	OPENSSL_ApplinkTable[APPLINK_LSEEK]	= lseek;
	OPENSSL_ApplinkTable[APPLINK_CLOSE]	= close;

	once = 0;
    }

  return OPENSSL_ApplinkTable;
}

#ifdef __cplusplus
}
#endif
#endif
+758 −0

File added.

Preview size limit exceeded, changes collapsed.

+60 −0
Original line number Original line Diff line number Diff line
/*
 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
 * From ASN.1 module "EtsiTs102941TrustLists"
 * 	found in "../asn1/EtsiTs102941/EtsiTs102941TrustLists.asn"
 * 	`asn1c -S ../../asn1c/skeletons -fcompound-names -no-gen-PER -gen-autotools -pdu=EtsiTs103097Data -pdu=EnrolmentRequestMessage -pdu=EnrolmentResponseMessage -pdu=AuthorizationRequestMessage -pdu=AuthorizationRequestMessageWithPop -pdu=AuthorizationResponseMessage -pdu=CertificateRevocationListMessage -pdu=TlmCertificateTrustListMessage -pdu=RcaCertificateTrustListMessage -pdu=AuthorizationValidationRequestMessage -pdu=AuthorizationValidationResponseMessage -pdu=CaCertificateRequestMessage`
 */

#include "AaEntry.h"

asn_TYPE_member_t asn_MBR_AaEntry_1[] = {
	{ ATF_NOFLAGS, 0, offsetof(struct AaEntry, aaCertificate),
		(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_EtsiTs103097Certificate,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"aaCertificate"
		},
	{ ATF_NOFLAGS, 0, offsetof(struct AaEntry, accessPoint),
		(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
		-1,	/* IMPLICIT tag at current level */
		&asn_DEF_Url,
		0,
		{ 0, 0, 0 },
		0, 0, /* No default value */
		"accessPoint"
		},
};
static const ber_tlv_tag_t asn_DEF_AaEntry_tags_1[] = {
	(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_AaEntry_tag2el_1[] = {
    { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* aaCertificate */
    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* accessPoint */
};
asn_SEQUENCE_specifics_t asn_SPC_AaEntry_specs_1 = {
	sizeof(struct AaEntry),
	offsetof(struct AaEntry, _asn_ctx),
	asn_MAP_AaEntry_tag2el_1,
	2,	/* Count of tags in the map */
	0, 0, 0,	/* Optional elements (not needed) */
	-1,	/* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_AaEntry = {
	"AaEntry",
	"AaEntry",
	&asn_OP_SEQUENCE,
	asn_DEF_AaEntry_tags_1,
	sizeof(asn_DEF_AaEntry_tags_1)
		/sizeof(asn_DEF_AaEntry_tags_1[0]), /* 1 */
	asn_DEF_AaEntry_tags_1,	/* Same as above */
	sizeof(asn_DEF_AaEntry_tags_1)
		/sizeof(asn_DEF_AaEntry_tags_1[0]), /* 1 */
	{ 0, 0, SEQUENCE_constraint },
	asn_MBR_AaEntry_1,
	2,	/* Elements count */
	&asn_SPC_AaEntry_specs_1	/* Additional specs */
};
Loading