LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 03-25-2008, 05:35 AM   #1
nikhil86
LQ Newbie
 
Registered: Apr 2007
Posts: 17

Rep: Reputation: 0
loadable kernel module compilation error for SHA1 functions


Hi
I'm writing a loadable kernel module for integrity checking.

My first goal was to get a SHA1 on every file invoked on a Linux system.
For this i'm using the LSM hook inode_permission.
I've #include <linux/crypto.h>, but still i get the following compilation error:

/root/project/ver_6.4/m2.c: In function ‘do_readfile’:
/root/project/ver_6.4/m2.c:27: error: invalid use of undefined type ‘struct page’
/root/project/ver_6.4/m2.c:28: error: implicit declaration of function ‘offset_in_page’
/root/project/ver_6.4/m2.c:31: error: implicit declaration of function ‘crypto_digest_update’
/root/project/ver_6.4/m2.c: In function ‘calculate_sha1’:
/root/project/ver_6.4/m2.c:49: error: implicit declaration of function ‘crypto_digest_init’
/root/project/ver_6.4/m2.c:56: error: implicit declaration of function ‘crypto_digest_final’


My makefile is as follows:

obj-m := m2.o

KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules


What could be the error?

Nikhil.
 
Old 03-25-2008, 10:08 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
Your problem is that you are using the old crypto api. Use the new functions such as crypto_alloc_hash(), crypto_hash_digest(), and crypto_free_hash().
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Problems with cross compilation of a loadable driver module for powerPC renergy Linux - Newbie 1 10-16-2007 02:29 PM
Help, loadable kernel module . ERBRMN Linux - General 3 10-13-2006 08:34 AM
kernel module compilation error in RHEL4.0 sd_nitdgp Red Hat 0 08-05-2006 02:29 PM
Not Finding pcibios_* functions in RHEL4 (2.6.9)..module compilation problem kumarnine Programming 1 04-13-2006 09:23 AM
loadable kernel module brajesh Linux - General 2 01-17-2003 01:54 AM


All times are GMT -5. The time now is 10:14 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration