<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>8559</bug_id>
          
          <creation_ts>2015-10-22 15:09:08 +0000</creation_ts>
          <short_desc>Signing to sstate archives and signature verification should allow to use a custom GPG keys directory</short_desc>
          <delta_ts>2016-01-26 14:23:46 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>1.9</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>2.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Istrate">daniel.alexandrux.istrate</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          <qa_contact name="Daniel Istrate">daniel.alexandrux.istrate</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>55617</commentid>
    <comment_count>0</comment_count>
    <who name="Daniel Istrate">daniel.alexandrux.istrate</who>
    <bug_when>2015-10-22 15:09:08 +0000</bug_when>
    <thetext>When signing sstate you should be able to specify where the gpg keys are located.
Similar implementation for rpm signing http://lists.openembedded.org/pipermail/openembedded-core/2015-October/111550.html

if GPG_PATH is specified use that instead of ~/.gnugpg/ .

Steps to validate:
gpg --gen-key &lt;and provide all the details required&gt; --&gt; this will create the gpg keys in ~/.gnugpg

gpg --homedir /home/daniel/poky/meta-selftest/files/signing/ --gen-key &lt;and provide all the details required&gt; --&gt; this will create the gpg keys in your specified directory

To list the keys use:
gpg --list-key
gpg --homedir /home/daniel/poky/meta-selftest/files/signing/ --list-key

1. Add to conf/local.conf (Please update the values accordingly)

SSTATE_SIG_KEY ?= &quot;61EEFB30&quot; &lt;-- the pub key from custom dir (eg. pub   2048R/61EEFB30 2015-10-21)
SSTATE_SIG_PASSPHRASE ?= &quot;test123&quot;
SSTATE_VERIFY_SIG ?= &quot;1&quot;
SSTATE_DIR ?= &apos;/media/ssd/poky-build/daniel-sstate&apos;
GPG_PATH = /home/daniel/poky/meta-selftest/files/signing/

2. bitbake -c cleansstate ed
3. bitbake -c clean ed
4. bitbake ed  &lt;-- should succeed and use the key from GPG_PATH

5. To validate even further:
[daniel@fedora-ws poky-build]$ gpg --verify daniel-sstate/ed/sstate:ed:i586-poky-linux:1.9:r0:i586:3:ed923fc0a937005a38e87d24bc219ec1_populate_sysroot.tgz.sig daniel-sstate/ed/sstate:ed:i586-poky-linux:1.9:r0:i586:3:ed923fc0a937005a38e87d24bc219ec1_populate_sysroot.tgz
gpg: Signature made Thu 22 Oct 2015 01:45:09 PM EEST using RSA key ID 61EEFB30
gpg: Good signature from &quot;testuser (nocomment) &lt;testuser@email.com&gt;&quot;


Also there is an oe-selftest waiting for this feature that also validates #8182
https://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=distrate/bug_8182&amp;id=664fad667aa4102b5ab8ffa3447bfcaa0851c482</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55703</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-10-24 00:13:29 +0000</bug_when>
    <thetext>Patch &apos;sstate: respect GPG_BIN and GPG_HOME&apos; sent to the list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58236</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-01-26 14:23:46 +0000</bug_when>
    <thetext>Merged in oe-core 6daf138822bbbc46960121d3b76b42eaf19e7c0e.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>