Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

auth.h

Go to the documentation of this file.
00001 /*
00002  *  auth.h  -  functions for authentication and certificates
00003  *  
00004  *  EAP-IKEv2
00005  *
00006  *  This library implements ideas of draft-tschofenig-eap-ikev2-10.txt
00007  *  Internet-Draft. Version of the document that this library corresponds
00008  *  to you can find at
00009  *  http://tools.ietf.org/wg/eap/draft-tschofenig-eap-ikev2-10.txt.
00010  *
00011  *  This file is part of libeap-ikev2.
00012  *
00013  *  libeap-ikev2 is free software; you can redistribute it and/or modify
00014  *  it under the terms of the GNU General Public License as published by
00015  *  the Free Software Foundation; either version 2 of the License, or
00016  *  (at your option) any later version.
00017  *
00018  *  libeap-ikev2 is distributed in the hope that it will be useful,
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *  GNU General Public License for more details.
00022  *
00023  *  You should have received a copy of the GNU General Public License
00024  *  along with libeap-ikev2; if not, write to the Free Software
00025  *
00026  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00027  *
00028  *  Copyright (C) 2005-2006 Krzysztof Rzecki <krzysztof.rzecki@ccns.pl>      
00029  *  Copyright (C) 2005-2006 Rafal Mijal <rafal.mijal@ccns.pl>                
00030  *  Copyright (C) 2005-2006 Piotr Marnik <piotr.marnik@ccns.pl>              
00031  *  Copyright (C) 2005-2006 Pawel Matejski <pawel.matejski@ccns.pl>          
00032  *  Copyright (C) 2003      Udo Schilcher <udo.schilcher@edu.uni-klu.ac.at>
00033  *  Copyright (C) 2003      Thomas Hambrusch <thambrus@edu.uni-klu.ac.at>          
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 // for cert list struct
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 // function prototypes
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

Project hosted by: SourceForge.net Logo