diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2016-02-25 09:49:57 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-09 17:00:28 +0000 |
commit | 6833c5d77b99ab3f07945ba8e0bbe03df3dc317c (patch) | |
tree | 6881c031f89db00b6a28ca5f69a6cf2078e1d909 /meta/recipes-devtools/rpm/rpm_5.4.16.bb | |
parent | 59a4d99c20af0ef60513eab5928c40b03903e5e8 (diff) | |
download | poky-6833c5d77b99ab3f07945ba8e0bbe03df3dc317c.tar.gz |
rpm: Enable specific crypto and digest settings via variables
Allow the user to set the specific digest and non-repudiable signature
algorithms. This should be done on a distribution wide basis.
See recipe for exact instructions, but values are now set using:
RPM_FILE_DIGEST_ALGO (default 1 - md5)
RPM_SELF_SIGN_ALGO (default DSA)
Also, change the PACKAGECONFIG to define the default crypto engine for
RPM5. Not just the available crypto engines. If a crypto engine is not
selected, the system will default to the internal beecrypt version.
(From OE-Core rev: 2f6529d9dc8aa82eb5bdcccec9c69d93dad63505)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rpm/rpm_5.4.16.bb')
-rw-r--r-- | meta/recipes-devtools/rpm/rpm_5.4.16.bb | 81 |
1 files changed, 76 insertions, 5 deletions
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.16.bb b/meta/recipes-devtools/rpm/rpm_5.4.16.bb index 142706f30c..c961bac5dc 100644 --- a/meta/recipes-devtools/rpm/rpm_5.4.16.bb +++ b/meta/recipes-devtools/rpm/rpm_5.4.16.bb | |||
@@ -173,6 +173,68 @@ rpm_macros_class-nativesdk = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macro | |||
173 | 173 | ||
174 | # sqlite lua tcl augeas nss gcrypt neon xz xar keyutils perl selinux | 174 | # sqlite lua tcl augeas nss gcrypt neon xz xar keyutils perl selinux |
175 | 175 | ||
176 | # Set the digest algorithm used for verifying file integrity | ||
177 | # If this value changes, and two different packages have different values | ||
178 | # the "same file" validation (two packages have a non-conflict file) | ||
179 | # will fail. This may lead to upgrade problems. You should treat this | ||
180 | # value as a distribution wide setting, and only change it when you intend | ||
181 | # a full system upgrade! | ||
182 | # | ||
183 | # Defined file digest algorithm values (note: not all are available!): | ||
184 | # 1 MD5 (legacy RPM default) | ||
185 | # 2 SHA1 | ||
186 | # 3 RIPEMD-160 | ||
187 | # 5 MD2 | ||
188 | # 6 TIGER-192 | ||
189 | # 8 SHA256 | ||
190 | # 9 SHA384 | ||
191 | # 10 SHA512 | ||
192 | # 11 SHA224 | ||
193 | # 104 MD4 | ||
194 | # 105 RIPEMD-128 | ||
195 | # 106 CRC-32 | ||
196 | # 107 ADLER-32 | ||
197 | # 108 CRC-64 (ECMA-182 polynomial, untested uint64_t problems) | ||
198 | # 109 Jenkins lookup3.c hashlittle() | ||
199 | # 111 RIPEMD-256 | ||
200 | # 112 RIPEMD-320 | ||
201 | # 188 BLAKE2B | ||
202 | # 189 BLAKE2BP | ||
203 | # 190 BLAKE2S | ||
204 | # 191 BLAKE2SP | ||
205 | RPM_FILE_DIGEST_ALGO ?= "1" | ||
206 | |||
207 | # All packages build with RPM5 contain a non-repudiable signature. | ||
208 | # The purpose of this signature is not to show authenticity of a package, | ||
209 | # but instead act as a secondary package wide validation that shows it | ||
210 | # wasn't damaged by accident in transport. (When later you sign the package, | ||
211 | # this signature may or may not be replaced as there are three signature | ||
212 | # slots, one for DSA/RSA, one for ECSDA, and one reserved.) | ||
213 | # | ||
214 | # There is a known issue w/ RSA signatures that if they start with an 0x00 | ||
215 | # the signing and validation may fail. | ||
216 | # | ||
217 | # The following is the list of choices for the non-rpudiable signature | ||
218 | # (note: not all of these are implemented): | ||
219 | # DSA (default) | ||
220 | # RSA (implies SHA1) | ||
221 | # ECDSA (implies SHA256) | ||
222 | # DSA/SHA1 | ||
223 | # DSA/SHA224 | ||
224 | # DSA/SHA256 | ||
225 | # DSA/SHA384 | ||
226 | # DSA/SHA512 | ||
227 | # RSA/SHA1 | ||
228 | # RSA/SHA224 | ||
229 | # RSA/SHA256 | ||
230 | # RSA/SHA384 | ||
231 | # RSA/SHA512 | ||
232 | # ECDSA/SHA224 (using NIST P-224) | ||
233 | # ECDSA/SHA256 (using NIST P-256) | ||
234 | # ECDSA/SHA384 (using NIST P-384) | ||
235 | # ECDSA/SHA512 (using NIST P-521) | ||
236 | RPM_SELF_SIGN_ALGO ?= "DSA" | ||
237 | |||
176 | # Note: perl and sqlite w/o db specified does not currently work. | 238 | # Note: perl and sqlite w/o db specified does not currently work. |
177 | # tcl, augeas, nss, gcrypt, xar and keyutils support is untested. | 239 | # tcl, augeas, nss, gcrypt, xar and keyutils support is untested. |
178 | PACKAGECONFIG ??= "db bzip2 zlib popt openssl libelf python" | 240 | PACKAGECONFIG ??= "db bzip2 zlib popt openssl libelf python" |
@@ -208,10 +270,17 @@ PACKAGECONFIG[db] = "${WITH_DB},--without-db,db," | |||
208 | 270 | ||
209 | PACKAGECONFIG[sqlite] = "--with-sqlite,--without-sqlite,sqlite3," | 271 | PACKAGECONFIG[sqlite] = "--with-sqlite,--without-sqlite,sqlite3," |
210 | 272 | ||
273 | # This switch simply disables external beecrypt, RPM5 always uses beecrypt | ||
274 | # for base64 processing and various digest algorithms. | ||
275 | # Beecrypt is only the preferred crypto engine if it's the only engine enabled. | ||
211 | PACKAGECONFIG[beecrypt] = "--with-beecrypt=external,--with-beecrypt=internal,beecrypt," | 276 | PACKAGECONFIG[beecrypt] = "--with-beecrypt=external,--with-beecrypt=internal,beecrypt," |
212 | PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl," | 277 | |
213 | PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss," | 278 | # --with-usecrypto= setting defined the item as the preferred system |
214 | PACKAGECONFIG[gcrypt] = "--with-gcrypt,--without-gcrypt,gcrypt," | 279 | # crypto engine, which will take priority over the included beecrypt |
280 | PACKAGECONFIG[openssl] = "--with-openssl --with-usecrypto=openssl,--without-openssl,openssl," | ||
281 | PACKAGECONFIG[nss] = "--with-nss --with-usecrypto=nss,--without-nss,nss," | ||
282 | PACKAGECONFIG[gcrypt] = "--with-gcrypt --with-usecrypto=gcrypt,--without-gcrypt,gcrypt," | ||
283 | |||
215 | PACKAGECONFIG[keyutils] = "--with-keyutils,--without-keyutils,keyutils," | 284 | PACKAGECONFIG[keyutils] = "--with-keyutils,--without-keyutils,keyutils," |
216 | PACKAGECONFIG[libelf] = "--with-libelf,--without-libelf,elfutils," | 285 | PACKAGECONFIG[libelf] = "--with-libelf,--without-libelf,elfutils," |
217 | 286 | ||
@@ -455,8 +524,10 @@ do_configure() { | |||
455 | } | 524 | } |
456 | 525 | ||
457 | do_install_append() { | 526 | do_install_append() { |
458 | # Preserve the previous default of DSA self-signed pkgs | 527 | # Configure -distribution wide- package crypto settings |
459 | sed -i -e 's,%_build_sign.*,%_build_sign DSA,' ${D}/${libdir}/rpm/macros.rpmbuild | 528 | # If these change, effectively all packages have to be upgraded! |
529 | sed -i -e 's,%_build_file_digest_algo.*,%_build_sign ${RPM_FILE_DIGEST_ALGO},' ${D}/${libdir}/rpm/macros.rpmbuild | ||
530 | sed -i -e 's,%_build_sign.*,%_build_sign ${RPM_SELF_SIGN_ALGO},' ${D}/${libdir}/rpm/macros.rpmbuild | ||
460 | 531 | ||
461 | sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros | 532 | sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros |
462 | sed -i -e 's,%__perl_provides,#%%__perl_provides,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/* | 533 | sed -i -e 's,%__perl_provides,#%%__perl_provides,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/* |