[Mew-dist 2282] Re: problems on platforms other than UNIX

Kazu Yamamoto ( 山本和彦 ) Kazu at example.com
1997年 9月 29日 (月) 09:24:49 JST


署名の検証が失敗する原因の多くは改行コードが <CR><LF> になっていないこ
とにあります。

Mew は Mew 自身で <CR><LF> に変えて PGP に渡し、PGP はバイナリデータと
して変更せずに署名します。

いくつかの実装では、PGP に改行コードの変換を頼っていて、署名に加えて検
証際も頼るので、署名の検証が失敗することがあります。こういう実装は間違っ
ています。

以下僕の ID から抜粋。

    IMPLEMENTATION NOTE

        The PGP signature format specified in [PGP] is categorized into
        "binary image" and "canonical text". If the "-t" option is
        specified and the PGP program guesses the object to be signed is
        text, the PGP program itself converts line delimiters of the
        object into <CR><LF>. Then it calculates a signature over the
        converted object and specifies "canonical text" mark on the
        signature. Otherwise, the PGP program calculates a signature
        over the original object then specifies "binary image" mark on
        the signature.

        On verification, if the signature tells "canonical text", the
        PGP program first converts line delimiters of the target object
        into <CR><LF> then verifies. Otherwise verification is carried
        out over the original object.

        RFC2015 does not limit type of PGP signatures, so both "binary
        image" and "canonical text" are valid.

        If a user agent itself converts line delimiters of an object to
        be signed into <CR><LF> then calls the PGP program without the
        "-t" option, the signature is produced as "binary image" even if
        the object is a line-based text object. Please not that this
        signature is valid in the context of PGP/MIME and signature
        verification should success. If another user agent,
        particularly on UNIX whose line delimiter is <LF>, calls the PGP
        program without line delimiter conversion, the verification
        fails because the PGP program never converts line delimiters.

        So, to verify PGP signature, user agents MUST convert line
        delimiters of the first part to <CR><LF> by itself.

Mew 同士で失敗するなら、
(1) Win95 上の Mew がおかしい。Mew は mew-cs-7bit-crlf という
coding-system で署名書式を作りますが、これがうまく <CR><LF> になってな
い可能性があります。
(2) 途中のゲートウェイがデータを変更する。JIS X 0208 1978 と 1983 のエ
スケープシーケンスを変更するゲートウェイが世の中には存在します。

参考まで。

P.S.

最近チェックしていないので、PGP/MIME にバグが紛れ込んだ可能性もありま
す。

--かず



Mew-dist メーリングリストの案内