Reverted printableString related commits
This commit is contained in:
parent
b0cb480886
commit
2bd1b1da0b
@ -1,85 +0,0 @@
|
||||
From 5f99a195e8603eb522efb1f04039a91bf6c31a05 Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Lukoshko <alukoshko@almalinux.org>
|
||||
Date: Sat, 29 Mar 2025 23:35:42 +0000
|
||||
Subject: [PATCH] appended signatures: add support for printableString in x509
|
||||
|
||||
Original patch by Daniel Axtens <dja@axtens.net>
|
||||
|
||||
Signed-off-by: Andrew Lukoshko <alukoshko@almalinux.org>
|
||||
---
|
||||
grub-core/commands/appendedsig/x509.c | 44 ++++++++++++++++++---------
|
||||
1 file changed, 29 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/grub-core/commands/appendedsig/x509.c b/grub-core/commands/appendedsig/x509.c
|
||||
index 42ec65c..c2cfe5f 100644
|
||||
--- a/grub-core/commands/appendedsig/x509.c
|
||||
+++ b/grub-core/commands/appendedsig/x509.c
|
||||
@@ -310,22 +310,36 @@ decode_string (char *der, int der_size, char **string,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
- if (grub_strncmp ("utf8String", choice, choice_size))
|
||||
+ if (grub_strncmp ("utf8String", choice, choice_size) == 0)
|
||||
{
|
||||
- err =
|
||||
- grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
|
||||
- "Only UTF-8 DirectoryStrings are supported, got %s",
|
||||
- choice);
|
||||
- goto cleanup_choice;
|
||||
+ result = asn1_read_value (strasn, "utf8String", NULL, &tmp_size);
|
||||
+ if (result != ASN1_MEM_ERROR)
|
||||
+ {
|
||||
+ err =
|
||||
+ grub_error (GRUB_ERR_BAD_FILE_TYPE,
|
||||
+ "Error reading size of UTF-8 string: %s",
|
||||
+ asn1_strerror (result));
|
||||
+ goto cleanup_choice;
|
||||
+ }
|
||||
}
|
||||
-
|
||||
- result = asn1_read_value (strasn, "utf8String", NULL, &tmp_size);
|
||||
- if (result != ASN1_MEM_ERROR)
|
||||
+ else if (grub_strncmp("printableString", choice, choice_size) == 0)
|
||||
+ {
|
||||
+ result = asn1_read_value (strasn, "printableString", NULL, &tmp_size);
|
||||
+ if (result != ASN1_MEM_ERROR)
|
||||
+ {
|
||||
+ err =
|
||||
+ grub_error (GRUB_ERR_BAD_FILE_TYPE,
|
||||
+ "Error reading size of printable string: %s",
|
||||
+ asn1_strerror (result));
|
||||
+ goto cleanup_choice;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
{
|
||||
err =
|
||||
- grub_error (GRUB_ERR_BAD_FILE_TYPE,
|
||||
- "Error reading size of UTF-8 string: %s",
|
||||
- asn1_strerror (result));
|
||||
+ grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
|
||||
+ "Only UTF-8 and printable DirectoryStrings are supported, got %s",
|
||||
+ choice);
|
||||
goto cleanup_choice;
|
||||
}
|
||||
|
||||
@@ -341,13 +355,13 @@ decode_string (char *der, int der_size, char **string,
|
||||
goto cleanup_choice;
|
||||
}
|
||||
|
||||
- result = asn1_read_value (strasn, "utf8String", *string, &tmp_size);
|
||||
+ result = asn1_read_value (strasn, choice, *string, &tmp_size);
|
||||
if (result != ASN1_SUCCESS)
|
||||
{
|
||||
err =
|
||||
grub_error (GRUB_ERR_BAD_FILE_TYPE,
|
||||
- "Error reading out UTF-8 string in DirectoryString: %s",
|
||||
- asn1_strerror (result));
|
||||
+ "Error reading out %s in DirectoryString: %s",
|
||||
+ choice, asn1_strerror (result));
|
||||
grub_free (*string);
|
||||
goto cleanup_choice;
|
||||
}
|
||||
--
|
||||
2.43.5
|
||||
|
@ -16,7 +16,7 @@
|
||||
Name: grub2
|
||||
Epoch: 1
|
||||
Version: 2.06
|
||||
Release: 100%{?dist}.alma.2
|
||||
Release: 100%{?dist}.alma.1
|
||||
Summary: Bootloader with support for Linux, Multiboot and more
|
||||
License: GPLv3+
|
||||
URL: http://www.gnu.org/software/grub/
|
||||
@ -91,9 +91,6 @@ hardware devices.\
|
||||
# generate with do-rebase
|
||||
%include %{SOURCE11}
|
||||
|
||||
# AlmaLinux
|
||||
Patch1000: 1000-appended-signatures-add-support-for-printableString-.patch
|
||||
|
||||
%description
|
||||
%{desc}
|
||||
|
||||
@ -541,9 +538,6 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Sun Mar 30 2025 Andrew Lukoshko <alukoshko@almalinux.org> - 1:2.06-100.alma.2
|
||||
- Add support for printableString in x509
|
||||
|
||||
* Fri Mar 28 2025 Eduard Abdullin <eabdullin@almalinux.org> - 1:2.06-100.alma.1
|
||||
- Debrand for AlmaLinux
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user