]>
Commit | Line | Data |
---|---|---|
0095f096 | 1 | /* |
2 | * Include file for GDSS The Generic Digital Signature Service. | |
3 | * | |
4 | */ | |
f2538e2f | 5 | |
6 | #include <krb.h> | |
0095f096 | 7 | |
8 | /* Structures Needed */ | |
9 | ||
10 | typedef struct { | |
11 | int SigInfoVersion; | |
12 | char pname[ANAME_SZ]; | |
13 | char pinst[INST_SZ]; | |
14 | char prealm[REALM_SZ]; | |
15 | unsigned int timestamp; | |
16 | unsigned char *rawsig; /* Raw Signature Bytes */ | |
17 | } SigInfo; | |
18 | ||
19 | /* GDSS Errors */ | |
20 | ||
21 | #define GDSS_SUCCESS 0 /* No error */ | |
22 | #define GDSS_E_BADSIG -1 /* Signature failed to verify */ | |
23 | #define GDSS_E_NOPUBKEY -2 /* Couldn't find public key file */ | |
24 | #define GDSS_E_KRBFAIL -3 /* Generic Kerberos error during sign */ | |
25 | #define GDSS_E_NOSOCKET -4 /* socket() call failed during sign */ | |
26 | #define GDSS_E_NOCONNECT -5 /* connect() call failed during sign */ | |
27 | #define GDSS_E_TIMEDOUT -6 /* timed out contacting gdss sign server */ | |
28 | #define GDSS_E_PADTOOMANY -7 /* Padding required to much space */ | |
29 | #define GDSS_E_ALLOC -8 /* malloc() failed to allocate memory */ | |
30 | #define GDSS_E_BVERSION -9 /* Bad version ID in signature */ | |
31 | #define GDSS_E_BADINPUT -10 /* Bad input value to Recompose */ | |
32 | ||
33 | /* GDSS Constants */ | |
34 | ||
35 | #define GDSS_PAD 10 /* Maximum number of nulls to pad */ | |
36 | #define GDSS_ESCAPE 0x20 /* Escape character for padding */ | |
37 | #define GDSS_NULL 0x21 /* Psuedo Null character */ | |
f2538e2f | 38 | |
39 | /* GDSS Prototypes */ | |
40 | int GDSS_Verify(unsigned char *Data, unsigned int DataLen, | |
41 | unsigned char *Signature, SigInfo *aSigInfo); | |
42 | int GDSS_Sig_Size(void); | |
43 | int GDSS_Recompose(SigInfo *aSigInfo, unsigned char *signature); | |
44 | int GDSS_Sign(unsigned char *Data, unsigned int DataLen, | |
45 | unsigned char *Signature); |