LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-05-2012, 11:25 PM   #1
barunparichha
Member
 
Registered: Jun 2006
Location: Bangalore,india
Distribution: Linux(Redhat,fedora,suse,ubantu), Solaris (s8/s9/s10/nevada/open-solaris)
Posts: 303

Rep: Reputation: 32
AES Encryption Error: Unknown symbol crypto_alloc_base


aesTest.c
Code:
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/crypto.h>
#define ALG_CCMP_KEY_LEN 16
    int init_module(void)
    {
        struct crypto_cipher *tfm;
        const u8 key[16]= "my key";
        u8 in[20] ="I Love India";
        u8 encrypted[200];
        u8 decrypted[200];
        printk(KERN_INFO ">>>>>>>>aesModule Insmoded>>>>>>>>\n");
        printk(KERN_INFO ">>>>>>>>Plain:%s \n",in);
        tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);

        //if (!IS_ERR(tfm))
                crypto_cipher_setkey(tfm, key, ALG_CCMP_KEY_LEN);

        crypto_cipher_encrypt_one(tfm, encrypted, in);
        printk(KERN_INFO ">>>>Encrypted :%s \n",encrypted);
        crypto_cipher_decrypt_one(tfm, decrypted, encrypted);
        printk(KERN_INFO ">>>>Decrypted :%s \n ",decrypted);


        return 0;
    }

    void cleanup_module(void)
    {
        printk(KERN_INFO ">>>>>>>>aesModule Removed>>>>>>>>\n");
    }
Makefile
Code:
obj-m += aesTest.o

all:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
Error found:
Code:
#insmod aesTest.ko
aesTest: Unknown symbol crypto_alloc_base
insmod: error inserting 'aesTest.ko': -1 Unknown symbol in module
Any help will be appreciated.
With Thanks,
Barun
 
Old 02-06-2012, 11:45 PM   #2
barunparichha
Member
 
Registered: Jun 2006
Location: Bangalore,india
Distribution: Linux(Redhat,fedora,suse,ubantu), Solaris (s8/s9/s10/nevada/open-solaris)
Posts: 303

Original Poster
Rep: Reputation: 32
I resolved this issue by adding below code to the end of the module.

Code:
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Barun code for aes encryption test");
MODULE_AUTHOR("Barun Parichha<barun.parichha@gmail.com>");
MODULE_ALIAS("test");
Reason for this error:
http://docs.blackfin.uclinux.org/ker...g/ch09s02.html
symbols exported with EXPORT_SYMBOL(), can only be seen by modules with a MODULE_LICENSE() that specifies a GPL compatible license.

Regards,
Barun
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] insmod unifi_sdio.ko ERROR : Unknown Symbol blink182 Linux - Networking 2 03-10-2011 02:24 AM
error: Unknown symbol leds_list beparas Linux - Software 0 12-31-2008 06:11 AM
OpenSSL Encryption with AES kaplan71 Linux - Software 3 11-26-2008 12:46 PM
Need help with loop-aes encryption. yanik Linux - Software 0 04-20-2006 07:59 AM
Unknown symbol error with azalia soundcard debianbox Debian 3 02-28-2005 07:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration