/**/ /***************************************************************************/ /** **/ /** © 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 16:22:32 by OpenVMS SDL EV3-3 */ /* Source: 21-SEP-2005 15:44:14 $1$DGA7374:[ENCRYPT.SRC]ENCRYPT_STRUCTURES.SDL;/ */ /********************************************************************************************************************************/ /*** MODULE $ENCSTRDEF ***/ #ifndef __ENCSTRDEF_LOADED #define __ENCSTRDEF_LOADED 1 #pragma __nostandard /* This file uses non-ANSI-Standard features */ #pragma __member_alignment __save #pragma __nomember_alignment #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __save /* Save the previously-defined required ptr size */ #pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */ #endif #ifdef __cplusplus extern "C" { #define __unknown_params ... #define __optional_params ... #else #define __unknown_params #define __optional_params ... #endif #ifndef __struct #if !defined(__VAXC) #define __struct struct #else #define __struct variant_struct #endif #endif #ifndef __union #if !defined(__VAXC) #define __union union #else #define __union variant_union #endif #endif /* 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 */ #define ENCRYPT$M_KEY_SYSTEM 0x1 #define ENCRYPT$M_KEY_GROUP 0x2 #define ENCRYPT$M_KEY_PROCESS 0x4 #define ENCRYPT$M_KEY_JOB 0x8 #define ENCRYPT$M_AVAIL1 0x10 #define ENCRYPT$M_KEY_LITERAL 0x20 #define ENCRYPT$M_KEY_AES 0x40 struct key_bits { unsigned encrypt$v_key_system : 1; unsigned encrypt$v_key_group : 1; unsigned encrypt$v_key_process : 1; unsigned encrypt$v_key_job : 1; unsigned encrypt$v_avail1 : 1; unsigned encrypt$v_key_literal : 1; unsigned encrypt$v_key_aes : 1; unsigned encrypt$v_fill_0_ : 1; } ; #define ENCRYPT$M_VALID_KEY_BITS 111 /* 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 */ #define ENCRYPT$K_KEY$SYSTEM 0 #define ENCRYPT$K_KEY$GROUP 1 #define ENCRYPT$K_KEY$PROCESS 2 #define ENCRYPT$K_KEY$JOB 3 #define ENCRYPT$K_AVAIL1 4 #define ENCRYPT$K_KEY$LITERAL 5 #define ENCRYPT$K_KEY$AES 6 /* 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 */ #define ENCRYPT$M_FILE_ENCRYPT 0x1 #define ENCRYPT$M_FILE_DELETE 0x2 #define ENCRYPT$M_FILE_ERASE 0x4 #define ENCRYPT$M_FILE_LOG 0x8 #define ENCRYPT$M_FILE_UNUSED 0x10 #define ENCRYPT$M_FILE_STATISTICS 0x20 #define ENCRYPT$M_FILE_COMPRESS 0x40 #define ENCRYPT$M_FILE_EXTLOG 0x80 #define ENCRYPT$M_FILE_IGNORE_CRC 0x100 #define ENCRYPT$M_FILE_V011 0x200 #define ENCRYPT$M_FILE_KEY_VALUE 0x400 #define ENCRYPT$M_FILE_AES 0x800 struct file_ops { unsigned encrypt$v_file_encrypt : 1; unsigned encrypt$v_file_delete : 1; unsigned encrypt$v_file_erase : 1; unsigned encrypt$v_file_log : 1; unsigned encrypt$v_file_unused : 1; unsigned encrypt$v_file_statistics : 1; unsigned encrypt$v_file_compress : 1; unsigned encrypt$v_file_extlog : 1; unsigned encrypt$v_file_ignore_crc : 1; unsigned encrypt$v_file_v011 : 1; unsigned encrypt$v_file_key_value : 1; unsigned encrypt$v_file_aes : 1; unsigned encrypt$v_fill_1_ : 4; } ; #define ENCRYPT$M_VALID_FILE_BITS 4079 /* 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 */ #define ENCRYPT$M_KEYF_IS_COMPRESSED 0x1 #define ENCRYPT$M_KEYF_LITERAL 0x2 #define ENCRYPT$M_KEYF_TOBE_COMPRESSED 0x4 #define ENCRYPT$M_KEYF_AES 0x8 struct stored_key_flags { unsigned short int encrypt$w_key_length; __union { __struct { unsigned short int encrypt$w_key_flags; } encrypt$r_key_flags_w; __struct { unsigned encrypt$v_keyf_is_compressed : 1; unsigned encrypt$v_keyf_literal : 1; unsigned encrypt$v_keyf_tobe_compressed : 1; unsigned encrypt$v_keyf_aes : 1; unsigned encrypt$v_keyf_unused : 12; } encrypt$r_key_flags_b; } encrypt$r_key_flags_u; } ; #if !defined(__VAXC) #define encrypt$r_key_flags_w encrypt$r_key_flags_u.encrypt$r_key_flags_w #define encrypt$w_key_flags encrypt$r_key_flags_w.encrypt$w_key_flags #define encrypt$r_key_flags_b encrypt$r_key_flags_u.encrypt$r_key_flags_b #define encrypt$v_keyf_is_compressed encrypt$r_key_flags_b.encrypt$v_keyf_is_compressed #define encrypt$v_keyf_literal encrypt$r_key_flags_b.encrypt$v_keyf_literal #define encrypt$v_keyf_tobe_compressed encrypt$r_key_flags_b.encrypt$v_keyf_tobe_compressed #define encrypt$v_keyf_aes encrypt$r_key_flags_b.encrypt$v_keyf_aes #endif /* #if !defined(__VAXC) */ #define ENCRYPT$M_VALID_DES_KEY_FLAGS 7 #define ENCRYPT$M_VALID_AES_KEY_FLAGS 15 /* */ /* 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 */ #define ENCRYPT$K_OPTPARAM_ONE 1 #define ENCRYPT$K_OPTPARAM_TWO 2 #define ENCRYPT$K_OPTPARAM_THREE 3 #define ENCRYPT$K_OPTPARAM_FOUR 4 #define ENCRYPT$K_OPTPARAM_FIVE 5 #define ENCRYPT$K_OPTPARAM_SIX 6 #define ENCRYPT$K_OPTPARAM_SEVEN 7 #define ENCRYPT$K_OPTPARAM_EIGHT 8 #define ENCRYPT$K_KEY_NAME 9 #define ENCRYPT$K_KEY_VALUE 10 #define ENCRYPT$K_KEY_FLAGS 11 #define ENCRYPT$K_ALGORITHM_SPEC 12 #define ENCRYPT$K_ALGORITHM_TYPE 13 #define ENCRYPT$K_DATA_ALGORITHM 14 #define ENCRYPT$K_QUAL_CONTEXT 15 #define ENCRYPT$K_MAX 16 /* */ /* Key name/value switch */ /* */ #define ENCRYPT$K_NAME_SPECIFIED 0 #define ENCRYPT$K_VALUE_SPECIFIED 1 /* */ /* 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 */ #define ENCRYPT$M_FIL_COMPRESSED 0x1 #define ENCRYPT$M_FIL_LONGCHECKSUM 0x2 struct fil_record { unsigned short int encrypt$w_fil_buflen; unsigned char encrypt$b_fil_filever; unsigned char encrypt$b_fil_fileupd; unsigned __int64 encrypt$q_fil_key; unsigned __int64 encrypt$q_fil_iv; unsigned int encrypt$l_fil_algcode; __union { unsigned int encrypt$l_fil_flags; __struct { unsigned encrypt$v_fil_compressed : 1; unsigned encrypt$v_fil_longchecksum : 1; unsigned encrypt$v_fill_2_ : 30; } encrypt$r_fil_flags_bits; } encrypt$r_fil_flags_overlay; unsigned short int encrypt$w_fil_atr_len; unsigned short int encrypt$w_fil_compress_max; unsigned short int encrypt$w_fil_encrypt_max; __union { unsigned int encrypt$l_fil_dcxmap_len; __struct { unsigned short int encrypt$w_fil_dcxmap_len_low; unsigned short int encrypt$w_fil_dcxmap_len_high; } encrypt$r_fil_dcxmap_len_word; } encrypt$r_fil_dcxlen_overlay; unsigned short int encrypt$w_fil_algnam_len; char encrypt$t_fil_algnam_str [6]; unsigned char encrypt$b_fil_xkey [80]; unsigned char encrypt$b_fil_xiv [80]; unsigned short int encrypt$w_fil_xalgnam_len; char encrypt$t_fil_xalgnam_str [16]; char encrypt$b_fil_filler [28]; unsigned int encrypt$l_fil_checksum; } ; #if !defined(__VAXC) #define encrypt$l_fil_flags encrypt$r_fil_flags_overlay.encrypt$l_fil_flags #define encrypt$v_fil_compressed encrypt$r_fil_flags_overlay.encrypt$r_fil_flags_bits.encrypt$v_fil_compressed #define encrypt$v_fil_longchecksum encrypt$r_fil_flags_overlay.encrypt$r_fil_flags_bits.encrypt$v_fil_longchecksum #define encrypt$l_fil_dcxmap_len encrypt$r_fil_dcxlen_overlay.encrypt$l_fil_dcxmap_len #define encrypt$r_fil_dcxmap_len_word encrypt$r_fil_dcxlen_overlay.encrypt$r_fil_dcxmap_len_word #define encrypt$w_fil_dcxmap_len_low encrypt$r_fil_dcxmap_len_word.encrypt$w_fil_dcxmap_len_low #define encrypt$w_fil_dcxmap_len_high encrypt$r_fil_dcxmap_len_word.encrypt$w_fil_dcxmap_len_high #endif /* #if !defined(__VAXC) */ /* */ /* 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 */ #define ENCRYPT$M_FABATR 0x1 #define ENCRYPT$M_XABALL 0x2 #define ENCRYPT$M_XABDAT 0x4 #define ENCRYPT$M_XABFHC 0x8 #define ENCRYPT$M_XABPRO 0x10 #define ENCRYPT$M_PROACL 0x20 #define ENCRYPT$M_XABSUM 0x40 #define ENCRYPT$M_UNASSIGNED 0xFFFFFF80 struct atr_record { unsigned short int encrypt$w_filatr_length; short int encrypt$w_filatr_fill_60; __union { unsigned int encrypt$l_filatr; __struct { unsigned encrypt$v_fabatr : 1; unsigned encrypt$v_xaball : 1; unsigned encrypt$v_xabdat : 1; unsigned encrypt$v_xabfhc : 1; unsigned encrypt$v_xabpro : 1; unsigned encrypt$v_proacl : 1; unsigned encrypt$v_xabsum : 1; unsigned encrypt$v_unassigned : 25; } encrypt$r_filatr_bits; } encrypt$r_filatr_overlay; char encrypt$b_atr_filler [248]; } ; #if !defined(__VAXC) #define encrypt$l_filatr encrypt$r_filatr_overlay.encrypt$l_filatr #define encrypt$r_filatr_bits encrypt$r_filatr_overlay.encrypt$r_filatr_bits #define encrypt$v_fabatr encrypt$r_filatr_bits.encrypt$v_fabatr #define encrypt$v_xaball encrypt$r_filatr_bits.encrypt$v_xaball #define encrypt$v_xabdat encrypt$r_filatr_bits.encrypt$v_xabdat #define encrypt$v_xabfhc encrypt$r_filatr_bits.encrypt$v_xabfhc #define encrypt$v_xabpro encrypt$r_filatr_bits.encrypt$v_xabpro #define encrypt$v_proacl encrypt$r_filatr_bits.encrypt$v_proacl #define encrypt$v_xabsum encrypt$r_filatr_bits.encrypt$v_xabsum #define encrypt$v_unassigned encrypt$r_filatr_bits.encrypt$v_unassigned #endif /* #if !defined(__VAXC) */ /* */ /* 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 */ struct fab_attributes { unsigned char fabatr$b_cod; unsigned char fabatr$b_bln; short int fabatr$w_fill_50; int fabatr$l_fill_51; unsigned char fabatr$b_org; unsigned char fabatr$b_rfm; unsigned char fabatr$b_rat; unsigned char fabatr$b_fsz; unsigned char fabatr$b_bks; unsigned char fabatr$b_rtv; char fabatr$b_fill_52 [2]; unsigned short int fabatr$w_mrs; unsigned short int fabatr$w_gbc; unsigned int fabatr$l_mrn; unsigned int fabatr$l_fop; } ; /* EXCESS_DATA Holds data beyond plaintext EOF */ /* EXCESS_CRC CRC of file */ struct excess_data { unsigned short int encrypt$w_excess_crc; char encrypt$t_excess_reserved [32]; } ; /* */ /* Feature block */ /* */ #define ENCRYPT$M_PRODUCT_VERSION_MIN 0xFF #define ENCRYPT$M_PRODUCT_VERSION_MAJ 0xFF00 struct feature { unsigned int encrypt$l_feature_code; __union { unsigned short int encrypt$w_product_version; __struct { unsigned encrypt$v_product_version_min : 8; unsigned encrypt$v_product_version_maj : 8; } encrypt$r_pv_bits; } encrypt$r_version_overlay; unsigned short int encrypt$w_feature_length; #if defined(__VAXC) char encrypt$t_feature_value[]; #else /* Warning: empty char[] member for encrypt$t_feature_value at end of structure not created */ #endif /* #if defined(__VAXC) */ } ; #if !defined(__VAXC) #define encrypt$w_product_version encrypt$r_version_overlay.encrypt$w_product_version #define encrypt$r_pv_bits encrypt$r_version_overlay.encrypt$r_pv_bits #define encrypt$v_product_version_min encrypt$r_pv_bits.encrypt$v_product_version_min #define encrypt$v_product_version_maj encrypt$r_pv_bits.encrypt$v_product_version_maj #endif /* #if !defined(__VAXC) */ #define ENCRYPT$M_FTR_REQUIRED 0x1 #define ENCRYPT$M_FTR_COMMENT 0x2 #define ENCRYPT$M_FTR_DEBUG 0x4 #define ENCRYPT$M_FTR_SILENT 0x8 struct feature_code_bits { unsigned encrypt$v_ftr_required : 1; unsigned encrypt$v_ftr_comment : 1; unsigned encrypt$v_ftr_debug : 1; unsigned encrypt$v_ftr_silent : 1; unsigned encrypt$v_ftr_number : 12; unsigned encrypt$v_ftr_unused : 16; } ; /* */ /* CRC checking feature block value definitions */ /* */ #define ENCRYPT$K_FEATURE_CRC 33 /* */ /* Semantic tag feature block value definitions */ /* */ #define ENCRYPT$K_FEATURE_SEMTAG 17 struct feature_semtag_ { unsigned short int encrypt$w_semtag_length; char encrypt$t_semtag_value [64]; } ; #define ENCRYPT$K_FEATURES_MAX_LEN 86 /* */ /* Define the encrypted file structure version of the current implementation */ /* */ /* Bumped FILE_VERSION for Encrypt-AES from 3 to 4 */ /* */ #define ENCRYPT$K_FILE_VERSION 4 /* */ /* Statistics record returned by encrypt$statistics() */ /* */ struct 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 */ unsigned int encrypt$l_stat_total_records; unsigned __int64 encrypt$q_stat_total_bytes; unsigned __int64 encrypt$q_stat_total_time; __int64 encrypt$q_stat_fill_10; } ; #pragma __member_alignment __restore #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */ #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __ENCSTRDEF_LOADED */