net-snmp
5.4.1
|
00001 /* 00002 * keytools.h 00003 */ 00004 00005 #ifndef _KEYTOOLS_H 00006 #define _KEYTOOLS_H 00007 00008 #ifdef __cplusplus 00009 extern "C" { 00010 #endif 00011 00012 00013 #define USM_LENGTH_EXPANDED_PASSPHRASE (1024 * 1024) /* 1Meg. */ 00014 00015 #define USM_LENGTH_KU_HASHBLOCK 64 /* In bytes. */ 00016 00017 #define USM_LENGTH_P_MIN 8 /* In characters. */ 00018 /* 00019 * Recommended practice given in <draft-ietf-snmpv3-usm-v2-02.txt>, 00020 * * Section 11.2 "Defining Users". Move into cmdline app argument 00021 * * parsing, and out of the internal routine? XXX 00022 */ 00023 00024 /* 00025 * Prototypes.h 00026 */ 00027 int generate_Ku(const oid * hashtype, u_int hashtype_len, 00028 u_char * P, size_t pplen, 00029 u_char * Ku, size_t * kulen); 00030 00031 int generate_kul(const oid * hashtype, u_int hashtype_len, 00032 u_char * engineID, size_t engineID_len, 00033 u_char * Ku, size_t ku_len, 00034 u_char * Kul, size_t * kul_len); 00035 00036 int encode_keychange(const oid * hashtype, 00037 u_int hashtype_len, u_char * oldkey, 00038 size_t oldkey_len, u_char * newkey, 00039 size_t newkey_len, u_char * kcstring, 00040 size_t * kcstring_len); 00041 00042 int decode_keychange(const oid * hashtype, 00043 u_int hashtype_len, u_char * oldkey, 00044 size_t oldkey_len, u_char * kcstring, 00045 size_t kcstring_len, u_char * newkey, 00046 size_t * newkey_len); 00047 00048 00049 /* 00050 * All functions devolve to the following block if we can't do cryptography 00051 */ 00052 #define _KEYTOOLS_NOT_AVAILABLE \ 00053 { \ 00054 return SNMPERR_KT_NOT_AVAILABLE; \ 00055 } 00056 00057 #ifdef __cplusplus 00058 } 00059 #endif 00060 #endif /* _KEYTOOLS_H */