! ! ************************************************************************* ! * * ! * © Copyright 2010, Hewlett-Packard Development Company, L.P. * ! * * ! * Confidential computer software. Valid license from HP and/or * ! * its subsidiaries required for possession, use, or copying. * ! * * ! * Consistent with FAR 12.211 and 12.212, Commercial Computer Software, * ! * Computer Software Documentation, and Technical Data for Commercial * ! * Items are licensed to the U.S. Government under vendor's standard * ! * commercial license. * ! * * ! * Neither HP nor any of its subsidiaries shall be liable for technical * ! * or editorial errors or omissions contained herein. The information * ! * in this document is provided "as is" without warranty of any kind and * ! * is subject to change without notice. The warranties for HP products * ! * are set forth in the express limited warranty statements accompanying * ! * such products. Nothing herein should be construed as constituting an * ! * additional warranty. * ! * * ! ************************************************************************* ! ******************************************************************************************************************************** ! Created: 30-Mar-2010 17:25:15 by OpenVMS SDL EV3-3 ! Source: 21-SEP-2005 15:44:14 $1$DGA7274:[ENCRYPT.SRC]ENCRYPT_STRUCTURES.SDL;/ ! ******************************************************************************************************************************** !*** MODULE $ENCSTRDEF *** !DEC$ OPTIONS/ALIGN=(RECORDS=PACKED,COMMONS=PACKED)/NOWARN ! Definitions for Encryption structures ! KEY_SYSTEM system ! KEY_GROUP group ! KEY_PROCESS process ! KEY_JOB job ! KEY_LITERAL literal key definition, don't compress ! KEY_AES AES Key encryption/decryption PARAMETER ENCRYPT$M_KEY_SYSTEM = '00000001'X PARAMETER ENCRYPT$M_KEY_GROUP = '00000002'X PARAMETER ENCRYPT$M_KEY_PROCESS = '00000004'X PARAMETER ENCRYPT$M_KEY_JOB = '00000008'X PARAMETER ENCRYPT$m_avail1 = '00000010'X PARAMETER ENCRYPT$M_KEY_LITERAL = '00000020'X PARAMETER ENCRYPT$M_KEY_AES = '00000040'X STRUCTURE /KEY_BITS/ PARAMETER ENCRYPT$S_KEY_SYSTEM = 1 PARAMETER ENCRYPT$V_KEY_SYSTEM = 0 PARAMETER ENCRYPT$S_KEY_GROUP = 1 PARAMETER ENCRYPT$V_KEY_GROUP = 1 PARAMETER ENCRYPT$S_KEY_PROCESS = 1 PARAMETER ENCRYPT$V_KEY_PROCESS = 2 PARAMETER ENCRYPT$S_KEY_JOB = 1 PARAMETER ENCRYPT$V_KEY_JOB = 3 PARAMETER ENCRYPT$S_avail1 = 1 PARAMETER ENCRYPT$V_avail1 = 4 PARAMETER ENCRYPT$S_KEY_LITERAL = 1 PARAMETER ENCRYPT$V_KEY_LITERAL = 5 PARAMETER ENCRYPT$S_KEY_AES = 1 PARAMETER ENCRYPT$V_KEY_AES = 6 BYTE %FILL (1) END STRUCTURE ! KEY_BITS PARAMETER ENCRYPT$M_VALID_KEY_BITS = '0000006F'X ! KEY$SYSTEM system ! KEY$GROUP group ! KEY$PROCESS process ! KEY$JOB job ! avail1 unused ! KEY$LITERAL literal key definition, don't compress ! KEY$AES AES Key encryption/decryption PARAMETER ENCRYPT$K_KEY$SYSTEM = '00000000'X PARAMETER ENCRYPT$K_KEY$GROUP = '00000001'X PARAMETER ENCRYPT$K_KEY$PROCESS = '00000002'X PARAMETER ENCRYPT$K_KEY$JOB = '00000003'X PARAMETER ENCRYPT$k_avail1 = '00000004'X PARAMETER ENCRYPT$K_KEY$LITERAL = '00000005'X PARAMETER ENCRYPT$K_KEY$AES = '00000006'X ! FILE_ENCRYPT encrypt/decrypt direction ! FILE_DELETE delete source file after operation ! FILE_ERASE erase source file when deleting ! FILE_LOG log file operation ! FILE_UNUSED -unused ! FILE_STATISTICS log statistics too ! FILE_COMPRESS compress input ! FILE_EXTLOG extended log ! FILE_IGNORE_CRC Ignore CRC generation/checking ! FILE_V011 Generate V1.1-compatible ciphertext file ! FILE_KEY_VALUE Pass a key by value ! FILE_AES AES File Operation PARAMETER ENCRYPT$M_FILE_ENCRYPT = '00000001'X PARAMETER ENCRYPT$M_FILE_DELETE = '00000002'X PARAMETER ENCRYPT$M_FILE_ERASE = '00000004'X PARAMETER ENCRYPT$M_FILE_LOG = '00000008'X PARAMETER ENCRYPT$M_FILE_UNUSED = '00000010'X PARAMETER ENCRYPT$M_FILE_STATISTICS = '00000020'X PARAMETER ENCRYPT$M_FILE_COMPRESS = '00000040'X PARAMETER ENCRYPT$M_FILE_EXTLOG = '00000080'X PARAMETER ENCRYPT$M_FILE_IGNORE_CRC = '00000100'X PARAMETER ENCRYPT$M_FILE_V011 = '00000200'X PARAMETER ENCRYPT$M_FILE_KEY_VALUE = '00000400'X PARAMETER ENCRYPT$M_FILE_AES = '00000800'X STRUCTURE /FILE_OPS/ PARAMETER ENCRYPT$S_FILE_ENCRYPT = 1 PARAMETER ENCRYPT$V_FILE_ENCRYPT = 0 PARAMETER ENCRYPT$S_FILE_DELETE = 1 PARAMETER ENCRYPT$V_FILE_DELETE = 1 PARAMETER ENCRYPT$S_FILE_ERASE = 1 PARAMETER ENCRYPT$V_FILE_ERASE = 2 PARAMETER ENCRYPT$S_FILE_LOG = 1 PARAMETER ENCRYPT$V_FILE_LOG = 3 PARAMETER ENCRYPT$S_FILE_STATISTICS = 1 PARAMETER ENCRYPT$V_FILE_STATISTICS = 5 PARAMETER ENCRYPT$S_FILE_COMPRESS = 1 PARAMETER ENCRYPT$V_FILE_COMPRESS = 6 PARAMETER ENCRYPT$S_FILE_EXTLOG = 1 PARAMETER ENCRYPT$V_FILE_EXTLOG = 7 PARAMETER ENCRYPT$S_FILE_IGNORE_CRC = 1 PARAMETER ENCRYPT$V_FILE_IGNORE_CRC = 8 PARAMETER ENCRYPT$S_FILE_V011 = 1 PARAMETER ENCRYPT$V_FILE_V011 = 9 PARAMETER ENCRYPT$S_FILE_KEY_VALUE = 1 PARAMETER ENCRYPT$V_FILE_KEY_VALUE = 10 PARAMETER ENCRYPT$S_FILE_AES = 1 PARAMETER ENCRYPT$V_FILE_AES = 11 BYTE %FILL (2) END STRUCTURE ! FILE_OPS PARAMETER ENCRYPT$M_VALID_FILE_BITS = '00000FEF'X ! KEY_LENGTH /* original key string length ! KEYF_IS_COMPRESSED /* key is compressed text ! KEYF_LITERAL /* key is literal value ! KEYF_TOBE_COMPRESSED /* compression was deferred ! KEYF_AES /* Key is AES encrypted ! KEYF_UNUSED /* unused PARAMETER encrypt$m_keyf_is_compressed = '00000001'X PARAMETER encrypt$m_keyf_literal = '00000002'X PARAMETER encrypt$m_keyf_tobe_compressed = '00000004'X PARAMETER encrypt$m_keyf_aes = '00000008'X STRUCTURE /stored_key_flags/ INTEGER*2 encrypt$w_key_length UNION MAP INTEGER*2 encrypt$w_key_flags END MAP MAP PARAMETER encrypt$S_keyf_is_compressed = 1 PARAMETER encrypt$V_keyf_is_compressed = 0 PARAMETER encrypt$S_keyf_literal = 1 PARAMETER encrypt$V_keyf_literal = 1 PARAMETER encrypt$S_keyf_tobe_compressed = 1 PARAMETER encrypt$V_keyf_tobe_compressed = 2 PARAMETER encrypt$S_keyf_aes = 1 PARAMETER encrypt$V_keyf_aes = 3 BYTE %FILL (1) END MAP END UNION END STRUCTURE ! stored_key_flags PARAMETER ENCRYPT$M_VALID_DES_KEY_FLAGS = '00000007'X PARAMETER ENCRYPT$M_VALID_AES_KEY_FLAGS = '0000000F'X ! ! Programmable interface itemlist item codes ! ! Algorithm specific optional parameters. For example with the ! DES based algorithms, is defined as the address ! of an 8-byte initialization vector (IV) to be used instead of ! any residual IV remaining from a previous operation. ! The interpretation of these parameters is documented with ! the specific algorithms. ! optparam_one Optional Parameter ! optparam_two Optional Parameter ! optparam_three Optional Parameter ! optparam_four Optional Parameter ! optparam_five Optional Parameter ! optparam_six Optional Parameter ! optparam_seven Optional Parameter ! optparam_eight Optional Parameter ! ! References the actual key value to be used. Overrides ! any key name/value reference supplied in other call ! parameters ! key_name A key namestring ! key_value A key value ! key_flags Key interpretation flags ! ! Algorithm name specification ! algorithm_spec algorithm name or type specification ! algorithm_type algorithm specification type code ! ! for encrypt$encrypt_file() parameters ! data_algorithm inner algorithm name specification ! qual_context common qualifier context ! ! max maximum itemlist number PARAMETER encrypt$k_optparam_one = '00000001'X PARAMETER encrypt$k_optparam_two = '00000002'X PARAMETER encrypt$k_optparam_three = '00000003'X PARAMETER encrypt$k_optparam_four = '00000004'X PARAMETER encrypt$k_optparam_five = '00000005'X PARAMETER encrypt$k_optparam_six = '00000006'X PARAMETER encrypt$k_optparam_seven = '00000007'X PARAMETER encrypt$k_optparam_eight = '00000008'X PARAMETER encrypt$k_key_name = '00000009'X PARAMETER encrypt$k_key_value = '0000000A'X PARAMETER encrypt$k_key_flags = '0000000B'X PARAMETER encrypt$k_algorithm_spec = '0000000C'X PARAMETER encrypt$k_algorithm_type = '0000000D'X PARAMETER encrypt$k_data_algorithm = '0000000E'X PARAMETER encrypt$k_qual_context = '0000000F'X PARAMETER encrypt$k_max = '00000010'X ! ! Key name/value switch ! PARAMETER encrypt$k_name_specified = '00000000'X PARAMETER encrypt$k_value_specified = '00000001'X ! ! Define structure for file encryption generated key vector ! ! FIL_BUFLEN length of this record ! FIL_FILEVER file encrypt routine version ! FIL_FILEUPD decimal version ! ---> FIL_KEY and FIL_IV are assumed to be contiguous ! FIL_KEY data key value ! FIL_IV initialize vector value ! ---> FIL_KEY and FIL_IV are assumed to be contiguous ! FIL_ALGCODE file data encryption algorithm code ! FIL_FLAGS file encryption flags ! FIL_COMPRESSED file was compressed before enc ! FIL_LONGCHECKSUM longidudinal checksum present ! FIL_ATR_LEN size of attribute record ! FIL_COMPRESS_MAX blocks in compress buffer ! FIL_ENCRYPT_MAX blocks in encrypt buffer ! FIL_DCXMAP_LEN size of DCX map record if present ! FIL_ALGNAM_LEN size of data encryption algorithm ! FIL_ALGNAM_STR data encryption alg name ! /* this is a varying length string with the next allocated field ! /* starting 'algnam_len' bytes after 'algnam_str' ! FIL_XKEY extended key (counted string) ! FIL_XIV extended IV (counted) ! FIL_XALGNAM_LEN extended size of data encryption algorithm - AES ! FIL_XALGNAM_STR extended ALG name string - for AES ! FIL_FILLER filler to pad to 256 bytes ! FIL_CHECKSUM structure checksum PARAMETER ENCRYPT$M_FIL_COMPRESSED = '00000001'X PARAMETER ENCRYPT$M_FIL_LONGCHECKSUM = '00000002'X STRUCTURE /FIL_RECORD/ INTEGER*2 ENCRYPT$W_FIL_BUFLEN BYTE ENCRYPT$B_FIL_FILEVER BYTE ENCRYPT$B_FIL_FILEUPD INTEGER*4 ENCRYPT$Q_FIL_KEY(2) INTEGER*4 ENCRYPT$Q_FIL_IV(2) INTEGER*4 ENCRYPT$L_FIL_ALGCODE UNION MAP INTEGER*4 ENCRYPT$L_FIL_FLAGS END MAP MAP PARAMETER ENCRYPT$S_FIL_COMPRESSED = 1 PARAMETER ENCRYPT$V_FIL_COMPRESSED = 0 PARAMETER ENCRYPT$S_FIL_LONGCHECKSUM = 1 PARAMETER ENCRYPT$V_FIL_LONGCHECKSUM = 1 BYTE %FILL (1) END MAP END UNION INTEGER*2 ENCRYPT$W_FIL_ATR_LEN INTEGER*2 ENCRYPT$W_FIL_COMPRESS_MAX INTEGER*2 ENCRYPT$W_FIL_ENCRYPT_MAX UNION MAP INTEGER*4 ENCRYPT$L_FIL_DCXMAP_LEN END MAP MAP INTEGER*2 ENCRYPT$W_FIL_DCXMAP_LEN_LOW INTEGER*2 ENCRYPT$W_FIL_DCXMAP_LEN_HIGH END MAP END UNION INTEGER*2 ENCRYPT$W_FIL_ALGNAM_LEN CHARACTER*6 ENCRYPT$T_FIL_ALGNAM_STR BYTE ENCRYPT$B_FIL_XKEY(1:80) BYTE ENCRYPT$B_FIL_XIV(1:80) INTEGER*2 ENCRYPT$W_FIL_XALGNAM_LEN CHARACTER*16 ENCRYPT$T_FIL_XALGNAM_STR BYTE ENCRYPT$B_FIL_FILLER(1:28) INTEGER*4 ENCRYPT$L_FIL_CHECKSUM END STRUCTURE ! FIL_RECORD ! ! Attribute record structure in encrypted data file. The encrypted file ! attributes are obtained from the input file fab and a chain of xab ! blocks. The fab attributes are copied into a smaller structure, FABATR, ! declared below and the xab attributes are copied in toto. ! ! FILATR_LENGTH length of file attributes ! FILATR_FILL_60 unused ! FILATR mask of whats present in attrib record ! FABATR fabatr present ! XABALL xaball present ! XABDAT xabdat present ! XABFHC xabfhc present ! XABPRO xabpro present ! PROACL xabpro access control list present ! XABSUM xabsum present ! UNASSIGNED unassigned bits ! ATR_FILLER filler to pad to 256 bytes PARAMETER ENCRYPT$M_FABATR = '00000001'X PARAMETER ENCRYPT$M_XABALL = '00000002'X PARAMETER ENCRYPT$M_XABDAT = '00000004'X PARAMETER ENCRYPT$M_XABFHC = '00000008'X PARAMETER ENCRYPT$M_XABPRO = '00000010'X PARAMETER ENCRYPT$M_PROACL = '00000020'X PARAMETER ENCRYPT$M_XABSUM = '00000040'X PARAMETER ENCRYPT$M_UNASSIGNED = 'FFFFFF80'X STRUCTURE /ATR_RECORD/ INTEGER*2 ENCRYPT$W_FILATR_LENGTH INTEGER*2 %FILL UNION MAP INTEGER*4 ENCRYPT$L_FILATR END MAP MAP PARAMETER ENCRYPT$S_FABATR = 1 PARAMETER ENCRYPT$V_FABATR = 0 PARAMETER ENCRYPT$S_XABALL = 1 PARAMETER ENCRYPT$V_XABALL = 1 PARAMETER ENCRYPT$S_XABDAT = 1 PARAMETER ENCRYPT$V_XABDAT = 2 PARAMETER ENCRYPT$S_XABFHC = 1 PARAMETER ENCRYPT$V_XABFHC = 3 PARAMETER ENCRYPT$S_XABPRO = 1 PARAMETER ENCRYPT$V_XABPRO = 4 PARAMETER ENCRYPT$S_PROACL = 1 PARAMETER ENCRYPT$V_PROACL = 5 PARAMETER ENCRYPT$S_XABSUM = 1 PARAMETER ENCRYPT$V_XABSUM = 6 PARAMETER ENCRYPT$S_UNASSIGNED = 25 PARAMETER ENCRYPT$V_UNASSIGNED = 7 BYTE %FILL (4) END MAP END UNION BYTE ENCRYPT$B_ATR_FILLER(1:248) END STRUCTURE ! ATR_RECORD ! ! While other attributes are stored as whole xabs, attributes from the ! fab are copied to the xab-like structure FAB_ATTRIBUTES. ! ! COD structure code ! BLN structure length ! fill_50 spare ! fill_51 address of next structure ! ORG file organization ! RFM record format ! RAT record attributes ! FSZ vfc header size ! BKS bucket size ! RTV retrieval pointer count ! fill_52 spare ! MRS maximum record size ! GBC global buffer count ! MRN maximum record number ! FOP file operations STRUCTURE /FAB_ATTRIBUTES/ BYTE %FILL BYTE FABATR$B_BLN INTEGER*2 %FILL INTEGER*4 %FILL BYTE FABATR$B_ORG BYTE FABATR$B_RFM BYTE FABATR$B_RAT BYTE FABATR$B_FSZ BYTE FABATR$B_BKS BYTE FABATR$B_RTV BYTE %FILL(1:2) INTEGER*2 FABATR$W_MRS INTEGER*2 FABATR$W_GBC INTEGER*4 FABATR$L_MRN INTEGER*4 FABATR$L_FOP END STRUCTURE ! FAB_ATTRIBUTES ! EXCESS_DATA Holds data beyond plaintext EOF ! EXCESS_CRC CRC of file STRUCTURE /EXCESS_DATA/ INTEGER*2 ENCRYPT$W_EXCESS_CRC CHARACTER*32 %FILL END STRUCTURE ! EXCESS_DATA ! ! Feature block ! PARAMETER ENCRYPT$M_PRODUCT_VERSION_MIN = '000000FF'X PARAMETER ENCRYPT$M_PRODUCT_VERSION_MAJ = '0000FF00'X STRUCTURE /FEATURE/ INTEGER*4 ENCRYPT$L_FEATURE_CODE UNION MAP INTEGER*2 ENCRYPT$W_PRODUCT_VERSION END MAP MAP PARAMETER ENCRYPT$S_PRODUCT_VERSION_MIN = 8 PARAMETER ENCRYPT$V_PRODUCT_VERSION_MIN = 0 PARAMETER ENCRYPT$S_PRODUCT_VERSION_MAJ = 8 PARAMETER ENCRYPT$V_PRODUCT_VERSION_MAJ = 8 BYTE %FILL (2) END MAP END UNION INTEGER*2 ENCRYPT$W_FEATURE_LENGTH ! unsupported type CHARACTER*0 ENCRYPT$T_FEATURE_VALUE END STRUCTURE ! FEATURE PARAMETER ENCRYPT$M_FTR_REQUIRED = '00000001'X PARAMETER ENCRYPT$M_FTR_COMMENT = '00000002'X PARAMETER ENCRYPT$M_FTR_DEBUG = '00000004'X PARAMETER ENCRYPT$M_FTR_SILENT = '00000008'X STRUCTURE /FEATURE_CODE_BITS/ PARAMETER ENCRYPT$S_FTR_REQUIRED = 1 PARAMETER ENCRYPT$V_FTR_REQUIRED = 0 PARAMETER ENCRYPT$S_FTR_COMMENT = 1 PARAMETER ENCRYPT$V_FTR_COMMENT = 1 PARAMETER ENCRYPT$S_FTR_DEBUG = 1 PARAMETER ENCRYPT$V_FTR_DEBUG = 2 PARAMETER ENCRYPT$S_FTR_SILENT = 1 PARAMETER ENCRYPT$V_FTR_SILENT = 3 PARAMETER ENCRYPT$S_FTR_NUMBER = 12 PARAMETER ENCRYPT$V_FTR_NUMBER = 4 BYTE %FILL (2) END STRUCTURE ! FEATURE_CODE_BITS ! ! CRC checking feature block value definitions ! PARAMETER ENCRYPT$K_FEATURE_CRC = '00000021'X ! ! Semantic tag feature block value definitions ! PARAMETER ENCRYPT$K_FEATURE_SEMTAG = '00000011'X STRUCTURE /FEATURE_SEMTAG_/ INTEGER*2 ENCRYPT$W_SEMTAG_LENGTH CHARACTER*64 ENCRYPT$T_SEMTAG_VALUE END STRUCTURE ! FEATURE_SEMTAG_ PARAMETER ENCRYPT$K_FEATURES_MAX_LEN = '00000056'X ! ! Define the encrypted file structure version of the current implementation ! ! Bumped FILE_VERSION for Encrypt-AES from 3 to 4 ! PARAMETER ENCRYPT$K_FILE_VERSION = '00000004'X ! ! Statistics record returned by encrypt$statistics() ! STRUCTURE /STAT_RECORD/ ! ! Format returned for statistics type code = 1 ! ! STAT_TOTAL_RECORDS statistics: total records ! STAT_TOTAL_BYTES statistics: total bytes through stream ! STAT_TOTAL_TIME statistics: total time in facility ! STAT_FILL_10 statistics: expansion INTEGER*4 ENCRYPT$L_STAT_TOTAL_RECORDS INTEGER*4 ENCRYPT$Q_STAT_TOTAL_BYTES(2) INTEGER*4 ENCRYPT$Q_STAT_TOTAL_TIME(2) INTEGER*4 %FILL(2) END STRUCTURE ! STAT_RECORD !DEC$ END OPTIONS