Commit 153ea46b authored by 's avatar
Browse files

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 ...@@ -13,7 +13,8 @@ TARGETS=authd
OBJS=shm_sync.o shm.o authd.o adm_ctrl.o arith_parser.o admctrl_comm.o 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 \ HEADERS=shm_sync.h shm.h adm_ctrl.h arith_parser.h argtypes.h config.h debug.h \
admctrl_comm.h ${LIB_HEADERS} 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) ifeq (${WITH_RESOURCE_CONTROL},1)
CFLAGS := ${CFLAGS} -DWITH_RESOURCE_CONTROL CFLAGS := ${CFLAGS} -DWITH_RESOURCE_CONTROL
......
...@@ -329,6 +329,15 @@ void *handle_request(void *arg) { ...@@ -329,6 +329,15 @@ void *handle_request(void *arg) {
dbuf->length = BASIC_SIZE; dbuf->length = BASIC_SIZE;
break; break;
#endif #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: default:
die("Default case found in handle_request loop!\n"); die("Default case found in handle_request loop!\n");
break; break;
......
...@@ -2237,8 +2237,7 @@ ret: ...@@ -2237,8 +2237,7 @@ ret:
return (size_t)enc_len; return (size_t)enc_len;
} }
int int mapi_set_authdata(int fd,const char *pub,const char *priv,const char *creds)
mapi_set_authdata(int fd,const char *pub,const char *priv,const char *creds)
{ {
struct mapiipcbuf qbuf; struct mapiipcbuf qbuf;
bytestream pubkey,credentials; bytestream pubkey,credentials;
......
...@@ -1844,6 +1844,13 @@ ret: ...@@ -1844,6 +1844,13 @@ ret:
mapiipc_daemon_write (&qbuf, sock); mapiipc_daemon_write (&qbuf, sock);
} }
/*
static void cmd_authenticate(int fd, int pid, unsigned char *data, int socket)
{
// do stuff
}
*/
static void static void
mapidcom () mapidcom ()
//Communicates with clients through IPC //Communicates with clients through IPC
...@@ -2111,6 +2118,9 @@ mapidcom () ...@@ -2111,6 +2118,9 @@ mapidcom ()
case CONNECT: case CONNECT:
cmd_connect (qbuf.fd, qbuf.pid, s); cmd_connect (qbuf.fd, qbuf.pid, s);
break; break;
/* case AUTHENTICATE:
cmd_authenticate(qbuf.fd, qbuf.pid, qbuf.data, s);
break;*/
case SET_AUTHDATA: case SET_AUTHDATA:
cmd_set_authdata (qbuf.fd, qbuf.pid, qbuf.data, s); cmd_set_authdata (qbuf.fd, qbuf.pid, qbuf.data, s);
break; break;
......
...@@ -50,6 +50,8 @@ typedef enum { ...@@ -50,6 +50,8 @@ typedef enum {
CREATE_OFFLINE_FLOW_ACK, CREATE_OFFLINE_FLOW_ACK,
SET_AUTHDATA, SET_AUTHDATA,
SET_AUTHDATA_ACK, SET_AUTHDATA_ACK,
/* AUTHENTICATE,
AUTHENTICATE_ACK,*/
LOAD_LIBRARY, LOAD_LIBRARY,
LOAD_LIBRARY_ACK, LOAD_LIBRARY_ACK,
GET_AVAILIBLE_DEVICES, 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