Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: users

looking for reading material

 

 

GnuPG users RSS feed   Index | Next | Previous | View Threaded


mr.z.m.wu at gmail

Aug 3, 2012, 11:11 PM

Post #1 of 3 (172 views)
Permalink
looking for reading material

Hello List

I am looking for some reading material related to gpg subkeys in
particular on how they are related to master signing key.

I have an understanding of how public key system works but what eludes
me is how subkeys are tied to the master key

They are all signed by the master key but it is also possible to take
one of the private subkeys and use it on a machine separate from the
master-key machine
>From a sub key machine, if one exports the public key somehow both
master and subkey public keys are exported?

I would like to use a signing subkey to sign rpm packages and it seems
that rpm cannot verify packages signed with a subkey and rpm mailing
list does not respond to my request for more info.
Using a similar process to export signing subkey I was able to test
signing and verifying email though.

I need a much better understanding of how gpg subkeys work to convince
myself that it is the rpm system that lacks the support and thus I
request the info here. Please point me to books and papers. Any
explanation you can give in this email will be appreciated too. If
there is a way to understand better by looking at a particular section
of the source code, please help me navigate the source code.

Sincerely

mr. wu

_______________________________________________
Gnupg-users mailing list
Gnupg-users [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-users


mr.z.m.wu at gmail

Aug 5, 2012, 1:38 AM

Post #2 of 3 (167 views)
Permalink
Re: looking for reading material [In reply to]

Thanks for your references.

I have a better understanding of x509 used in SSL/TLS protocol than
openPGP. So perhaps x509 analogy might help me understand it.

When I issue the following command

gpg --export SUBKEYID

Is this equivalent to generating an intermediate CA and root CA

Let's say I give the output of the above command and give to the end
user and let's say I sign a file with this subkey

When the end user verifies the signature of the file, the user 1)
verifies that the file is signed by the subkey 2) verfies thet subkey
is signed by the master key. Is this correct? In fact, step 2 can be
done at the time of key importing and should not have to be done every
time the user verifies a file? Is this correct?

This will be equivalent to when a client connects to the server, the
server presents the client with both its certificate and the
intermediate CA. The client should already have root CA in the
normal x509 system.


The problem I am having with rpm is that it signed packages with the
subkey without complaint. When it comes to verifying packages it
complains that subkey id is not its keyring even though i imported
already. The correct thing rpm should be doing is checking 1) whether
the package is signed by the subkey -- to do this it needs subkey in
its keyring -- 2) the subkey is signed by the master public key --
this could have been done when it imported two keys the first time and
not every time it verifies a package. Is this the correct
understanding?

It must be that rpm only imported the master public key and drops the
public subkey part. If I can somehow extract the public key of gpg
subkey and feed it to "rpm --import" then rpm might be able to verify
the package but this somehow defeats the web of trust model of
openPGP. On the other hand rpm itself seems to be not relying on the
web of trust for any of its imported keys. So, as far as rpm is
concerned the openPGP subkey concept is moot. Is my understanding
correct? If I still want to use GPG subkey for rpm signing I need to
extract the public key of the subkey only and feed to rpm.

One more question related to the way openpgpg works: when rpm
attempts to verify a package signed with a subkey the complaint it
makes contains the subkey ID. Does that mean that by inspecting a
signed file, an openPGP compliant program like gnupg can tell the ID
of the key used to sign the file? It does not have to go through the
whole key ring to verify the signature of 1 key, right?


On Sat, Aug 4, 2012 at 5:09 AM, Christian Aistleitner
<christian [at] quelltextlich> wrote:
> Dear Mr. Wu,
>
> On Sat, Aug 04, 2012 at 02:11:49AM -0400, zhong ming wu wrote:
>> They are all signed by the master key
>
> Yes, subkeys are bound to the primary key.
> This binding is realized via a "0x18: Subkey Binding Signature" [1].
>
> And the binding signature on a signing subkey additionally contains a
> subpacket holding a "0x19: Primary Key Binding Signature" [1].
>
>> but it is also possible to take
>> one of the private subkeys and use it on a machine separate from the
>> master-key machine
>
> Yes.
> On the "subkey machine" you'll typically have the primary public key
> (no need for the primary private key), and both the private and public
> subkey.
>
>> >From a sub key machine, if one exports the public key somehow both
>> master and subkey public keys are exported?
>
> Yes.
> I hope for others to correct me, but I do not think that there is any
> option to turn this behaviour off (for public keys). However, this
> behaviour is just what I want. Recall that User IDs (name, email
> addresses) are bound to the primary key. The subkeys typically [4]
> know nothing about the User IDs. However, you can of course use keys
> without User IDs.
>
> You could go round and strip and mangle packets by hand, but it raises
> a red flag for me.
>
>> [ Information on subkeys ]
>> Please point me to books and papers.
>
> RFC 4880 [5] is your friend. Especially:
> 5.5.1. Key Packet Variants
> 5.2.1. Signature Types (see types 0x18 and 0x19)
> 11.1. Transferable Public Keys
> 11.2. Transferable Secret Keys
>
> Those sections show that primary and secret keys are much alike (when
> stored), how the binding works and show the typical sequence of
> packets.
>
> To have a look at the packets involved in your own keys, try running
>
> gpg --export | gpg --list-packets
>
> (in a shell). To look just at a single key, use
>
> gpg --export KEYID | gpg --list-packets
>
> where KEYID is the id of the key to look at.
>
>
> All the best,
> Christian
>
>
>
> [1] http://tools.ietf.org/rfcmarkup?doc=4880#section-5.2.1
>
> [2] http://tools.ietf.org/rfcmarkup?doc=4880#section-5.5.1.1
>
> [3] http://tools.ietf.org/rfcmarkup?doc=4880#section-5.5.1.2
>
> [4] See
> http://tools.ietf.org/rfcmarkup?doc=4880#section-11
> which "describes the rules for how packets should be placed into
> sequences." Yes, it only says /should/, but there, subkeys do not have
> User IDs.
>
> [5] http://tools.ietf.org/rfcmarkup?doc=4880#section-5.2.1
>
>
>
> --
> ---- quelltextlich e.U. ---- \\ ---- Christian Aistleitner ----
> Companies' registry: 360296y in Linz
> Christian Aistleitner
> Gruendbergstrasze 65a Email: christian [at] quelltextlich
> 4040 Linz, Austria Phone: +43 732 / 26 95 63
> Fax: +43 732 / 26 95 63
> Homepage: http://quelltextlich.at/
> ---------------------------------------------------------------

_______________________________________________
Gnupg-users mailing list
Gnupg-users [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-users


dkg at fifthhorseman

Aug 5, 2012, 7:13 AM

Post #3 of 3 (167 views)
Permalink
Re: looking for reading material [In reply to]

On 08/05/2012 04:38 AM, zhong ming wu wrote:
> Let's say I give the output of the above command and give to the end
> user and let's say I sign a file with this subkey

i note that your subkey should have the "signing" usage flag set. That
is, it should show up under gpg --edit-key with "usage: S". Otherwise,
that subkey has no business signing data and its signatures *should* be
ignored.

key usage flags:

https://tools.ietf.org/html/rfc4880#section-5.2.3.21

Note that signing- or certification-capable subkeys should also have an
embedded primary key binding signature, to indicate that they really do
belong to the primary key.

primary key binding sigs:

https://tools.ietf.org/html/rfc4880#page-71

> When the end user verifies the signature of the file, the user 1)
> verifies that the file is signed by the subkey 2) verfies thet subkey
> is signed by the master key. Is this correct? In fact, step 2 can be
> done at the time of key importing and should not have to be done every
> time the user verifies a file? Is this correct?

sure, those steps seem reasonable.

> This will be equivalent to when a client connects to the server, the
> server presents the client with both its certificate and the
> intermediate CA. The client should already have root CA in the
> normal x509 system.

i don't think your X.509 analogies are as close as you'd like them to
be. In standard TLS connections, each peer hands their certificate (and
any intermediate certs) to the other peer as part of establishing the
connection.

Most data signed via OpenPGP does not have *any* certificate ("openpgp
keyblock") directly attached to it. The common assumption in this model
is that public key material has been exchanged via some other mechanism
already.

> The problem I am having with rpm is that it signed packages with the
> subkey without complaint. When it comes to verifying packages it
> complains that subkey id is not its keyring even though i imported
> already. The correct thing rpm should be doing is checking 1) whether
> the package is signed by the subkey -- to do this it needs subkey in
> its keyring -- 2) the subkey is signed by the master public key --
> this could have been done when it imported two keys the first time and
> not every time it verifies a package. Is this the correct
> understanding?

What you describe does sound like a bug in rpm's signature validation
policy. I haven't tested it myself.

> One more question related to the way openpgpg works: when rpm
> attempts to verify a package signed with a subkey the complaint it
> makes contains the subkey ID. Does that mean that by inspecting a
> signed file, an openPGP compliant program like gnupg can tell the ID
> of the key used to sign the file?

Most OpenPGP signatures contain the 64-bit keyid of the signature issuer
in an "issuer subpacket":

https://tools.ietf.org/html/rfc4880#section-5.2.3.5

Technically, multiple keys can have the same 64-bit keyid -- the 64-bit
space is too small to avoid collisions made by a determined attacker
(among other possible threats).

But in the common use case, this is sufficient to greatly reduce the
number of keys the verifier needs to consider when checking the signature.

> It does not have to go through the
> whole key ring to verify the signature of 1 key, right?

I'm not sure what you mean by "go through the whole keyring" -- if rpm's
keyring, like gpg's, is unindexed, then rpm will need to go through the
keyring to find the key that matches the keyid found in the issuer. It
does not need to check the signature against any of the non-matching
keys, though.

hth,

--dkg
Attachments: signature.asc (1.01 KB)

GnuPG users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.