Tag Archives: module

Computing a HMAC inside the Linux kernel

Recently I’ve been experimenting with Hash-based Message Authentication Code (HMAC) and I got to the point where I had to implement it inside a kernel module. Not having any experience with how I could go about doing it, I went searching for the Crypto API on the Internet. Surprise surprise, there isn’t much to search on. I really can’t understand why there’s so much obfuscation when it comes to kernel APIs. Oh well…

All that was left for me to do was to start digging through the kernel source files and to try to piece the puzzle together. Without further ado, here is what I managed to create.
read more »

Writing Loadable Kernel Modules using netfilter hooks (in-depth HOWTO) – Part 1

Note: This article was inspired by the lack of updated documentation on how to write proper netfilter kernel modules. At the time I’m writing this article, the latest stable release was 2.6.32.8. I am also assuming you are familiar with how LKMs (Loadable Kernel Modules) work. If you are not, then you might want to check this article first: tldp.org/HOWTO/Module-HOWTO/

In this article (Part 1) I will present how to create a simple Linux kernel module that implements a netfilter hook for a generic transport protocol (not one of the usual ones).

In Part 2, I plan to connect the module to the iptables rules generated on the userspace side.
read more »