# Issue with key verification using Directory Update Module

**URL:** <https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074>\
**Category:** General Discussions\
**Created:** [May 31, 2019, 1:47pm UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074 "2019-05-31T13:47:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [May 31, 2019, 1:47pm UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/1 "2019-05-31T13:47:23Z")

</div>

I’m trying to use this module, but it seems that there’s something going wrong with key verification.  
I used mender-artifact sign to sign the .mender file containing a directory. The device downloads the file, but then sayd:  
“Fetching Artifact headers failed: installer: failed to read Artifact: readHeaderV3: reader: invalid signature: crypto/rsa: verification error”

Am I missing something?

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [June 3, 2019, 6:53am UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/2 "2019-06-03T06:53:56Z")

</div>

I can’t say whether this is the cause of your issue, but there is definitely a [serious bug](https://tracker.mender.io/browse/MEN-2573) when using the `sign` command on an artifact using update modules. Signing while creating the original artifact seems to work though, but there is an additional bug in 2.0.0 which prevents the argument from taking effect.

Can you try this workaround:

1. Download the [directory-artifact-gen from 2.0.x](https://raw.githubusercontent.com/mendersoftware/mender/2.0.x/support/modules-artifact-gen/directory-artifact-gen).
2. Using this new generator, create the artifact again, and while doing so, append these arguments to the end:

```auto
-- -k private.key

```

Where `private.key` is the key you use to sign the artifact.
3. Then retry the deployment.

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [June 7, 2019, 11:54am UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/3 "2019-06-07T11:54:36Z")

</div>

Somehow, using the latest still doesn’t work correctly it seems. Still the same error.

Looking at the mender UI, the package seems signed correctly, and contains the update.tar and dest\_dir files.

Is this something in mender client2.0.0?

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [June 11, 2019, 4:57pm UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/4 "2019-06-11T16:57:42Z")

</div>

Any update on this? You guys need more info on my environment or situation to diagnose this?

Server not the hosted cloud mender, but running on 2.0. Client is on 2.0 as well.

according to mender-artifact verify, the resulting .mender file is correct.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [June 12, 2019, 6:14am UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/5 "2019-06-12T06:14:25Z")

</div>

Hmm, nothing immediate comes to mind; it’s a brand new error to me. You say that mender-artifact verifies the file. Does that include passing the `-k` argument and the public key to have the signature verified as well?

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [June 12, 2019, 6:38am UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/6 "2019-06-12T06:38:14Z")

</div>

Yes, this is including the -k.

1 thing I haven’t tried yet, is to run mender-artifact verify on the device. But this shouldn’t matter.

Any other suggestions to check out? Anyone gotten this to work?

(Also, I’d be happy to do a teamviewer session or so to figure this out…)

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [June 12, 2019, 6:57am UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/7 "2019-06-12T06:57:40Z")

</div>

Can you post the output from `mender-artifact read <artifact.mender>`?

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [June 12, 2019, 7:21am UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/8 "2019-06-12T07:21:15Z")

</div>

Output, including invocation:

./mender-artifact read output.mender -k public.key  
Mender artifact:  
Name: testapp-3  
Format: mender  
Version: 3  
Signature: signed and verified correctly  
Compatible devices: ‘[raspberrypi3]’  
Provides group:  
Depends on one of artifact(s): []  
Depends on one of group(s): []  
State scripts:

```
Updates:
    0:
    Type: directory
    Provides: Nothing
    Depends: Nothing
    Metadata: Nothing
    Files:
      name: update.tar
      size: 10240
      modified: 2019-06-11 18:53:39 +0200 DST
      checksum: 5a23f139c5fa97881876cd81b32b3b8c4bda0d8861844e8cc608ca34d68a596a
    Files:
      name: dest_dir
      size: 9
      modified: 2019-06-11 18:53:39 +0200 DST
      checksum: 77516a23517355d95d8eb3014d6309e5ab38efe8abdfb90bc91ef1191fbd7aef
```

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [June 13, 2019, 7:16am UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/9 "2019-06-13T07:16:40Z")

</div>

Nothing out of the ordinary AFAICS. Any chance you could post the artifact? Or perhaps one without sensitive content, if you can still reproduce it then. Preferably the public key as well.

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [June 13, 2019, 7:38am UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/10 "2019-06-13T07:38:19Z")

</div>

See attached.

My main objective is working around a firmware updating issue I have with my raspberry’s though.

(Attachment public.key is missing)

(Attachment output.mender is missing)

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [June 13, 2019, 7:40am UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/11 "2019-06-13T07:40:45Z")

</div>

How would I go about posting the artifact and key file? I tried attaching them, but I get an error about dangerous extensions…

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [June 13, 2019, 4:55pm UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/12 "2019-06-13T16:55:04Z")

</div>

I’m not sure but maybe putting them in a zip file will work. I guess it depends on how aggressive discourse is about scanning.

The other option is to put them on google drive or some such and just post a link.

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [June 17, 2019, 7:58am UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/13 "2019-06-17T07:58:16Z")

</div>

How about posting them at [https://send.firefox.com/](https://send.firefox.com/) ?

---

<div class="post-metadata">

**Author:** ![ajithpv](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ajithpv/32/728_2.png) [@ajithpv](https://hub.mender.io/u/ajithpv)\
**Post date:** [June 17, 2019, 10:45am UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/14 "2019-06-17T10:45:07Z")

</div>

Another tool - [https://wetransfer.com/](https://wetransfer.com/)

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [June 17, 2019, 4:35pm UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/15 "2019-06-17T16:35:47Z")

</div>

Wasn’t sure if external links were unwanted in here.

There we go: [https://wetransfer.com/downloads/6f4300abc87032140226529dd70d06c520190617163507/1e05c370b882fba45b3574219e9db80520190617163507/dfdc3f](https://wetransfer.com/downloads/6f4300abc87032140226529dd70d06c520190617163507/1e05c370b882fba45b3574219e9db80520190617163507/dfdc3f)

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [June 18, 2019, 8:29am UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/16 "2019-06-18T08:29:35Z")

</div>

I cannot reproduce it unfortunately. With your artifact and key, I get:

```auto
installer: authenticated digital signature of artifact

```

And the install proceeds correctly.

How are you building the client? With Yocto?

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [June 18, 2019, 12:18pm UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/17 "2019-06-18T12:18:47Z")

</div>

Yes, I’m using Yocto.

I have set the following in my local.conf:

PREFERRED\_VERSION\_pn-mender = “2.%”  
PREFERRED\_VERSION\_pn-mender-artifact = “3.%”  
PREFERRED\_VERSION\_pn-mender-artifact-native = “3.%”

---

<div class="post-metadata">

**Author:** ![ajithpv](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ajithpv/32/728_2.png) [@ajithpv](https://hub.mender.io/u/ajithpv)\
**Post date:** [June 18, 2019, 12:33pm UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/18 "2019-06-18T12:33:09Z")

</div>

Just to make sure, whether the below version numbers are same as what mentioned in the local.conf? I’m not sure both are taking the same or different versions so asked 🙂

```auto
PREFERRED_VERSION_pn-mender = "2.0.%"
PREFERRED_VERSION_pn-mender-artifact = "3.0.%"
PREFERRED_VERSION_pn-mender-artifact-native = "3.0.%"

```

---

<div class="post-metadata">

**Author:** ![mterwoord](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mterwoord/32/100_2.png) [@mterwoord](https://hub.mender.io/u/mterwoord)\
**Post date:** [June 18, 2019, 12:55pm UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/19 "2019-06-18T12:55:36Z")

</div>

Yes, but without the 0. part, so my mender version is 2.% instead of 2.0.%  
Is that required to get this working?

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [June 18, 2019, 1:16pm UTC](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074/20 "2019-06-18T13:16:09Z")

</div>

We only have version `2.0.0` available meaning that `2.0.%` and `2.%` will both use the same recipe currently and should be unrelated to the problems you are having. Same applies to mender-artifact (`3.0.0`)

[Next page](https://hub.mender.io/t/issue-with-key-verification-using-directory-update-module/1074.md?page=2)
