From a783811c74b0c6c8c8b8d5e77144514af80892d0 Mon Sep 17 00:00:00 2001 From: Sebastian Hammer Date: Tue, 7 Mar 1995 16:29:33 +0000 Subject: [PATCH] Added authentication stuff. --- asn/Makefile | 4 ++-- asn/proto.c | 23 +++++++++++++++++++++-- asn/test.c | 4 ++-- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/asn/Makefile b/asn/Makefile index e50fa31..3ea01f9 100644 --- a/asn/Makefile +++ b/asn/Makefile @@ -1,7 +1,7 @@ # Copyright (C) 1994, Index Data I/S # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile,v 1.2 1995-02-09 16:02:32 quinn Exp $ +# $Id: Makefile,v 1.3 1995-03-07 16:29:33 quinn Exp $ SHELL=/bin/sh INCLUDE=-I../include -I. -I../odr @@ -11,7 +11,7 @@ LIB=asn.a PO = proto.o CPP=cc -E -all: $(LIB) test +all: $(LIB) test: test.o $(LIB) ../odr/odr.a $(CC) $(CFLAGS) $(INCLUDE) -o test test.o $(LIB) ../odr/odr.a diff --git a/asn/proto.c b/asn/proto.c index 4113b36..60aba87 100644 --- a/asn/proto.c +++ b/asn/proto.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: proto.c,v $ - * Revision 1.6 1995-03-01 14:46:03 quinn + * Revision 1.7 1995-03-07 16:29:33 quinn + * Added authentication stuff. + * + * Revision 1.6 1995/03/01 14:46:03 quinn * Fixed protocol bug in 8777query. * * Revision 1.5 1995/02/14 11:54:22 quinn @@ -71,7 +74,7 @@ int z_InitRequest(ODR o, Z_InitRequest **p, int opt) 5, 0) && odr_implicit(o, odr_integer, &pp->maximumRecordSize, ODR_CONTEXT, 6, 0) && - odr_implicit(o, odr_visiblestring, &pp->idAuthentication, ODR_CONTEXT, + odr_explicit(o, odr_any, &pp->idAuthentication, ODR_CONTEXT, 7, 1) && odr_implicit(o, odr_visiblestring, &pp->implementationId, ODR_CONTEXT, 110, 1) && @@ -110,6 +113,22 @@ int z_InitResponse(ODR o, Z_InitResponse **p, int opt) odr_sequence_end(o); } +int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt) +{ + if (!odr_sequence_begin(o, p, sizeof(**p))) + return opt; + return + odr_visiblestring(o, &(*p)->user, 0) && + odr_visiblestring(o, &(*p)->password, 0) && + odr_visiblestring(o, &(*p)->account, 0) && + odr_sequence_end(o); +} + +int z_StrAuthentication(ODR o, char **p, int opt) +{ + return odr_visiblestring(o, p, opt); +} + /* ------------------------ SEARCH SERVICE ----------------------- */ int z_ElementSetName(ODR o, char **p, int opt) diff --git a/asn/test.c b/asn/test.c index e61e12e..280bc73 100644 --- a/asn/test.c +++ b/asn/test.c @@ -46,8 +46,8 @@ int main() apt.num_attributes=0; apt.attributeList = 0; apt.term = &term; - term.buf = "BARFOO"; - term.len = term.size = strlen(term.buf); + term.buf = (unsigned char*) "BARFOO"; + term.len = term.size = strlen((char*)term.buf); o.buf = buf; o.bp=o.buf; -- 1.7.10.4