署名を求められるサーバーでoutboxの取得が失敗することがある

Issue #36 resolved
Yoshiyuki Osamura repo owner created an issue

返ってくるエラー

'Client error: `GET https://c.im/users/***/outbox?page=true` resulted in a `401 Unauthorized` response:
Verification failed for stocker@notestock.osa-p.net https://notestock.osa-p.net/users/stocker using rsa-sha256 (RSASSA-P (truncated...)

実際のエラー https://github.com/mastodon/mastodon/blob/1b5d20713187465c13986eea0f3a487d254b6e63/app/controllers/concerns/signature_verification.rb#L104

Verification failed for #{actor.to_log_human_identifier} #{actor.uri} using rsa-sha256 (RSASSA-PKCS1-v1_5 with SHA-256)

使用しているライブラリ liamdennehy/http-signatures-php から呼んでいる phpseclib/phpseclib では rsassa_pkcs1_v1_5_sign() が呼ばれている。

原因不明

Comments (8)

  1. Yoshiyuki Osamura reporter

    PKCS#8で署名しないとエラーになる実装があるらしい。

    PKCS#1を使っていた部分をPKCS#8に切り換え。

  2. Log in to comment