.TITLE DOD_ERAPAT - Generate DoD security erase patterns .IDENT 'X-10' ; ;**************************************************************************** ;* * ;* COPYRIGHT © 1978-1990 * ;* DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. * ;* ALL RIGHTS RESERVED. * ;* * ;* THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED * ;* ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE * ;* INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER * ;* COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY * ;* OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY * ;* TRANSFERRED. * ;* * ;* THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE * ;* AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT * ;* CORPORATION. * ;* * ;* DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS * ;* SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. * ;* * ;* * ;**************************************************************************** ; ;++ ; ; Facility: ; ; VMS Executive ; ; Abstract: ; ; This routine generates security erase patterns which are used by user ; written programs to preclude the unauthorized disclosure of classified ; information. ; ; Envrionment: ; ; VAX/VMS, Kernel Mode System Service ; ; Author: ; ; Micheal T. Rhodes, October 1982 ; ;-- .SBTTL Declarations ; ; Include files: ; .LIBRARY /SYS$LIBRARY:LIB/ ; Automate inclusion of this macro ; library during the assembly. $ERADEF ; Define function codes $SSDEF ; Define status codes $SYSVECTORDEF ; Define system service vector offsets ; ; Assumptions: ; ASSUME ERA$K_MINTYPE EQ 1 ; Minimum and maximum values ASSUME ERA$K_MAXTYPE EQ 3 ; for valid types of media. ASSUME ERA$K_MEMORY EQ 1 ; Medium to erase is memory. ASSUME ERA$K_DISK EQ 2 ; Medium to erase is disk. ASSUME ERA$K_TAPE EQ 3 ; Medium to erase is tape. ; ; Equated symbols: ; TYPE = 4 ; Offset to TYPE parameter (value) COUNT = 8 ; Offset to COUNT parameter (value) PATADR = 12 ; Offset to PATADR parameter (address) ; ; Own Storage: ; DECLARE_PSECT EXEC$PAGED_DATA COUNT_VECTOR: ; Iteration counts for medium types .LONG 1 ; Main Memory iteration count .LONG 3 ; Disk Storage iteration count .LONG 2 ; Tape Storage iteration count PATTERNS: ; Storage type erasure patterns .LONG 0 ; Main memory erase pattern .LONG -1 ; Disk Storage erase pattern .LONG ^XDB6DB6DB ; Tape Storage erase pattern .SBTTL Documentation...Loadable image header and trailer ;++ ; ; Instruction to create an SYS$ERAPAT.EXE image that generates the ; DOD security erase patterns. ; ; Assemble this module: ; ; MACRO DOD_ERAPAT+SYS$LIBRARY:LIB.MLB/LIB ; ; Linking this module: ; ; $ LINK /NOSYSSHR/NOTRACEBACK - ; /SHARE=SYS$ERAPAT - ; /MAP=SYS$ERAPAT /FULL /CROSS - ; /SYMBOL=SYS$ERAPAT - ; SYS$INPUT/OPTION ; DOD_ERAPAT, - ; SYS$LIBRARY:STARLET/INCLUDE:(SYS$DOINIT),- ; SYS$SYSTEM:SYS.STB/SELECTIVE ; VECTOR_TABLE=SYS$SYSTEM:SYS.STB ; COLLECT=NONPAGED_READONLY_PSECTS/ATTRIBUTES=RESIDENT,- ; EXEC$NONPAGED_CODE ; COLLECT=NONPAGED_READWRITE_PSECTS/ATTRIBUTES=RESIDENT,- ; EXEC$NONPAGED_DATA ; COLLECT=PAGED_READONLY_PSECTS,- ; EXEC$PAGED_CODE ; COLLECT=PAGED_READWRITE_PSECTS,- ; EXEC$PAGED_DATA ; COLLECT=INITIALIZATION_PSECTS/ATTRIBUTES=INITIALIZATION_CODE,- ; EXEC$INIT_CODE,- ; EXEC$INIT_000,- ; EXEC$INIT_001,- ; EXEC$INIT_002,- ; EXEC$INIT_PFNTBL_000,- ; EXEC$INIT_PFNTBL_001,- ; EXEC$INIT_PFNTBL_002,- ; EXEC$INIT_SSTBL_000,- ; EXEC$INIT_SSTBL_001,- ; EXEC$INIT_SSTBL_002 ; ; Loader Information: ; ; Please refer to the V5.0 Release Notes or Introduction to ; VMS System Services Manual Appendix C on instructions to load ; an installation-specific system image. ; ; The following summarize the steps involed: ; ; 1. Copy SYS$ERAPAT.EXE images produced by the above link command ; to the SYS$LOADABLE_IMAGES directory (privilege required). ; ; 2. Add an entry for the SYS$ERAPAT.EXE image in the ; SYS$UPDATE:VMS$SYSTEM_IMAGES.IDX data file: ; ; SYSMAN SYS_LOADABLE ADD _LOCAL_ SYS$ERAPAT.EXE - ; /LOAD_STEP = SYSINIT - ; /SEVERITY = WARNING - ; /MESSAGE = "failure to load SYS$ERAPAT.EXE" ; ; 3. Invoke the SYS$UPDATE:VMS$SYSTEM_IMAGES.COM command procedure ; to generate a new system image data file (file name ; SYS$LOADABLE_IMAGES:VMS$SYSTEM_IMAGES.DATA). During the ; bootstrap, the system uses this data file to load the ; appropriate images. ; ; 4. Reboot the system, which will cause the new SYS$ERAPAT.EXE to ; be loaded into the system. Subsequent calls to the $ERAPAT ; system service will generate the DoD erase pattern. ; ;-- .SBTTL $ERAPAT System Service ;++ ; $ERAPAT ; ; Functional Description: ; ; To preclude the unauthorized disclosure of classified information, ; the caller iteratively invokes the $ERAPAT system service. Upon ; each invocation, the user increments the iteration count and the ; service returns an erasure pattern plus either SS$_NORMAL or ; SS$_NOTRAN (which indicates the declassification procedure is ; complete). ; ; Calling sequence: ; ; This routine should be called via a CALLS/G to EXE$ERAPAT. ; ; Input: ; ; TYPE(AP) Security erase type. The legal types are ; ; 1. ERA$K_MEMORY : main memory ; (volatile r/w semiconductor) ; 2. ERA$K_DISK : disk storage ; 3. ERA$K_TAPE : tape storage ; ; COUNT(AP) Iteration count. The service should be called ; the first time with the value 1, then 2, etc., ; until the status SS$_NOTRAN is returned. The ; local symbol MAXCOUNT defines how many times this ; happens. ; ; Output: ; ; PATADR(AP) Address of a longword into which the security ; erase pattern is to be written. ; ; Routine value: ; ; R0 = SS$_ACCVIO Pattern output area not accessible ; SS$_BADPARAM Invalid security type code ; SS$_NORMAL Normal successful completion ; SS$_NOTRAN Security erase complete ; ;-- DECLARE_PSECT EXEC$PAGED_CODE SYSTEM_SERVICE ERAPAT,- ; $ERAPAT entry point ,- MODE=KERNEL,- NARG=3 MOVQ R2,-(SP) ; Save R2/R3 MOVAB COUNT_VECTOR, R2 ; Get address of the count vector. MOVAB PATTERNS, R3 ; Get the storage type pattern vector. MOVZWL #SS$_BADPARAM, R0 ; Assume bad parameters. MOVL TYPE (AP), R4 ; Get the type code. CMPL R4, #ERA$K_MINTYPE ; Type code too small? BLSS EXIT ; Branch if yes. CMPL R4, #ERA$K_MAXTYPE ; Type code too large? BGTR EXIT ; Branch if it is. MOVL COUNT (AP), R1 ; Get the count. BLEQ EXIT ; Branch if too small. MOVZWL #SS$_NOTRAN, R0 ; Set completion status. SUBL2 #1, R4 ; Set index into the count vector. CMPL R1, (R2) [R4] ; Are we done? BGTR EXIT ; Yes, return completion status. MOVZWL #SS$_ACCVIO, R0 ; Assume access violation. MOVL PATADR (AP) ,R4 ; Get address of user buffer. IFNOWRT #4, (R4), EXIT ; Branch if no write access. MOVZWL #SS$_NORMAL, R0 ; Assume success at this point. SUBL2 #1, R1 ; Set index into the pattern vector. MOVL (R3) [R1], (R4) ; Store the pattern in the user's area. EXIT: MOVQ (SP)+,R2 ; Restore R2/R3 RET ; Return. .END