Commit 153ea46b authored by 's avatar

Started writing functions to support authentication scheme.


git-svn-id: file:///home/svn/mapi/trunk@371 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 2f9cfb66
......@@ -13,7 +13,8 @@ TARGETS=authd
OBJS=shm_sync.o shm.o authd.o adm_ctrl.o arith_parser.o admctrl_comm.o
HEADERS=shm_sync.h shm.h adm_ctrl.h arith_parser.h argtypes.h config.h debug.h \
admctrl_comm.h ${LIB_HEADERS}
LIBS=-L${KEYNOTE_LIB} -lkeynote -lcrypto -lm
#LIBS=-L${KEYNOTE_LIB} -lkeynote -lcrypto -lm
LIBS=-L/usr/lib -lkeynote -lcrypto -lm
ifeq (${WITH_RESOURCE_CONTROL},1)
CFLAGS := ${CFLAGS} -DWITH_RESOURCE_CONTROL
......
......@@ -329,6 +329,15 @@ void *handle_request(void *arg) {
dbuf->length = BASIC_SIZE;
break;
#endif
case AUTHENTICATE:
fprintf(stdout, "AUTHENTICATE\n");
/* if(!agent_authenticate(dbuf))
dbuf->cmd = AUTHENTICATE_ACK;
else
dbuf->cmd = ERROR_ACK;
dbuf->length = BASIC_SIZE;*/
break;
default:
die("Default case found in handle_request loop!\n");
break;
......
......@@ -2237,8 +2237,7 @@ ret:
return (size_t)enc_len;
}
int
mapi_set_authdata(int fd,const char *pub,const char *priv,const char *creds)
int mapi_set_authdata(int fd,const char *pub,const char *priv,const char *creds)
{
struct mapiipcbuf qbuf;
bytestream pubkey,credentials;
......
......@@ -1844,6 +1844,13 @@ ret:
mapiipc_daemon_write (&qbuf, sock);
}
/*
static void cmd_authenticate(int fd, int pid, unsigned char *data, int socket)
{
// do stuff
}
*/
static void
mapidcom ()
//Communicates with clients through IPC
......@@ -2111,6 +2118,9 @@ mapidcom ()
case CONNECT:
cmd_connect (qbuf.fd, qbuf.pid, s);
break;
/* case AUTHENTICATE:
cmd_authenticate(qbuf.fd, qbuf.pid, qbuf.data, s);
break;*/
case SET_AUTHDATA:
cmd_set_authdata (qbuf.fd, qbuf.pid, qbuf.data, s);
break;
......
......@@ -50,6 +50,8 @@ typedef enum {
CREATE_OFFLINE_FLOW_ACK,
SET_AUTHDATA,
SET_AUTHDATA_ACK,
/* AUTHENTICATE,
AUTHENTICATE_ACK,*/
LOAD_LIBRARY,
LOAD_LIBRARY_ACK,
GET_AVAILIBLE_DEVICES,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment