How to test EFN Functionality
2 years ago
Originally Published: 2008-02-28
Article Number
000061168
Issue
How to test EFN Functionality
Resolution

The following procedure can be used to add an IP address into the EFN data tables for testing purposes

1)  Save the atatched code as HashIP.java

2)  Compile the java class"

    javac HashIP.java

3) Run the java program to generate the hash value

   java HashIP 192.168.0.24

   String: 192.168.0.24 hashedValue is: zfcUMKgfIfVH/wwJ9CZBmDRvhHI=

4) Insert the hashed value into the efn Data tables use SQL

insert into efn_local_data values(getdate(),getdate(),'IP','zfcUMKgfIfVH/wwJ9CZBmDRvhHI=',-1,-1,-1,'1/1/09',920,getdate());

insert into efn_local_metadata values(getdate(),'S',0,1);

5) Test Adaptive Authentication from the machine with IP address 192..168.0.24 your EFN rule should fire. 

 

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class HashIP {


 public static void main(String[] args)
 {
  String IP=args[0];
  try
  {
      MessageDigest m_md = MessageDigest.getInstance("SHA1");
      String hashed_ip = new sun.misc.BASE64Encoder().encode(m_md.digest(IP.getBytes()));
      System.out.println("String: "+IP+" hashedValue is: "+hashed_ip);
  }catch (Exception ex)
  {
   System.out.println("catched exception"+ex.getMessage());
  }
 }
  
}