home *** CD-ROM | disk | FTP | other *** search
/ Computer Buyer 1996 May / buyer-0596.iso / wincim / scripts.lib / SECLOG.SCR < prev    next >
Text File  |  1995-12-05  |  2KB  |  86 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. Returns 0=Success,1=Cancel,2=Failure,3=No Carrier
  10. !
  11. !+V
  12. ! "3.8.1"
  13. !-V
  14.  
  15. on cancel goto SecureCancel;
  16. define %SecFailTemp = "";
  17.  
  18.     wait
  19.         %mdm_Failure    goto No_Carrier,
  20.         "."        goto Host_Challenge_Received
  21.     until 200;
  22.     goto Timeout;
  23.  
  24. Host_Challenge_Received:
  25.     HostChallenge = %Scanned;
  26.  
  27.     send "RB:^M^J" & %MicroChallenge & ".^M^J";
  28.  
  29.     define %UserResponse = "";
  30.     encode HostChallenge, %MicroChallenge, %Password, %UserResponse;
  31.  
  32.     if %UserResponse <> "" goto Send_Micro_Response;
  33.  
  34.     send "^C";
  35.     define %SecFailTemp = "Incorrect User ID or password";
  36.     define %ErrorCode = 33;
  37.     exit 2;
  38.  
  39. Send_Micro_Response:
  40.     send "UR:^M^J" & %UserResponse & ".^M^J";
  41.  
  42.     wait
  43.         "No."        goto Response_Refused,
  44.         "HR:"        goto Handle_Host_Response,
  45.         %mdm_Failure    goto No_Carrier
  46.     until 200;
  47.     goto Timeout;
  48.  
  49. Response_Refused:
  50.     define %SecFailTemp = "Incorrect User ID or password";
  51.     define %ErrorCode = 34;
  52.     exit 2;
  53.  
  54.  
  55. Handle_Host_Response:
  56.     wait
  57.         %mdm_Failure    goto No_Carrier,
  58.         "."         goto Host_Response_Received
  59.     until 200;
  60.  
  61. Timeout:
  62.     define %SecFailTemp = "Host not responding to login request";
  63.     define %ErrorCode = 32;
  64.     exit 2;
  65.  
  66. Host_Response_Received:
  67.     define %HostResponse = %Scanned;
  68.     define %Approved = 0;
  69.  
  70.     approve HostChallenge, %MicroChallenge, %Password, %HostResponse, %Approved;
  71.  
  72.     if %Approved <> 0 goto Host_Response_Approved;
  73.  
  74.     define %SecFailTemp = "Secure response from host was invalid";
  75.     define %ErrorCode = 35;
  76.     exit 2;
  77.  
  78. No_Carrier:
  79.     exit 3;
  80.  
  81. Host_Response_Approved:
  82.     exit 0;
  83.  
  84. SecureCancel:
  85.     exit 1;
  86.