4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * The Original Code is: all of this file.
25 * Contributor(s): none yet.
27 * ***** END GPL LICENSE BLOCK *****
31 #ifndef BLO_SIGN_VERIFY_H
32 #define BLO_SIGN_VERIFY_H
42 #include "BLO_sys_types.h"
44 #define SIGNVERIFYHEADERSTRUCTSIZE sizeof(struct BLO_sign_verify_HeaderStruct)
45 /* TODO use reasonable sizes
46 Tests showed: pubKeyLen 64, cryptedKeyLen 64 bytes
47 So we pick 2*64 bytes + tail for now : */
49 #define MAXPUBKEYLEN 130
50 #define MAXSIGNATURELEN 130
52 struct BLO_sign_verify_HeaderStruct {
53 uint8_t magic; /* poor mans header recognize check */
54 uint32_t length; /* how much signed data is there */
55 uint8_t pubKey[MAXPUBKEYLEN];
56 uint32_t pubKeyLen; /* the actual pubKey length */
57 uint8_t signature[MAXSIGNATURELEN];
58 int32_t signatureLen; /* the actual signature length */
59 uint32_t datacrc; /* data crc checksum */
60 uint32_t headercrc; /* header minus crc itself checksum */
63 #define SIGNERHEADERSTRUCTSIZE sizeof(struct BLO_SignerHeaderStruct)
64 #define MAXSIGNERLEN 100
66 struct BLO_SignerHeaderStruct {
67 uint8_t name[MAXSIGNERLEN]; /* the signers name (from the key) */
68 uint8_t email[MAXSIGNERLEN]; /* the signers email (from the key) */
69 uint8_t homeUrl[MAXSIGNERLEN]; /* the signers home page */
70 uint8_t text[MAXSIGNERLEN]; /* optional additional user text */
71 uint8_t pubKeyUrl1[MAXSIGNERLEN]; /* the signers pubKey store */
72 uint8_t pubKeyUrl2[MAXSIGNERLEN]; /* the signers pubKey at NaN */
79 #endif /* BLO_SIGN_VERIFY_H */