00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef __auth_h
00038 #define __auth_h
00039
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043
00044 #include "common.h"
00045
00046
00047 #include "message.h"
00048
00049
00050
00054 struct sharedSecList
00055 {
00056 struct sharedSecList *next;
00057
00058 uint8_t *id;
00059 int idlen;
00060 int idtype;
00061 uint8_t *pwd;
00062 int pwdlen;
00063 int authtype;
00064 };
00065
00066
00067 uint16_t GenerateAuthData( const struct ikev2_ctx *i2, uint8_t type, struct IKEv2Session *session, uint8_t *id, uint16_t idlen, uint8_t *p );
00068 int Authenticate( const struct ikev2_ctx *i2,struct CertList *cert, uint8_t type, uint8_t *data, uint16_t dlen, struct IKEv2Session *session,
00069 uint8_t *idData, uint16_t idlen);
00070 int LoadCertData( int type, char *filename, unsigned char **cert );
00071
00072 void AddSharedSec( struct sharedSecList **list, int idt, char *id, char *pwd, int authtype );
00073 int UpdateSharedSec(struct sharedSecList **list,int id_type, char *id, char *secret, int authtype);
00074 int IsAcceptable( struct sharedSecList *list, char *id, int idlen, char *pwd, int pwdlen );
00075 void FreeSharedSecList(struct sharedSecList *list);
00076 int AuthorizeCert(struct sharedSecList *sslist, X509 *x509);
00077 uint32_t CreateCAHashString(X509_STORE *x509_store,uint8_t **result);
00078 int GetCertAuthMethod(EVP_PKEY *pkey);
00079
00080 #ifdef __cplusplus
00081 }
00082 #endif
00083
00084 #endif