00001 // -*- c++ -*- 00002 // 00003 // $Id: structs.h 3342 2010-09-17 18:32:00Z java $ 00004 // 00005 // Copyright (C) 2008-2010 Rafael Ostertag 00006 // 00007 // This file is part of YAPET. 00008 // 00009 // YAPET is free software: you can redistribute it and/or modify it under the 00010 // terms of the GNU General Public License as published by the Free Software 00011 // Foundation, either version 3 of the License, or (at your option) any later 00012 // version. 00013 // 00014 // YAPET is distributed in the hope that it will be useful, but WITHOUT ANY 00015 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00016 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 00017 // details. 00018 // 00019 // You should have received a copy of the GNU General Public License along with 00020 // YAPET. If not, see <http://www.gnu.org/licenses/>. 00021 // 00022 // Additional permission under GNU GPL version 3 section 7 00023 // 00024 // If you modify this program, or any covered work, by linking or combining it 00025 // with the OpenSSL project's OpenSSL library (or a modified version of that 00026 // library), containing parts covered by the terms of the OpenSSL or SSLeay 00027 // licenses, Rafael Ostertag grants you additional permission to convey the 00028 // resulting work. Corresponding Source for a non-source form of such a 00029 // combination shall include the source code for the parts of OpenSSL used as 00030 // well as that of the covered work. 00031 // 00032 00033 #ifndef _STRUCTS_H 00034 #define _STRUCTS_H 00035 00036 #ifdef HAVE_CONFIG_H 00037 # include <config.h> 00038 #endif 00039 00040 #ifdef HAVE_INTTYPES_H 00041 # include <inttypes.h> 00042 #endif 00043 00044 #ifdef HAVE_STDINT_H 00045 # include <stdint.h> 00046 #endif 00047 00048 #ifdef HAVE_SYS_TYPES_H 00049 # include <sys/types.h> 00050 #endif 00051 00052 namespace YAPET { 00053 00060 enum FILE_VERSION { 00064 VERSION_1 = 1, 00068 VERSION_2 = 2 00069 }; 00070 enum { 00075 HEADER_CONTROL_SIZE = 20, 00079 NAME_SIZE = 128, 00084 HOST_SIZE = 256, 00089 USERNAME_SIZE = 256, 00094 PASSWORD_SIZE = 256, 00099 COMMENT_SIZE = 512, 00105 HEADER_SIZE_32_B_PRE_0_6 = 25, 00111 HEADER_SIZE_64_B_PRE_0_6 = 29, 00118 HEADER_SIZE_0_6 = 29 00119 }; 00120 00129 struct FileHeader_32 { 00135 uint8_t version; 00146 uint8_t control[HEADER_CONTROL_SIZE]; 00153 int32_t pwset; 00154 }; 00155 00165 struct FileHeader_64 { 00171 uint8_t version; 00182 uint8_t control[HEADER_CONTROL_SIZE]; 00189 int64_t pwset; 00190 }; 00191 00197 struct PasswordRecord { 00205 uint8_t name[NAME_SIZE]; 00211 uint8_t host[HOST_SIZE]; 00217 uint8_t username[USERNAME_SIZE]; 00223 uint8_t password[PASSWORD_SIZE]; 00229 uint8_t comment[COMMENT_SIZE]; 00230 }; 00231 } 00232 00233 #endif // _STRUCTS_H
1.7.1