landhb / DrawBridge

Layer 4 Single Packet Authentication Linux kernel module utilizing Netfilter hooks and kernel supported Berkeley Packet Filters (BPF)
GNU General Public License v3.0
112 stars 23 forks source link

init_keys always returns error. #4

Closed LaurenIsACoder closed 6 years ago

LaurenIsACoder commented 6 years ago

I'm currently developing a kernel module where I'm performing RSA signature verification. I found your answer on stackoverflow. The public_key always fails at init_keys, dmesg just prints: [!] Could not set the public key. Does dmesg mean the public_key is wrong? How to set public_key in kernel module ? Can you help me out? Here is my public key: -----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqPdPMzEYirodOYw/GoLyFUo547OBHm3O9/KpF6yoW9lqiDHGUF4Hs5pk/tTElSMh2o5wtM1zuehmJHtetnoV16Sko4Fx6C0VXxUqJyg8twKvC4Cj/nmFK4ARayn5AaJRhvIMq560mfh2UotyIL6Zsi+f9Z8usuDP8MWyhM9nZGQIDAQAB -----END PUBLIC KEY-----

Thanks!

landhb commented 6 years ago

Your public key is likely in an incompatible format. Please reference RFC 3447 where it outlines ASN.1 syntax for an RSA public key.. In the DrawBridge readme there is a section that describes how to create a compatible key manually. Additionally the gen_keys.sh script will do it for you.

https://github.com/landhb/DrawBridge/blob/master/gen_keys.sh

LaurenIsACoder commented 6 years ago

I really appreciate it, the problem is solved.