diff --git a/app/javascript/images/icons/icon_cached.svg b/app/javascript/images/icons/icon_cached.svg
deleted file mode 100644
index d938e9badb..0000000000
--- a/app/javascript/images/icons/icon_cached.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/javascript/images/icons/icon_done.svg b/app/javascript/images/icons/icon_done.svg
deleted file mode 100644
index a35ab87a15..0000000000
--- a/app/javascript/images/icons/icon_done.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/javascript/images/icons/icon_email.svg b/app/javascript/images/icons/icon_email.svg
deleted file mode 100644
index 0215b6f3a7..0000000000
--- a/app/javascript/images/icons/icon_email.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/javascript/images/icons/icon_file_download.svg b/app/javascript/images/icons/icon_file_download.svg
deleted file mode 100644
index dc6d6bce34..0000000000
--- a/app/javascript/images/icons/icon_file_download.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/javascript/images/icons/icon_flag.svg b/app/javascript/images/icons/icon_flag.svg
deleted file mode 100644
index fe07808fa9..0000000000
--- a/app/javascript/images/icons/icon_flag.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/javascript/images/icons/icon_grade.svg b/app/javascript/images/icons/icon_grade.svg
deleted file mode 100644
index f8dd93864c..0000000000
--- a/app/javascript/images/icons/icon_grade.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/javascript/images/icons/icon_lock_open.svg b/app/javascript/images/icons/icon_lock_open.svg
deleted file mode 100644
index 12f559beb4..0000000000
--- a/app/javascript/images/icons/icon_lock_open.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/javascript/images/icons/icon_person_add.svg b/app/javascript/images/icons/icon_person_add.svg
deleted file mode 100644
index 3705363332..0000000000
--- a/app/javascript/images/icons/icon_person_add.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/javascript/images/icons/icon_pinned.svg b/app/javascript/images/icons/icon_pinned.svg
index 90eaa6c933..1009c15563 100644
--- a/app/javascript/images/icons/icon_pinned.svg
+++ b/app/javascript/images/icons/icon_pinned.svg
@@ -1,3 +1,3 @@
diff --git a/app/javascript/images/icons/icon_reply.svg b/app/javascript/images/icons/icon_reply.svg
deleted file mode 100644
index 9f99e4cbfc..0000000000
--- a/app/javascript/images/icons/icon_reply.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/javascript/mastodon/components/tags/tag.stories.tsx b/app/javascript/mastodon/components/tags/tag.stories.tsx
index 3db9f5fe99..34b46cff7b 100644
--- a/app/javascript/mastodon/components/tags/tag.stories.tsx
+++ b/app/javascript/mastodon/components/tags/tag.stories.tsx
@@ -1,7 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react-vite';
import { action } from 'storybook/actions';
-import MusicNoteIcon from '@/material-icons/400-24px/music_note.svg?react';
+import SmileyIcon from '@/material-icons/400-24px/mood.svg?react';
import { EditableTag, Tag } from './tag';
@@ -23,7 +23,7 @@ export const Default: Story = {};
export const WithIcon: Story = {
args: {
- icon: MusicNoteIcon,
+ icon: SmileyIcon,
},
};
@@ -38,7 +38,7 @@ export const EditableWithIcon: Story = {
return (
);
diff --git a/app/javascript/mastodon/features/notifications_v2/components/notification_mention.tsx b/app/javascript/mastodon/features/notifications_v2/components/notification_mention.tsx
index 40669f0120..7da1a81ab4 100644
--- a/app/javascript/mastodon/features/notifications_v2/components/notification_mention.tsx
+++ b/app/javascript/mastodon/features/notifications_v2/components/notification_mention.tsx
@@ -3,7 +3,7 @@ import { FormattedMessage } from 'react-intl';
import { isEqual } from 'lodash';
import AlternateEmailIcon from '@/material-icons/400-24px/alternate_email.svg?react';
-import ReplyIcon from '@/material-icons/400-24px/reply-fill.svg?react';
+import ReplyIcon from '@/material-icons/400-24px/reply.svg?react';
import { me } from 'mastodon/initial_state';
import type { NotificationGroupMention } from 'mastodon/models/notification_group';
import { useAppSelector } from 'mastodon/store';
diff --git a/app/javascript/material-icons/400-24px/article-fill.svg b/app/javascript/material-icons/400-24px/article-fill.svg
deleted file mode 100644
index 5ea367df92..0000000000
--- a/app/javascript/material-icons/400-24px/article-fill.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/article.svg b/app/javascript/material-icons/400-24px/article.svg
deleted file mode 100644
index 1265c26dad..0000000000
--- a/app/javascript/material-icons/400-24px/article.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/badge-fill.svg b/app/javascript/material-icons/400-24px/badge-fill.svg
deleted file mode 100644
index 88ac07340c..0000000000
--- a/app/javascript/material-icons/400-24px/badge-fill.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/badge.svg b/app/javascript/material-icons/400-24px/badge.svg
deleted file mode 100644
index 977a04acfa..0000000000
--- a/app/javascript/material-icons/400-24px/badge.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/cancel_presentation-fill.svg b/app/javascript/material-icons/400-24px/cancel_presentation-fill.svg
deleted file mode 100644
index 8e8e6a1ee6..0000000000
--- a/app/javascript/material-icons/400-24px/cancel_presentation-fill.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/cancel_presentation.svg b/app/javascript/material-icons/400-24px/cancel_presentation.svg
deleted file mode 100644
index c0da419cd0..0000000000
--- a/app/javascript/material-icons/400-24px/cancel_presentation.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/edit_note-fill.svg b/app/javascript/material-icons/400-24px/edit_note-fill.svg
deleted file mode 100644
index b18db1df8e..0000000000
--- a/app/javascript/material-icons/400-24px/edit_note-fill.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/edit_note.svg b/app/javascript/material-icons/400-24px/edit_note.svg
deleted file mode 100644
index cf7e98405a..0000000000
--- a/app/javascript/material-icons/400-24px/edit_note.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/explore-fill.svg b/app/javascript/material-icons/400-24px/explore-fill.svg
deleted file mode 100644
index 919ecb580a..0000000000
--- a/app/javascript/material-icons/400-24px/explore-fill.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/explore.svg b/app/javascript/material-icons/400-24px/explore.svg
deleted file mode 100644
index bb8ba1f4c6..0000000000
--- a/app/javascript/material-icons/400-24px/explore.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/music_note-fill.svg b/app/javascript/material-icons/400-24px/music_note-fill.svg
deleted file mode 100644
index 6ce5eff001..0000000000
--- a/app/javascript/material-icons/400-24px/music_note-fill.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/music_note.svg b/app/javascript/material-icons/400-24px/music_note.svg
deleted file mode 100644
index 6ce5eff001..0000000000
--- a/app/javascript/material-icons/400-24px/music_note.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/navigate_before-fill.svg b/app/javascript/material-icons/400-24px/navigate_before-fill.svg
deleted file mode 100644
index 53783746ae..0000000000
--- a/app/javascript/material-icons/400-24px/navigate_before-fill.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/navigate_before.svg b/app/javascript/material-icons/400-24px/navigate_before.svg
deleted file mode 100644
index 53783746ae..0000000000
--- a/app/javascript/material-icons/400-24px/navigate_before.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/navigate_next-fill.svg b/app/javascript/material-icons/400-24px/navigate_next-fill.svg
deleted file mode 100644
index 4100467365..0000000000
--- a/app/javascript/material-icons/400-24px/navigate_next-fill.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/navigate_next.svg b/app/javascript/material-icons/400-24px/navigate_next.svg
deleted file mode 100644
index 4100467365..0000000000
--- a/app/javascript/material-icons/400-24px/navigate_next.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/material-icons/400-24px/power.svg b/app/javascript/material-icons/400-24px/power.svg
deleted file mode 100644
index 023a3a31da..0000000000
--- a/app/javascript/material-icons/400-24px/power.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss
index 18effe35ab..fb05a3cb50 100644
--- a/app/javascript/styles/mastodon/components.scss
+++ b/app/javascript/styles/mastodon/components.scss
@@ -7251,6 +7251,7 @@ a.status-card {
border-radius: 8px;
position: relative;
width: 100%;
+ max-width: 100%;
min-height: 64px;
display: grid;
grid-template-columns: 1fr 1fr;
diff --git a/app/lib/request.rb b/app/lib/request.rb
index ee4c486dfc..aa482c7d53 100644
--- a/app/lib/request.rb
+++ b/app/lib/request.rb
@@ -131,7 +131,16 @@ class Request
def perform
begin
+ # Try with HTTP Signatures (draft-cavage-http-signatures-12) first
response = perform_cavage_signed_request
+
+ # Then if it fails, double-knock using RFC 9421: HTTP Message Signatures
+ if @signing_keypair.present? && [400, 401].include?(response.code)
+ # Consume the body of the first response first
+ response.truncated_body if http_client.persistent? && !response.connection.finished_request?
+
+ response = perform_rfc9421_signed_request
+ end
rescue => e
raise e.class, "#{e.message} on #{@url}", e.backtrace[0]
end
@@ -180,6 +189,24 @@ class Request
client.request(@verb, @url.to_s, @options.merge(headers:))
end
+ def perform_rfc9421_signed_request
+ headers = @headers
+ headers = headers.merge('content-digest' => "sha-256=:#{OpenSSL::Digest.base64digest('sha256', @options[:body])}:") if @options[:body]
+
+ client = http_client
+
+ if @signing_keypair.present?
+ client = client.use(
+ http_signature: {
+ key: @signing_keypair.linzer_private_key,
+ covered_components: @options.key?(:body) ? %w(@method @target-uri content-digest) : %w(@method @target-uri),
+ }
+ )
+ end
+
+ client.request(@verb, @url.to_s, @options.merge(headers:))
+ end
+
# Using code from https://github.com/sporkmonger/addressable/blob/3450895887d0a1770660d8831d1b6fcfed9bd9d6/lib/addressable/uri.rb#L1609-L1635
# to preserve some URL Encodings while normalizing
def normalize_preserving_url_encodings(url, preserved_chars = SAFE_PRESERVED_CHARS, *flags)
diff --git a/app/lib/signed_request.rb b/app/lib/signed_request.rb
index 5b6bc7eb70..dedb26d006 100644
--- a/app/lib/signed_request.rb
+++ b/app/lib/signed_request.rb
@@ -171,12 +171,7 @@ class SignedRequest
end
def verified?(keypair)
- case keypair.type
- when 'rsa'
- key = Linzer.new_rsa_v1_5_sha256_public_key(keypair.public_key)
- when 'ed25519'
- key = Linzer.new_ed25519_public_key(keypair.public_key)
- end
+ key = keypair.linzer_public_key
Linzer.verify(key, @message, @signature)
rescue Linzer::VerifyError
diff --git a/app/models/keypair.rb b/app/models/keypair.rb
index f3ab49637a..48dbc636b5 100644
--- a/app/models/keypair.rb
+++ b/app/models/keypair.rb
@@ -64,6 +64,28 @@ class Keypair < ApplicationRecord
end
end
+ def linzer_public_key
+ @linzer_public_key ||= begin
+ case type
+ when 'rsa'
+ Linzer.new_rsa_v1_5_sha256_public_key(public_key)
+ when 'ed25519'
+ Linzer.new_ed25519_public_key(public_key)
+ end
+ end
+ end
+
+ def linzer_private_key
+ @linzer_private_key ||= begin
+ case type
+ when 'rsa'
+ Linzer.new_rsa_v1_5_sha256_key(private_key, full_uri)
+ when 'ed25519'
+ Linzer.new_ed25519_key(private_key, full_uri)
+ end
+ end
+ end
+
def usable?
!revoked? && !expired?
end
diff --git a/spec/lib/request_spec.rb b/spec/lib/request_spec.rb
index f8c2de203a..b937cf1433 100644
--- a/spec/lib/request_spec.rb
+++ b/spec/lib/request_spec.rb
@@ -98,6 +98,34 @@ RSpec.describe Request do
end
end
+ context 'with server that only supports RFC 9421' do
+ let(:account) { Fabricate(:account) }
+
+ before do
+ # cavage-12
+ stub_request(:get, 'http://example.com')
+ .with { |request| request.headers.key?('Signature') && !request.headers.key?('Signature-Input') }
+ .to_return(status: 401)
+
+ # RFC 9421
+ stub_request(:get, 'http://example.com')
+ .with { |request| request.headers.key?('Signature') && request.headers.key?('Signature-Input') }
+ .to_return(status: 200)
+ end
+
+ it 'makes two valid requests with the specific signatures' do
+ expect { |block| subject.on_behalf_of(account).perform(&block) }.to yield_control
+
+ # Makes a valid request using cavage-12
+ expect(a_request(:get, 'http://example.com').with { |request| verified_signed_mocked_request?(request, account.keypair) && !request.headers.key?('Signature-Input') })
+ .to have_been_made.once
+
+ # Makes a valid request using RFC 9421
+ expect(a_request(:get, 'http://example.com').with { |request| verified_signed_mocked_request?(request, account.keypair) && request.headers.key?('Signature-Input') })
+ .to have_been_made.once
+ end
+ end
+
context 'with a redirect and HTTP signatures' do
let(:account) { Fabricate(:account) }