How to modify rlm_example to implement a new eap-type authentication
Hi all, I followed the site http://wiki.freeradius.org/contributing/Modules2 I tried to modify rlm_example.c to implement a new eap-type authentication(eg something like eap-MD5). I read the above site several times, but I still do not know what I should do for"Comfiguring the Module"in the"Compiling Your Module" section on the above site. the above site said below: You need to make two modifications to the FreeRadius configuration files to add your rlm. First you need to create a module configuration file in the modules directory. See modules/rlm_example for a sample. The contents of the file should look something like: # xxx module xxx { host = "myhost" } This establishes the configuration parameters for the module. Each module gets a separate file. Next you need to add an entry in the appropriate instantiation section for xxx so that it will be called at the proper time. If you are only running one virtual server then you can use the default file in the sites-available directory. In that file you would add your module to the appropriate section. For example in this case: # Authorization. First preprocess (hints and huntgroups files), authorize { preprocess files xxx } Finally you need to check the sites-enabled/ directory and make sure there is a link to the sites-available/ file that includes your module. The link for "default" should already be present. As I konw now,there is two steps I need to do,but I still do not understand how to do them exactly. Can anybody help me or give me some suggestion?The more detailed the better!Thanks! Best regards!
On 26/11/13 05:43, Michael kevin wrote:
Hi all, I followed the site http://wiki.freeradius.org/contributing/Modules2 I tried to modify rlm_example.c to implement a new eap-type
eap types are not normal modules, so copying a normal module won't help. You'll need to copy one of the other eap types; I would use eap-md5 as the base, as it's simplest. There aren't any docs/sample code for this IIRC. Which EAP type do you want to implement? If you're inventing a new one, please don't; there are too many already.
I just mimic the freeradius-server-2.1.12\src\modules\rlm_eap\types\rlm_eap_md5, Now I want to do something step by step: 1.first step,I just want to understand the operations for creating a new module-->compile it to the freeradius server-->use it 2.second step,I design a new authentication protocol for our project,so I need to write a new module for the authentication function. Now,after learned from the site http://wiki.freeradius.org/ contributing/Modules2 I still can not understand something below:(eg I mimic the rlm_eap_MD5,I write a new module name rlm_eap_test) How should I do to edit the configuration files,for using the rlm_eap_test module to work? 1.Should I create a new configuration file in the /usr/local/etc/raddb/modules folder(my freeradius configuration files's location is /usr/local/etc/raddb)? Or should I just edit the inner-eap file(some change in the <eap inner-eap>section like below)or edit other files? md5 { } test{ } ----I add this two line to the inner-eap file 2. I need to add an entry in the appropriate instantiation section for test module, so that it will be called at the proper time. So where and how should I add the entry? The problem puzzled me for several days.I am looking forward for your reply. Thank you very much for your reply!!! Best regards! 2013/11/26 Phil Mayers <p.mayers@imperial.ac.uk>
On 26/11/13 05:43, Michael kevin wrote:
Hi all, I followed the site http://wiki.freeradius.org/contributing/Modules2 I tried to modify rlm_example.c to implement a new eap-type
eap types are not normal modules, so copying a normal module won't help.
You'll need to copy one of the other eap types; I would use eap-md5 as the base, as it's simplest. There aren't any docs/sample code for this IIRC.
Which EAP type do you want to implement? If you're inventing a new one, please don't; there are too many already. - List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html
Michael kevin wrote:
I followed the site http://wiki.freeradius.org/contributing/Modules2 I tried to modify rlm_example.c to implement a new eap-type authentication(eg something like eap-MD5).
It takes a significant amount of effort to implement a new EAP type. I wouldn't suggest it as a starting project.
I read the above site several times, but I still do not know what I should do for"Comfiguring the Module"in the"Compiling Your Module" section on the above site.
You're reading documentation, not code. The only way to understand how to code is to read the code. I would suggest picking rlm_eap_md5, and reading all of it's source code. Then, read the code of the functions used by EAP-MD5. If you don't understand how it works, use a debugging to walk through running code. Once you understand EAP-MD5, you're ready to write your own EAP type. Until then, you won't understand the basics. And everything needed to write an EAP type is built on those basics. Alan DeKok.
participants (3)
-
Alan DeKok -
Michael kevin -
Phil Mayers