[Spice-devel] [PATCH libcacard 04/45] Basic SimpleTLV encoding and decoding methods
Jakub Jelen
jjelen at redhat.com
Wed Aug 1 08:30:18 UTC 2018
On Tue, 2018-07-31 at 20:29 +0200, Marc-André Lureau wrote:
> Hi
>
> On Tue, Jul 31, 2018 at 4:49 PM, Jakub Jelen <jjelen at redhat.com>
> wrote:
> > * The source code is originally based on the OpenSC cac card
> > driver
> >
> > * The SimpleTLV encoding is used in various places of the CAC
> > cards to encode most of buffers in the card
> >
> > * The implementation is extended of structures representing the
> > SimpleTLV objects, that can be either static or dynamically
> > allocated. The dynamic one need to be recursivelly freed.
> >
> > * Dynamic structures can be created by mergig other provided
> > structures,
> > which is common in ACA, where all the responses are prefixed
> > with
> > applet information.
> >
> > Signed-off-by: Jakub Jelen <jjelen at redhat.com>
> > Reviewed-by: Robert Relyea <rrelyea at redhat.com>
> > ---
> > Makefile.am | 4 +
> > docs/libcacard.txt | 4 +
> > src/common.c | 49 ++++++++
> > src/common.h | 30 +++++
> > src/simpletlv.c | 272
> > +++++++++++++++++++++++++++++++++++++++++++++
> > src/simpletlv.h | 117 +++++++++++++++++++
> > 6 files changed, 476 insertions(+)
> > create mode 100644 src/common.c
> > create mode 100644 src/common.h
> > create mode 100644 src/simpletlv.c
> > create mode 100644 src/simpletlv.h
> >
> > diff --git a/Makefile.am b/Makefile.am
> > index eaae2c5..68aa16e 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -15,6 +15,8 @@ libcacard_la_SOURCES
> > = \
> > src/vcardt.c \
> > src/vcardt_internal.h \
> > src/vreader.c \
> > + src/common.c \
> > + src/simpletlv.c \
> > $(NULL)
> >
> > if ENABLE_PCSC
> > @@ -36,6 +38,8 @@ libcacard_include_HEADERS = \
> > src/vreader.h \
> > src/vreadert.h \
> > src/vscard_common.h \
> > + src/common.h \
> > + src/simpletlv.h \
>
> Since the symbols are not explicitely exported, I don't think you
> want
> to install the headers.
>
> Can touch on commit
True. Thanks.
--
Jakub Jelen
Software Engineer
Security Technologies
Red Hat, Inc.
More information about the Spice-devel
mailing list