Skip to contentSkip to conversation

Making a secure hash function avaiable during early boot?

RFC In review Hans de Goede 4 participants 11 messages Jul 30, 2019 – Jul 31, 2019 Crypto API

lore
Share & tools
lore
#0 lore raw

cover Making a secure hash function avaiable during early boot?

Hi All,

During the first half of 2018 I wrote a patch series to the Linux EFI and firmware-loader code, which allows loading peripheral firmware which is embedded/hidden inside the EFI firmware through the standard firmware-loading mechanism.

The main motivation for this is to get the touchscreen to work OOTB on various cheap x86 tablets which come with a touchscreen controller which need to have device(model)-specific firmware loaded; and we have been unable to acquire permission to re-distribute this firmware-s in linux-firmware.

This patch series works by extending the per model touchscreen data which we already built into the kernel in drivers/platform/x86/touchscreen_dmi.c with some extra info: a 8 byte header to search for, the lenght of the firmware image and a the expected hash of the firmware for that model.

During boot, after setting up memory management (so that kmalloc work) and before calling all the various init functions such as subsys_init calls from rest_init, the EFI code does a DMI check and if the system in question is in the list of systems with EFI embedded fw which we want i tgoes over all EFI_BOOT_SERVICES_CODE sections searching for the described firmware.

After 6 revisions this series stalled on the lack of a hash algorithm which can be used during early boot.

The plan was to wait for the zinc crypto code to get used and use a hash algorithm from that, but that still has not happened, which is my main reason for sending out this email.

For the last couple of revisions of the patch set I've been using a set of patches by Andy Lutomirski which make the sha256-generic code usable without calling crypto_alloc_shash() etc. Using crypto_alloc_shash() is not possible because that depends on crypto_register_shash having been called which is done as a subsys_initcall() and thus too late.

I cannot move the efi_check_for_embedded_firmwares() call later for 2 reasons:
1) Some of the subsys_init calls may rely on some of the embedded firmwares
2) It needs to be one before efi_free_boot_services() gets called, which is not something which can safely / easily be moved to a later stage.

So my question is, would it be possible for the patches from Andy (which I'm sending together with this email) to get merged so that there is a generic secure hash available before subsys_initcall() time; or do you (the crypto maintainers) have any other idea how to solve this?

Note I'm open to changing to a different hash function, the hashes are embedded into drivers/platform/x86/touchscreen_dmi.c and I've access to dumps of all firmwares for which I want to initially add support so I can calculate another hash for the files.

Regards,

Hans

#1 lore raw

RFC 1/3 crypto/sha256: Factor out the parts of base API that don't use shash_desc

From: Andy Lutomirski <[email protected]>

I want to expose a minimal SHA256 API that can be used without the depending on the crypto core. To prepare for this, factor out the meat of the sha256_base_*() helpers.

Cc Ard Biesheuvel <[email protected]>
Cc Herbert Xu <[email protected]>
---
 include/crypto/sha256_base.h | 53 ++++++++++++++++++++++++------------
 1 file changed, 36 insertions(+), 17 deletions(-)
include/crypto/sha256_base.h +36 -17
index 59159bc944f5..5317946a813a 100644
@@ -15,10 +15,8 @@
 typedef void (sha256_block_fn)(struct sha256_state *sst, u8 const *src,
 			       int blocks);
 
-static inline int sha224_base_init(struct shash_desc *desc)
+static inline void sha224_init_direct(struct sha256_state *sctx)
 {
-	struct sha256_state *sctx = shash_desc_ctx(desc);
-
 	sctx->state[0] = SHA224_H0;
 	sctx->state[1] = SHA224_H1;
 	sctx->state[2] = SHA224_H2;
@@ -28,14 +26,16 @@ static inline int sha224_base_init(struct shash_desc *desc)
 	sctx->state[6] = SHA224_H6;
 	sctx->state[7] = SHA224_H7;
 	sctx->count = 0;
+}
 
+static inline int sha224_base_init(struct shash_desc *desc)
+{
+	sha224_init_direct(shash_desc_ctx(desc));
 	return 0;
 }
 
-static inline int sha256_base_init(struct shash_desc *desc)
+static inline void sha256_init_direct(struct sha256_state *sctx)
 {
-	struct sha256_state *sctx = shash_desc_ctx(desc);
-
 	sctx->state[0] = SHA256_H0;
 	sctx->state[1] = SHA256_H1;
 	sctx->state[2] = SHA256_H2;
@@ -45,16 +45,19 @@ static inline int sha256_base_init(struct shash_desc *desc)
 	sctx->state[6] = SHA256_H6;
 	sctx->state[7] = SHA256_H7;
 	sctx->count = 0;
+}
 
+static inline int sha256_base_init(struct shash_desc *desc)
+{
+	sha256_init_direct(shash_desc_ctx(desc));
 	return 0;
 }
 
-static inline int sha256_base_do_update(struct shash_desc *desc,
-					const u8 *data,
-					unsigned int len,
-					sha256_block_fn *block_fn)
+static inline void __sha256_base_do_update(struct sha256_state *sctx,
+					   const u8 *data,
+					   unsigned int len,
+					   sha256_block_fn *block_fn)
 {
-	struct sha256_state *sctx = shash_desc_ctx(desc);
 	unsigned int partial = sctx->count % SHA256_BLOCK_SIZE;
 
 	sctx->count += len;
@@ -83,15 +86,21 @@ static inline int sha256_base_do_update(struct shash_desc *desc,
 	}
 	if (len)
 		memcpy(sctx->buf + partial, data, len);
+}
 
+static inline int sha256_base_do_update(struct shash_desc *desc,
+					const u8 *data,
+					unsigned int len,
+					sha256_block_fn *block_fn)
+{
+	__sha256_base_do_update(shash_desc_ctx(desc), data, len, block_fn);
 	return 0;
 }
 
-static inline int sha256_base_do_finalize(struct shash_desc *desc,
-					  sha256_block_fn *block_fn)
+static inline void sha256_do_finalize_direct(struct sha256_state *sctx,
+					     sha256_block_fn *block_fn)
 {
 	const int bit_offset = SHA256_BLOCK_SIZE - sizeof(__be64);
-	struct sha256_state *sctx = shash_desc_ctx(desc);
 	__be64 *bits = (__be64 *)(sctx->buf + bit_offset);
 	unsigned int partial = sctx->count % SHA256_BLOCK_SIZE;
 
@@ -106,14 +115,18 @@ static inline int sha256_base_do_finalize(struct shash_desc *desc,
 	memset(sctx->buf + partial, 0x0, bit_offset - partial);
 	*bits = cpu_to_be64(sctx->count << 3);
 	block_fn(sctx, sctx->buf, 1);
+}
 
+static inline int sha256_base_do_finalize(struct shash_desc *desc,
+					  sha256_block_fn *block_fn)
+{
+	sha256_do_finalize_direct(shash_desc_ctx(desc), block_fn);
 	return 0;
 }
 
-static inline int sha256_base_finish(struct shash_desc *desc, u8 *out)
+static inline void __sha256_base_finish(struct sha256_state *sctx,
+					unsigned int digest_size, u8 *out)
 {
-	unsigned int digest_size = crypto_shash_digestsize(desc->tfm);
-	struct sha256_state *sctx = shash_desc_ctx(desc);
 	__be32 *digest = (__be32 *)out;
 	int i;
 
@@ -121,5 +134,11 @@ static inline int sha256_base_finish(struct shash_desc *desc, u8 *out)
 		put_unaligned_be32(sctx->state[i], digest++);
 
 	*sctx = (struct sha256_state){};
+}
+
+static inline int sha256_base_finish(struct shash_desc *desc, u8 *out)
+{
+	__sha256_base_finish(shash_desc_ctx(desc),
+			     crypto_shash_digestsize(desc->tfm), out);
 	return 0;
 }
Signature · 1 line
2.21.0
#2 lore raw

RFC 2/3 crypto/sha256: Export a sha256_{init,update,final}_direct() API

In reply to Hans de Goede

From: Andy Lutomirski <[email protected]>

This provides a very simple interface for kernel code to use to do synchronous, unaccelerated, virtual-address-based SHA256 hashing without needing to create a crypto context.

Subsequent patches will make this work without building the crypto core and will use to avoid making BPF-based tracing depend on crypto.

Cc Ard Biesheuvel <[email protected]>
Cc Herbert Xu <[email protected]>
---
 crypto/sha256_generic.c      | 31 ++++++++++++++++++++++++++-----
 include/crypto/sha.h         | 24 ++++++++++++++++++++++++
 include/crypto/sha256_base.h | 13 -------------
 3 files changed, 50 insertions(+), 18 deletions(-)
crypto/sha256_generic.c +26 -5
index b7502a96a0d4..4e7265e0b40d 100644
@@ -235,24 +235,45 @@ static void sha256_generic_block_fn(struct sha256_state *sst, u8 const *src,
 	}
 }
 
+void sha256_update_direct(struct sha256_state *sctx, const u8 *data,
+			  unsigned int len)
+{
+	__sha256_base_do_update(sctx, data, len, sha256_generic_block_fn);
+}
+EXPORT_SYMBOL(sha256_update_direct);
+
 int crypto_sha256_update(struct shash_desc *desc, const u8 *data,
 			  unsigned int len)
 {
-	return sha256_base_do_update(desc, data, len, sha256_generic_block_fn);
+	sha256_update_direct(shash_desc_ctx(desc), data, len);
+	return 0;
 }
 EXPORT_SYMBOL(crypto_sha256_update);
 
 static int sha256_final(struct shash_desc *desc, u8 *out)
 {
-	sha256_base_do_finalize(desc, sha256_generic_block_fn);
-	return sha256_base_finish(desc, out);
+	__sha256_final_direct(shash_desc_ctx(desc),
+			      crypto_shash_digestsize(desc->tfm), out);
+	return 0;
 }
 
+void __sha256_final_direct(struct sha256_state *sctx, unsigned int digest_size,
+			   u8 *out)
+{
+	sha256_do_finalize_direct(sctx, sha256_generic_block_fn);
+	__sha256_base_finish(sctx, digest_size, out);
+}
+EXPORT_SYMBOL(sha256_final_direct);
+
 int crypto_sha256_finup(struct shash_desc *desc, const u8 *data,
 			unsigned int len, u8 *hash)
 {
-	sha256_base_do_update(desc, data, len, sha256_generic_block_fn);
-	return sha256_final(desc, hash);
+	struct sha256_state *sctx = shash_desc_ctx(desc);
+	unsigned int digest_size = crypto_shash_digestsize(desc->tfm);
+
+	sha256_update_direct(sctx, data, len);
+	__sha256_final_direct(sctx, digest_size, hash);
+	return 0;
 }
 EXPORT_SYMBOL(crypto_sha256_finup);
 
include/crypto/sha.h +24 -0
index 8a46202b1857..737a553afd27 100644
@@ -93,6 +93,30 @@ struct sha512_state {
 	u8 buf[SHA512_BLOCK_SIZE];
 };
 
+static inline void sha256_init_direct(struct sha256_state *sctx)
+{
+	sctx->state[0] = SHA256_H0;
+	sctx->state[1] = SHA256_H1;
+	sctx->state[2] = SHA256_H2;
+	sctx->state[3] = SHA256_H3;
+	sctx->state[4] = SHA256_H4;
+	sctx->state[5] = SHA256_H5;
+	sctx->state[6] = SHA256_H6;
+	sctx->state[7] = SHA256_H7;
+	sctx->count = 0;
+}
+
+extern void sha256_update_direct(struct sha256_state *sctx, const u8 *data,
+				 unsigned int len);
+
+extern void __sha256_final_direct(struct sha256_state *sctx,
+				  unsigned int digest_size, u8 *out);
+
+static inline void sha256_final_direct(struct sha256_state *sctx, u8 *out)
+{
+	__sha256_final_direct(sctx, SHA256_DIGEST_SIZE, out);
+}
+
 struct shash_desc;
 
 extern int crypto_sha1_update(struct shash_desc *desc, const u8 *data,
include/crypto/sha256_base.h +0 -13
index 5317946a813a..0883928f87dd 100644
@@ -34,19 +34,6 @@ static inline int sha224_base_init(struct shash_desc *desc)
 	return 0;
 }
 
-static inline void sha256_init_direct(struct sha256_state *sctx)
-{
-	sctx->state[0] = SHA256_H0;
-	sctx->state[1] = SHA256_H1;
-	sctx->state[2] = SHA256_H2;
-	sctx->state[3] = SHA256_H3;
-	sctx->state[4] = SHA256_H4;
-	sctx->state[5] = SHA256_H5;
-	sctx->state[6] = SHA256_H6;
-	sctx->state[7] = SHA256_H7;
-	sctx->count = 0;
-}
-
 static inline int sha256_base_init(struct shash_desc *desc)
 {
 	sha256_init_direct(shash_desc_ctx(desc));
Signature · 1 line
2.21.0
#3 lore raw

RFC 3/3 crypto/sha256: Build the SHA256 core separately from the crypto module

In reply to Hans de Goede

From: Andy Lutomirski <[email protected]>

This just moves code around -- no code changes in this patch. This wil let BPF-based tracing link against the SHA256 core code without depending on the crypto core.

Cc Ard Biesheuvel <[email protected]>
Cc Herbert Xu <[email protected]>
---
 crypto/Kconfig                               |   8 +
 crypto/Makefile                              |   1 +
 crypto/{sha256_generic.c => sha256_direct.c} | 103 +--------
 crypto/sha256_generic.c                      | 214 -------------------
 4 files changed, 15 insertions(+), 311 deletions(-)
 copy crypto/{sha256_generic.c => sha256_direct.c} (76%)
crypto/Kconfig +8 -0
index e801450bcb1c..3f4daf6632e4 100644
@@ -10,6 +10,13 @@ config XOR_BLOCKS
 #
 source "crypto/async_tx/Kconfig"
 
+#
+# Cryptographic algorithms that are usable without the Crypto API.
+# None of these should have visible config options.
+#
+config CRYPTO_SHA256_DIRECT
+	bool
+
 #
 # Cryptographic API Configuration
 #
@@ -931,6 +938,7 @@ config CRYPTO_SHA1_PPC_SPE
 
 config CRYPTO_SHA256
 	tristate "SHA224 and SHA256 digest algorithm"
+	select CRYPTO_SHA256_DIRECT
 	select CRYPTO_HASH
 	help
 	  SHA256 secure hash standard (DFIPS 180-2).
crypto/Makefile +1 -0
index 9479e1a45d8c..70c6bbfb4e38 100644
@@ -66,6 +66,7 @@ obj-$(CONFIG_CRYPTO_RMD160) += rmd160.o
 obj-$(CONFIG_CRYPTO_RMD256) += rmd256.o
 obj-$(CONFIG_CRYPTO_RMD320) += rmd320.o
 obj-$(CONFIG_CRYPTO_SHA1) += sha1_generic.o
+obj-$(CONFIG_CRYPTO_SHA256_DIRECT) += sha256_direct.o
 obj-$(CONFIG_CRYPTO_SHA256) += sha256_generic.o
 obj-$(CONFIG_CRYPTO_SHA512) += sha512_generic.o
 obj-$(CONFIG_CRYPTO_SHA3) += sha3_generic.o
crypto/sha256_direct.c renamed from crypto/sha256_generic.c +6 -97

129 lines not on this page · raw message

crypto/sha256_generic.c +0 -214

232 lines not on this page · raw message

Signature · 1 line
2.21.0
#4 lore raw

Re: [RFC 3/3] crypto/sha256: Build the SHA256 core separately from the crypto module

Am Dienstag, 30. Juli 2019, 14:38:35 CEST schrieb Hans de Goede:

Hi Hans,

Quoted 6 lines

From: Andy Lutomirski <[email protected]>

This just moves code around -- no code changes in this patch. This wil let BPF-based tracing link against the SHA256 core code without depending on the crypto core.

Quoted 7 lines
Cc Ard Biesheuvel <[email protected]>
Cc Herbert Xu <[email protected]>
---
 crypto/Kconfig                               |   8 +
 crypto/Makefile                              |   1 +
 crypto/{sha256_generic.c => sha256_direct.c} | 103 +--------

There is a similar standalone code present for SHA-1 or ChaCha20. However, this code lives in lib/.

Thus, shouldn't the SHA-256 core code be moved to lib/ as well?

Ciao
Stephan

#5 lore raw

Re: [RFC 3/3] crypto/sha256: Build the SHA256 core separately from the crypto module

Hi,

Quoted 18 lines · Stephan Mueller

Am Dienstag, 30. Juli 2019, 14:38:35 CEST schrieb Hans de Goede:

Hi Hans,

Quoted 6 lines

From: Andy Lutomirski <[email protected]>

This just moves code around -- no code changes in this patch. This wil let BPF-based tracing link against the SHA256 core code without depending on the crypto core.

Quoted 7 lines
Cc Ard Biesheuvel <[email protected]>
Cc Herbert Xu <[email protected]>
---
  crypto/Kconfig                               |   8 +
  crypto/Makefile                              |   1 +
  crypto/{sha256_generic.c => sha256_direct.c} | 103 +--------
Quoted 4 lines

There is a similar standalone code present for SHA-1 or ChaCha20. However, this code lives in lib/.

Thus, shouldn't the SHA-256 core code be moved to lib/ as well?

lib/ actually already has a sha256 implementation: lib/sha256.c but that is currently only used by the x86 and s390 purgatory code.

Ideally the 2 would be merged I guess ...

Regards,

Hans

#6 lore raw

Re: [RFC 3/3] crypto/sha256: Build the SHA256 core separately from the crypto module

In reply to Stephan Mueller
Quoted 18 lines · Stephan Mueller

Am Dienstag, 30. Juli 2019, 14:38:35 CEST schrieb Hans de Goede:

Hi Hans,

Quoted 6 lines

From: Andy Lutomirski <[email protected]>

This just moves code around -- no code changes in this patch. This wil let BPF-based tracing link against the SHA256 core code without depending on the crypto core.

Quoted 7 lines
Cc Ard Biesheuvel <[email protected]>
Cc Herbert Xu <[email protected]>
---
 crypto/Kconfig                               |   8 +
 crypto/Makefile                              |   1 +
 crypto/{sha256_generic.c => sha256_direct.c} | 103 +--------
Quoted 9 lines

There is a similar standalone code present for SHA-1 or ChaCha20. However, this code lives in lib/.

Thus, shouldn't the SHA-256 core code be moved to lib/ as well?

Ciao
Stephan

What's wrong with lib/sha256.c? It's already there.

- Eric

#7 lore raw

Re: [RFC 3/3] crypto/sha256: Build the SHA256 core separately from the crypto module

Hi,

Quoted 22 lines · Eric Biggers
Quoted 21 lines · Stephan Mueller

Am Dienstag, 30. Juli 2019, 14:38:35 CEST schrieb Hans de Goede:

Hi Hans,

Quoted 6 lines

From: Andy Lutomirski <[email protected]>

This just moves code around -- no code changes in this patch. This wil let BPF-based tracing link against the SHA256 core code without depending on the crypto core.

Quoted 7 lines
Cc Ard Biesheuvel <[email protected]>
Cc Herbert Xu <[email protected]>
---
  crypto/Kconfig                               |   8 +
  crypto/Makefile                              |   1 +
  crypto/{sha256_generic.c => sha256_direct.c} | 103 +--------

There is a similar standalone code present for SHA-1 or ChaCha20. However, this code lives in lib/.

Quoted 8 lines
Quoted 6 lines

Thus, shouldn't the SHA-256 core code be moved to lib/ as well?

Ciao
Stephan

What's wrong with lib/sha256.c? It's already there.

That is currently not build under lib/ it is only build as part of the helper executable which deals with transitioning from one kernel to the next on kexec, specifically it is used by arch/x86/purgatory/purgatory.c and also be the s390 purgatory code.

Since the purgatory use is in a separate binary / name space AFAICT, we could add sha256.o to lib/Makefile and then I could use that, but then the normal kernel image would have 2 SHA256 implementations.

Regards,

Hans

#8 lore raw

Re: [RFC 3/3] crypto/sha256: Build the SHA256 core separately from the crypto module

Quoted 34 lines · Hans de Goede

Hi,

Quoted 22 lines · Eric Biggers
Quoted 21 lines · Stephan Mueller

Am Dienstag, 30. Juli 2019, 14:38:35 CEST schrieb Hans de Goede:

Hi Hans,

Quoted 6 lines

From: Andy Lutomirski <[email protected]>

This just moves code around -- no code changes in this patch. This wil let BPF-based tracing link against the SHA256 core code without depending on the crypto core.

Quoted 7 lines
Cc Ard Biesheuvel <[email protected]>
Cc Herbert Xu <[email protected]>
---
  crypto/Kconfig                               |   8 +
  crypto/Makefile                              |   1 +
  crypto/{sha256_generic.c => sha256_direct.c} | 103 +--------

There is a similar standalone code present for SHA-1 or ChaCha20. However, this code lives in lib/.

Quoted 8 lines
Quoted 6 lines

Thus, shouldn't the SHA-256 core code be moved to lib/ as well?

Ciao
Stephan

What's wrong with lib/sha256.c? It's already there.

Quoted 9 lines

That is currently not build under lib/ it is only build as part of the helper executable which deals with transitioning from one kernel to the next on kexec, specifically it is used by arch/x86/purgatory/purgatory.c and also be the s390 purgatory code.

Since the purgatory use is in a separate binary / name space AFAICT, we could add sha256.o to lib/Makefile and then I could use that, but then the normal kernel image would have 2 SHA256 implementations.

Well, seems like the solution needs to involve unifying the implementations.

Note that Ard Biesheuvel recently added the arc4 and aes algorithms to lib/crypto/, with options CONFIG_CRYPTO_LIB_ARC4 and CONFIG_CRYPTO_LIB_AES. How about following the same convention, rather than doing everything slightly differently w.r.t. code organization, function naming, Kconfig option, etc.?

- Eric

#9 lore raw

Re: [RFC 3/3] crypto/sha256: Build the SHA256 core separately from the crypto module

Hi,

Quoted 45 lines · Eric Biggers
Quoted 34 lines · Hans de Goede

Hi,

Quoted 22 lines · Eric Biggers
Quoted 21 lines · Stephan Mueller

Am Dienstag, 30. Juli 2019, 14:38:35 CEST schrieb Hans de Goede:

Hi Hans,

Quoted 6 lines

From: Andy Lutomirski <[email protected]>

This just moves code around -- no code changes in this patch. This wil let BPF-based tracing link against the SHA256 core code without depending on the crypto core.

Quoted 7 lines
Cc Ard Biesheuvel <[email protected]>
Cc Herbert Xu <[email protected]>
---
   crypto/Kconfig                               |   8 +
   crypto/Makefile                              |   1 +
   crypto/{sha256_generic.c => sha256_direct.c} | 103 +--------

There is a similar standalone code present for SHA-1 or ChaCha20. However, this code lives in lib/.

Quoted 8 lines
Quoted 6 lines

Thus, shouldn't the SHA-256 core code be moved to lib/ as well?

Ciao
Stephan

What's wrong with lib/sha256.c? It's already there.

Quoted 9 lines

That is currently not build under lib/ it is only build as part of the helper executable which deals with transitioning from one kernel to the next on kexec, specifically it is used by arch/x86/purgatory/purgatory.c and also be the s390 purgatory code.

Since the purgatory use is in a separate binary / name space AFAICT, we could add sha256.o to lib/Makefile and then I could use that, but then the normal kernel image would have 2 SHA256 implementations.

Quoted 6 lines

Well, seems like the solution needs to involve unifying the implementations.

Note that Ard Biesheuvel recently added the arc4 and aes algorithms to lib/crypto/, with options CONFIG_CRYPTO_LIB_ARC4 and CONFIG_CRYPTO_LIB_AES. How about following the same convention, rather than doing everything slightly differently w.r.t. code organization, function naming, Kconfig option, etc.?

I'm fine with that, I'm still waiting for feedback from the crypto maintainers that they are open to doing that ...

Herbert? Dave?

Regards,

Hans

maintainer
#10 lore raw

Re: [RFC 3/3] crypto/sha256: Build the SHA256 core separately from the crypto module

Quoted 9 lines · Hans de Goede
Quoted 6 lines · Eric Biggers

Well, seems like the solution needs to involve unifying the implementations.

Note that Ard Biesheuvel recently added the arc4 and aes algorithms to lib/crypto/, with options CONFIG_CRYPTO_LIB_ARC4 and CONFIG_CRYPTO_LIB_AES. How about following the same convention, rather than doing everything slightly differently w.r.t. code organization, function naming, Kconfig option, etc.?

Quoted 4 lines

I'm fine with that, I'm still waiting for feedback from the crypto maintainers that they are open to doing that ...

Herbert? Dave?

I fully agree with what Eric said.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt