# [Solved]Can't sign kernel module. Unrecognized character.

## Frustration

Hi,

I'm trying to sign kernel modules:

```
# perl /usr/src/linux/scripts/sign-file sha512 /usr/src/linux/certs/signing_key.pem /usr/src/linux/certs/signing_key.x509 /lib/modules/4.4.21-gentoo/video/nvidia-drm.ko
```

However I get:

```
Unrecognized character \x7F; marked by <-- HERE after <-- HERE near column 1 at /usr/src/linux/scripts/sign-file line 1.
```

Googling didn't help me at all, very rare problem. I've tried appending "use utf8" parameter to perl command and using .priv key instead of .pem, but that doesn't help.

My kernel settings if that helps:

```
zcat /proc/config.gz | grep CONFIG_MODULE_SIG

CONFIG_MODULE_SIG=y

CONFIG_MODULE_SIG_FORCE=y

CONFIG_MODULE_SIG_ALL=y

# CONFIG_MODULE_SIG_SHA1 is not set

# CONFIG_MODULE_SIG_SHA224 is not set

# CONFIG_MODULE_SIG_SHA256 is not set

# CONFIG_MODULE_SIG_SHA384 is not set

CONFIG_MODULE_SIG_SHA512=y

CONFIG_MODULE_SIG_HASH="sha512"

CONFIG_MODULE_SIG_KEY="certs/signing_key.pem"
```

Thanks!Last edited by Frustration on Sat Oct 01, 2016 10:57 am; edited 1 time in total

----------

## quilosaq

 *Frustration wrote:*   

> ...
> 
> Googling didn't help me at all, very rare problem
> 
> ...

 

https://wiki.gentoo.org/wiki/Signed_kernel_module_support#Manually_signing_modules

See if this helps.

----------

## Frustration

quilosaq,

Thanks, man!

It did help me. Sorry for my inattentiveness, I had seen that wiki page before but for some reason thought that it was all the same perl script, not a binary. Everything works now.

----------

