Skip to content

Commit 58dd2cd

Browse files
authored
Merge pull request #3190 from rust-lang/stable
Merge stable back
2 parents d4e1f17 + cce10c6 commit 58dd2cd

File tree

11 files changed

+58
-17
lines changed

11 files changed

+58
-17
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## [1.25.2] - 2023-02-01
4+
5+
This version of Rustup changes the signature verification code to continue
6+
accepting Rust's release signature key, which previously caused warnings due to
7+
a time-based check.
8+
9+
Note that signature verification in Rustup is still an experimental feature,
10+
and there is intentionally no way to enforce signature verification due to the
11+
feature being incomplete.
12+
13+
Thanks go to:
14+
15+
- Pietro Albini
16+
- Daniel Silverstone
17+
18+
[1.25.2]: https://github.com/rust-lang/rustup/release/tag/1.25.2
19+
320
## [1.25.1] - 2022-07-12
421

522
This version of Rustup reverts a single PR from 1.25.1 and tidies a couple of internal

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
99
name = "rustup"
1010
readme = "README.md"
1111
repository = "https://github.com/rust-lang/rustup"
12-
version = "1.25.1"
12+
version = "1.25.2"
1313

1414
[features]
1515
curl-backend = ["download/curl-backend"]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM rust-mips-unknown-linux-gnu
22

3-
ENV CC_mips_unknown_linux_gnu=mips-linux-gnu-gcc \
4-
CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-linux-gnu-gcc
3+
ENV CC_mips_unknown_linux_gnu=mips-unknown-linux-gnu-gcc \
4+
CARGO_TARGET_MIPS_UNKNOWN_LINUX_GNU_LINKER=mips-unknown-linux-gnu-gcc
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM rust-mips64-unknown-linux-gnuabi64
22

3-
ENV CC_mips64_unknown_linux_gnuabi64=mips64-linux-gnuabi64-gcc \
4-
CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_LINKER=mips64-linux-gnuabi64-gcc
3+
ENV CC_mips64_unknown_linux_gnuabi64=mips64-unknown-linux-gnu-gcc \
4+
CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_LINKER=mips64-unknown-linux-gnu-gcc
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM rust-mips64el-unknown-linux-gnuabi64
22

3-
ENV CC_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnuabi64-gcc \
4-
CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_LINKER=mips64el-linux-gnuabi64-gcc
3+
ENV CC_mips64el_unknown_linux_gnuabi64=mips64el-unknown-linux-gnu-gcc \
4+
CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_LINKER=mips64el-unknown-linux-gnu-gcc
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM rust-mipsel-unknown-linux-gnu
22

3-
ENV CC_mipsel_unknown_linux_gnu=mipsel-linux-gnu-gcc \
4-
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_GNU_LINKER=mipsel-linux-gnu-gcc
3+
ENV CC_mipsel_unknown_linux_gnu=mipsel-unknown-linux-gnu-gcc \
4+
CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_GNU_LINKER=mipsel-unknown-linux-gnu-gcc

download/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ authors = ["Brian Anderson <[email protected]>"]
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66
name = "download"
7-
version = "1.25.1"
7+
version = "1.25.2"
88

99
[features]
1010

rustup-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUSTUP_UPDATE_ROOT="${RUSTUP_UPDATE_ROOT:-https://static.rust-lang.org/rustup}"
2525
#XXX: If you change anything here, please make the same changes in setup_mode.rs
2626
usage() {
2727
cat 1>&2 <<EOF
28-
rustup-init 1.25.1 (48d233f65 2022-07-12)
28+
rustup-init 1.25.2 (8c4dad73d 2023-02-01)
2929
The installer for rustup
3030
3131
USAGE:

src/config.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ use std::str::FromStr;
77
use std::sync::Arc;
88

99
use anyhow::{anyhow, bail, Context, Result};
10-
use sequoia_openpgp::{parse::Parse, policy, Cert};
10+
use sequoia_openpgp::{parse::Parse, Cert};
1111
use serde::Deserialize;
1212
use thiserror::Error as ThisError;
1313

1414
use crate::cli::self_update::SelfUpdateMode;
1515
use crate::dist::download::DownloadCfg;
16+
use crate::dist::signatures::sequoia_policy;
1617
use crate::dist::{
1718
dist::{self, Profile},
1819
temp,
@@ -198,7 +199,8 @@ impl PgpPublicKey {
198199
let keyid = format_hex(cert.keyid().as_bytes(), "-", 4)?;
199200
let algo = cert.primary_key().pk_algo();
200201
let fpr = format_hex(cert.fingerprint().as_bytes(), " ", 2)?;
201-
let p = policy::StandardPolicy::new();
202+
let p = sequoia_policy();
203+
202204
let uid0 = cert
203205
.with_policy(&p, None)?
204206
.primary_userid()

src/dist/signatures.rs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,32 @@ use anyhow::Result;
88

99
use sequoia_openpgp::{
1010
parse::{stream::*, Parse},
11-
policy, Cert, KeyHandle,
11+
policy::{HashAlgoSecurity, StandardPolicy},
12+
types::HashAlgorithm,
13+
Cert, KeyHandle,
1214
};
1315

1416
use crate::config::PgpPublicKey;
1517

18+
pub(crate) fn sequoia_policy() -> StandardPolicy<'static> {
19+
let mut policy = StandardPolicy::new();
20+
21+
// The builtin Rust signature key uses SHA-1 for its own signature, even though the individual
22+
// signatures generated by it nowadays use SHA-512. Sequoia added a cutoff date for SHA1,
23+
// 2023-02-01, which caused warnings to be displayed to rustup users from that day onwards.
24+
//
25+
// To keep supporting the Rust signature key, we allow the SHA-1 algorithm in rustup without a
26+
// cutoff date when verifying the signature key bindings. SHA-1 data signatures are still
27+
// disallowed.
28+
policy.reject_hash_property_at(
29+
HashAlgorithm::SHA1,
30+
HashAlgoSecurity::SecondPreImageResistance,
31+
None,
32+
);
33+
34+
policy
35+
}
36+
1637
/// Returns the index of the cert in `certs` that verifies a
1738
/// signature.
1839
///
@@ -26,7 +47,8 @@ pub(crate) fn verify_signature<T: Read + Send + Sync>(
2647
signature: &str,
2748
certs: &[PgpPublicKey],
2849
) -> Result<Option<usize>> {
29-
let p = policy::StandardPolicy::new();
50+
let p = sequoia_policy();
51+
3052
let helper = Helper::new(certs);
3153
let mut v = DetachedVerifierBuilder::from_reader(signature.as_bytes())?
3254
.with_policy(&p, None, helper)?;

0 commit comments

Comments
 (0)