AuthenticationP14V2ServerImpl.Mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
Generated by Demers.pa at January 6, 1987 4:10:39 pm PST
using Sirocco [2.0] of January 6, 1987 4:07:33 pm PST
DIRECTORY
CrRPC,
TimeP15V2,
CHNameP2V0,
AuthenticationP14V2;
AuthenticationP14V2ServerImpl:
CEDAR
PROGRAM
IMPORTS CrRPC, AuthenticationP14V2 ~ {
OPEN AuthenticationP14V2;
CheckSimpleCredentialsCaller:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
credentials: Credentials;
verifier: SeqWords;
ok: BOOLEAN;
{
credentials.type ← VAL[CrRPC.GetCard16[s]];
credentials.value ← UProc8[h, s];
};
{
verifier ← UProc8[h, s];
};
[ok] ← CheckSimpleCredentials[h, credentials, verifier];
beginReturn[h];
{
CrRPC.PutBool[s, ok];
};
};
ChangeStrongKeyCaller:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
credentials: Credentials;
verifier: SeqWords;
newKey: Block;
{
credentials.type ← VAL[CrRPC.GetCard16[s]];
credentials.value ← UProc8[h, s];
};
{
verifier ← UProc8[h, s];
};
{
FOR i9:
CARDINAL
IN [0..4)
DO
newKey[i9] ← CrRPC.GetCard16[s];
ENDLOOP;
};
[] ← ChangeStrongKey[h, credentials, verifier, newKey];
beginReturn[h];
};
DeleteStrongKeyCaller:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
credentials: Credentials;
verifier: SeqWords;
name: CHNameP2V0.ThreePartName;
{
credentials.type ← VAL[CrRPC.GetCard16[s]];
credentials.value ← UProc8[h, s];
};
{
verifier ← UProc8[h, s];
};
{
name.organization ← CrRPC.GetRope[s];
name.domain ← CrRPC.GetRope[s];
name.object ← CrRPC.GetRope[s];
};
[] ← DeleteStrongKey[h, credentials, verifier, name];
beginReturn[h];
};
CreateStrongKeyCaller:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
credentials: Credentials;
verifier: SeqWords;
name: CHNameP2V0.ThreePartName;
key: Block;
{
credentials.type ← VAL[CrRPC.GetCard16[s]];
credentials.value ← UProc8[h, s];
};
{
verifier ← UProc8[h, s];
};
{
name.organization ← CrRPC.GetRope[s];
name.domain ← CrRPC.GetRope[s];
name.object ← CrRPC.GetRope[s];
};
{
FOR i10:
CARDINAL
IN [0..4)
DO
key[i10] ← CrRPC.GetCard16[s];
ENDLOOP;
};
[] ← CreateStrongKey[h, credentials, verifier, name, key];
beginReturn[h];
};
ChangeSimpleKeyCaller:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
credentials: Credentials;
verifier: SeqWords;
newKey: CARD16;
{
credentials.type ← VAL[CrRPC.GetCard16[s]];
credentials.value ← UProc8[h, s];
};
{
verifier ← UProc8[h, s];
};
{
newKey ← CrRPC.GetCard16[s];
};
[] ← ChangeSimpleKey[h, credentials, verifier, newKey];
beginReturn[h];
};
DeleteSimpleKeyCaller:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
credentials: Credentials;
verifier: SeqWords;
name: CHNameP2V0.ThreePartName;
{
credentials.type ← VAL[CrRPC.GetCard16[s]];
credentials.value ← UProc8[h, s];
};
{
verifier ← UProc8[h, s];
};
{
name.organization ← CrRPC.GetRope[s];
name.domain ← CrRPC.GetRope[s];
name.object ← CrRPC.GetRope[s];
};
[] ← DeleteSimpleKey[h, credentials, verifier, name];
beginReturn[h];
};
CreateSimpleKeyCaller:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
credentials: Credentials;
verifier: SeqWords;
name: CHNameP2V0.ThreePartName;
key: CARD16;
{
credentials.type ← VAL[CrRPC.GetCard16[s]];
credentials.value ← UProc8[h, s];
};
{
verifier ← UProc8[h, s];
};
{
name.organization ← CrRPC.GetRope[s];
name.domain ← CrRPC.GetRope[s];
name.object ← CrRPC.GetRope[s];
};
{
key ← CrRPC.GetCard16[s];
};
[] ← CreateSimpleKey[h, credentials, verifier, name, key];
beginReturn[h];
};
GetStrongCredentialsCaller:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
initiator: CHNameP2V0.ThreePartName;
recipient: CHNameP2V0.ThreePartName;
nonce: CARD32;
encryptedCredentialsPackage: SeqWords;
{
initiator.organization ← CrRPC.GetRope[s];
initiator.domain ← CrRPC.GetRope[s];
initiator.object ← CrRPC.GetRope[s];
};
{
recipient.organization ← CrRPC.GetRope[s];
recipient.domain ← CrRPC.GetRope[s];
recipient.object ← CrRPC.GetRope[s];
};
{
nonce ← CrRPC.GetCard32[s];
};
[encryptedCredentialsPackage] ← GetStrongCredentials[h, initiator, recipient, nonce];
beginReturn[h];
{
MProc11[h, s, encryptedCredentialsPackage];
};
};
Server: CrRPC.ServerProc ~ {
[h: Handle, s: STREAM, pgm: CARD32, pgmVersion: CARD16, proc: CARD16, beginReturn: BeginReturnProc, beginError: BeginErrorProc, beginReject: BeginRejectProc]
ENABLE {
AuthenticationP14V2.CallError => {
-- (1 )
beginError[h, 1 ];
CrRPC.PutCard16[s, ORD[problem]];
CrRPC.PutCard16[s, ORD[whichArg]];
GOTO Finished;
};
AuthenticationP14V2.AuthenticationError => {
-- (2 )
beginError[h, 2 ];
CrRPC.PutCard16[s, ORD[problem]];
GOTO Finished;
};
};
IF (pgmVersion # 2)
THEN {
beginReject[h, CrRPC.noSuchVersion];
CrRPC.PutCard16[s, 2]; --low
CrRPC.PutCard16[s, 2]; --high
RETURN
};
SELECT proc
FROM
2 => CheckSimpleCredentialsCaller[h, s, beginReturn];
4 => ChangeStrongKeyCaller[h, s, beginReturn];
5 => DeleteStrongKeyCaller[h, s, beginReturn];
3 => CreateStrongKeyCaller[h, s, beginReturn];
7 => ChangeSimpleKeyCaller[h, s, beginReturn];
8 => DeleteSimpleKeyCaller[h, s, beginReturn];
6 => CreateSimpleKeyCaller[h, s, beginReturn];
1 => GetStrongCredentialsCaller[h, s, beginReturn];
ENDCASE => {
beginReject[h, CrRPC.noSuchProcedure];
};
EXITS
Finished => { NULL };
};
Unmarshal / Marshal Procs --
UProc8:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM]
RETURNS [res: SeqWords] ~ {
{
length13: CARDINAL ~ CrRPC.GetCard16[s];
res ← NEW[SeqWordsObject[length13]];
FOR i12:
CARDINAL
IN [0..length13)
DO
res.body[i12] ← CrRPC.GetCard16[s];
ENDLOOP;
};
};
MProc11:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM, val: SeqWords] ~ {
CrRPC.PutCard16[s, val.length];
FOR i14:
CARDINAL
IN [0..val.length)
DO
CrRPC.PutCard16[s, val.body[i14]];
ENDLOOP;
};
CrRPC.RegisterServerProc[pgm~14, serverProc~Server, pgmVersion~2];
CrRPC.EnsureListener[class~$SPP];
}...