and added files
[bcm963xx.git] / userapps / opensource / net-snmp / include / net-snmp / library / keytools.h
1 /*
2  * keytools.h
3  */
4
5 #ifndef _KEYTOOLS_H
6 #define _KEYTOOLS_H
7
8 #ifdef __cplusplus
9 extern          "C" {
10 #endif
11
12
13 #define USM_LENGTH_EXPANDED_PASSPHRASE  (1024 * 1024)   /* 1Meg. */
14
15 #define USM_LENGTH_KU_HASHBLOCK         64      /* In bytes. */
16
17 #define USM_LENGTH_P_MIN                8       /* In characters. */
18     /*
19      * Recommended practice given in <draft-ietf-snmpv3-usm-v2-02.txt>,
20      * * Section 11.2 "Defining Users".  Move into cmdline app argument
21      * * parsing, and out of the internal routine?  XXX
22      */
23
24     /*
25      * Prototypes.h
26      */
27     int             generate_Ku(const oid * hashtype, u_int hashtype_len,
28                                 u_char * P, size_t pplen,
29                                 u_char * Ku, size_t * kulen);
30
31     int             generate_kul(const oid * hashtype, u_int hashtype_len,
32                                  u_char * engineID, size_t engineID_len,
33                                  u_char * Ku, size_t ku_len,
34                                  u_char * Kul, size_t * kul_len);
35
36     int             encode_keychange(const oid * hashtype,
37                                      u_int hashtype_len, u_char * oldkey,
38                                      size_t oldkey_len, u_char * newkey,
39                                      size_t newkey_len, u_char * kcstring,
40                                      size_t * kcstring_len);
41
42     int             decode_keychange(const oid * hashtype,
43                                      u_int hashtype_len, u_char * oldkey,
44                                      size_t oldkey_len, u_char * kcstring,
45                                      size_t kcstring_len, u_char * newkey,
46                                      size_t * newkey_len);
47
48
49     /*
50      * All functions devolve to the following block if we can't do cryptography
51      */
52 #define _KEYTOOLS_NOT_AVAILABLE                 \
53 {                                               \
54         return SNMPERR_KT_NOT_AVAILABLE;        \
55 }
56
57 #ifdef __cplusplus
58 }
59 #endif
60 #endif                          /* _KEYTOOLS_H */