Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


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

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

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)

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

What could be the error?

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

Rep: Reputation: 76
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().


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 01:29 PM
Help, loadable kernel module . ERBRMN Linux - General 3 10-13-2006 07:34 AM
kernel module compilation error in RHEL4.0 sd_nitdgp Red Hat 0 08-05-2006 01:29 PM
Not Finding pcibios_* functions in RHEL4 (2.6.9)..module compilation problem kumarnine Programming 1 04-13-2006 08:23 AM
loadable kernel module brajesh Linux - General 2 01-17-2003 12:54 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:43 AM.

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