home *** CD-ROM | disk | FTP | other *** search
/ PC/CD Gamer UK 29 / PCGAMER29.bin / wincim / scripts.lib / SECLOG.SCR < prev    next >
Text File  |  1995-09-13  |  2KB  |  78 lines

  1. !
  2. !  Copyright (c) 1995
  3. !  by CompuServe Incorporated, Columbus, Ohio
  4. !
  5. !  The information in this software is subject to change without
  6. !  notice and should not be construed as a commitment by CompuServe.
  7. !
  8. !  SECLOG:
  9. !    Handles secure login.
  10. !
  11. !+V
  12. ! "3.6"
  13. !-V
  14.  
  15.     define %SecFailTemp = "";
  16.     define %LF = "^J";
  17.  
  18.     wait
  19.         "."    goto Host_Challenge_Received
  20.     until 100;
  21.     goto Timeout;
  22.  
  23. Host_Challenge_Received:
  24.     HostChallenge = %Scanned;
  25.  
  26.     send "RB:" & %CR & %LF & %MicroChallenge & "." & %CR & %LF;
  27.  
  28.     define %UserResponse = "";
  29.     encode HostChallenge, %MicroChallenge, %Password, %UserResponse;
  30.  
  31.     if %UserResponse <> "" goto Send_Micro_Response;
  32.  
  33.     define %SecFailTemp = "Application error, out of resources";
  34.     define %ErrorCode = 33;
  35.     exit %Failure;
  36.  
  37. Send_Micro_Response:
  38.     send "UR:" & %CR & %LF & %UserResponse & "." & %CR & %LF;
  39.  
  40.     wait
  41.         "No."    goto Response_Refused,
  42.         "HR:"    goto Handle_Host_Response
  43.     until 100;
  44.     goto Timeout;
  45.  
  46. Response_Refused:
  47.     define %SecFailTemp = "Incorrect User ID or password";
  48.     define %ErrorCode = 34;
  49.     exit %Failure;
  50.  
  51.  
  52. Handle_Host_Response:
  53.  
  54.     wait
  55.         "." goto Host_Response_Received
  56.     until 100;
  57.  
  58. Timeout:
  59.     define %SecFailTemp = "Host not responding to secure login request";
  60.     define %ErrorCode = 32;
  61.     exit %Failure;
  62.  
  63.  
  64. Host_Response_Received:
  65.     define %HostResponse = %Scanned;
  66.     define %Approved = 0;
  67.  
  68.     approve HostChallenge, %MicroChallenge, %Password, %HostResponse, %Approved;
  69.  
  70.     if %Approved <> 0 goto Host_Response_Approved;
  71.  
  72.     define %SecFailTemp = "Secure response from host was invalid";
  73.     define %ErrorCode = 35;
  74.     exit %Failure;
  75.  
  76. Host_Response_Approved:
  77.     exit %Success;
  78.