COMPILATION LISTING OF SEGMENT authenticate_ Compiled by: Multics PL/I Compiler, Release 32f, of October 9, 1989 Compiled at: Bull HN, Phoenix AZ, System-M Compiled on: 11/11/89 1009.3 mst Sat Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Bull Inc., 1987 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 6* * * 7* * Copyright (c) 1972 by Massachusetts Institute of * 8* * Technology and Honeywell Information Systems, Inc. * 9* * * 10* *********************************************************** */ 11 12 13 authenticate_: proc (resource_name) returns (char (3) aligned); 14 15 /* AUTHENTICATE_ - Generates a three-letter code which is a function of a tape 16* number. This code is placed on a sticker on each tape reel and disk pack. 17* When the operator is requested to mount a tape or pack, he is told the reel 18* number, and is required to type in the code from the sticker. Use of 19* authentication codes permits us to check up on the operator to make sure 20* that the correct tape or pack is mounted, and that a typing error or 21* one-character garble in a printed message does not lead to incorrect 22* mounting of a volume. The requirement for this feature is less severe if 23* automatic volume recognition and access checking are performed by the 24* operating system. 25* 26* The original program for generation authentication codes was written on 27* CTSS. A later version was written in BAL for the 360/67, by Dave Anderson. 28* This PL/I version by THVV, 5/72. 29* Modified 03/79 by C. D. Tavares for new RCP Resource Management to work 30* with volume names > 6 characters and to differentiate lower-case. 31* */ 32 33 dcl resource_name char (*) parameter; /* name of resource for which authentication required. */ 34 35 dcl name_temp char (32) varying, 36 (i, j) fixed bin, 37 letter_val fixed bin, 38 name_len fixed bin, 39 (factor_up, factor_down) fixed bin (34), 40 (hash_up, hash_down) fixed bin (71) init (0); /* Temporary hash sums */ 41 42 dcl auth_code char (3) aligned init ("???"); /* Returned value */ 43 44 dcl magic_constant fixed bin init (89); /* hashing divisor */ 45 46 dcl label_alphabet char (68) aligned int static init 47 ("0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ-----abcdefghijklmnopqrstuvwxyz"); 48 /* the extra dashes hold slots for other 49* punctuation we may later consider important */ 50 51 dcl NUMERICS char (10) aligned int static options (constant) initial 52 ("0123456789"); 53 54 dcl auth_code_alphabet char (20) aligned int static options (constant) initial 55 ("BCDFGHJKLMNPQRSTVWXY"); 56 57 58 dcl (divide, mod, substr, index, length, verify) builtin; 59 60 /* -------------------------------------- */ 61 62 name_temp = rtrim (resource_name); 63 64 /* for compatibility with old authentications, pad to six chars with spaces 65* if it is at all alphabetic */ 66 67 if length (name_temp) < 6 then 68 if verify (name_temp, NUMERICS) > 0 then 69 name_temp = name_temp || copy (" ", 6 - length (name_temp)); 70 71 factor_up = 1; 72 factor_down = 2 ** (length (name_temp) - 1); 73 74 do i = 1 to length (name_temp); /* Loop on chars in input. */ 75 letter_val = index (label_alphabet, substr (name_temp, i, 1)); 76 /* Translate letter to number. */ 77 if letter_val = 0 then letter_val = length (label_alphabet)+1; 78 /* Treat all unknown punctuation alike. */ 79 letter_val = letter_val - 1; /* normalize to zero origin for hash */ 80 81 /* Perform hashing function. */ 82 83 hash_up = hash_up + letter_val * factor_up; /* Shift each value left. */ 84 hash_down = hash_down + letter_val * factor_down; /* ... another hash sum, shifting opposite. */ 85 factor_up = factor_up + factor_up; /* Double factor_up, to shift another position. */ 86 factor_down = divide (factor_down, 2, 34, 0); 87 /* Halve factor_down to shift one less. */ 88 end; 89 90 hash_up = mod (hash_up, magic_constant) * magic_constant; /* Generate partial hash value. */ 91 hash_up = hash_up + mod (hash_down, magic_constant); /* Generate rest of hash value. */ 92 93 substr (auth_code, 3, 1) = substr (auth_code_alphabet, 1 + mod (hash_up, length (auth_code_alphabet)), 1); 94 hash_up = divide (hash_up, length (auth_code_alphabet), 70, 0); /* Take it base 20. */ 95 substr (auth_code, 2, 1) = substr (auth_code_alphabet, 1 + mod (hash_up, length (auth_code_alphabet)), 1); 96 hash_up = divide (hash_up, length (auth_code_alphabet), 70, 0); /* .. and turn it into letters. */ 97 substr (auth_code, 1, 1) = substr (auth_code_alphabet, 1 + mod (hash_up, length (auth_code_alphabet)), 1); 98 99 return (auth_code); /* All through. */ 100 101 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/11/89 0810.1 authenticate_.pl1 >spec>install>1112>authenticate_.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. NUMERICS 000005 constant char(10) initial dcl 51 ref 67 auth_code 000122 automatic char(3) initial dcl 42 set ref 42* 93* 95* 97* 99 auth_code_alphabet 000000 constant char(20) initial dcl 54 ref 93 93 94 95 95 96 97 97 divide builtin function dcl 58 ref 86 94 96 factor_down 000114 automatic fixed bin(34,0) dcl 35 set ref 72* 84 86* 86 factor_up 000113 automatic fixed bin(34,0) dcl 35 set ref 71* 83 85* 85 85 hash_down 000120 automatic fixed bin(71,0) initial dcl 35 set ref 35* 84* 84 91 hash_up 000116 automatic fixed bin(71,0) initial dcl 35 set ref 35* 83* 83 90* 90 91* 91 93 94* 94 95 96* 96 97 i 000111 automatic fixed bin(17,0) dcl 35 set ref 74* 75* index builtin function dcl 58 ref 75 label_alphabet 000010 constant char(68) initial dcl 46 ref 75 77 length builtin function dcl 58 ref 67 67 72 74 77 93 94 95 96 97 letter_val 000112 automatic fixed bin(17,0) dcl 35 set ref 75* 77 77* 79* 79 83 84 magic_constant 000123 automatic fixed bin(17,0) initial dcl 44 set ref 44* 90 90 91 mod builtin function dcl 58 ref 90 91 93 95 97 name_temp 000100 automatic varying char(32) dcl 35 set ref 62* 67 67 67* 67 67 72 74 75 resource_name parameter char packed unaligned dcl 33 ref 13 62 substr builtin function dcl 58 set ref 75 93* 93 95* 95 97* 97 verify builtin function dcl 58 ref 67 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. j automatic fixed bin(17,0) dcl 35 name_len automatic fixed bin(17,0) dcl 35 NAME DECLARED BY EXPLICIT CONTEXT. authenticate_ 000042 constant entry external dcl 13 NAMES DECLARED BY CONTEXT OR IMPLICATION. copy builtin function ref 67 rtrim builtin function ref 62 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 552 564 515 562 Length 730 515 12 127 34 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME authenticate_ 128 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME authenticate_ 000100 name_temp authenticate_ 000111 i authenticate_ 000112 letter_val authenticate_ 000113 factor_up authenticate_ 000114 factor_down authenticate_ 000116 hash_up authenticate_ 000120 hash_down authenticate_ 000122 auth_code authenticate_ 000123 magic_constant authenticate_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_char_temp call_ext_out return_mac mdfx3 shorten_stack ext_entry_desc divide_fx3 THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. decimal_exp_ NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 13 000036 35 000055 42 000060 44 000062 62 000064 67 000107 71 000146 72 000151 74 000177 75 000207 77 000220 79 000223 83 000225 84 000231 85 000235 86 000237 88 000242 90 000244 91 000253 93 000261 94 000266 95 000272 96 000276 97 000302 99 000306 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved