Index: vboot_firmware/lib/vboot_common.c |
diff --git a/vboot_firmware/lib/vboot_common.c b/vboot_firmware/lib/vboot_common.c |
index 1256b676d3e67d12b08352ea1c82d5c488a43619..f76eed45abc0655a93c77099e171773f6365ef0e 100644 |
--- a/vboot_firmware/lib/vboot_common.c |
+++ b/vboot_firmware/lib/vboot_common.c |
@@ -85,6 +85,26 @@ int VerifySignatureInside(const void* parent, uint64_t parent_size, |
} |
+void PublicKeyInit(VbPublicKey* key, uint8_t* key_data, uint64_t key_size) { |
+ key->key_offset = OffsetOf(key, key_data); |
+ key->key_size = key_size; |
+ key->algorithm = kNumAlgorithms; /* Key not present yet */ |
+ key->key_version = 0; |
+} |
+ |
+ |
+int PublicKeyCopy(VbPublicKey* dest, const VbPublicKey* src) { |
+ if (dest->key_size < src->key_size) |
+ return 1; |
+ |
+ dest->key_size = src->key_size; |
+ dest->algorithm = src->algorithm; |
+ dest->key_version = src->key_version; |
+ Memcpy(GetPublicKeyData(dest), GetPublicKeyDataC(src), src->key_size); |
+ return 0; |
+} |
+ |
+ |
RSAPublicKey* PublicKeyToRSA(const VbPublicKey* key) { |
RSAPublicKey *rsa; |