Skip to content

NTAuthentication.MakeSignature produces different thing on macOS, Windows and Linux #65678

@filipnavara

Description

@filipnavara

I've tried to make a test for NTAuthentication.MakeSignature only to find out that it produces different outputs on each OS.

On Windows it produces an output in the form (signature, message).
On Linux it produces an output in form (length prefix, signature, message). The length prefix is generated in managed code.
On macOS it produces an output in form (length prefix, message, signature).

I cannot find any justification in the specifications (GSSAPI, GSSAPI SASL mechanism, or NTLM) for prepending the length prefix. It could have been erroneously copied from the Encrypt operation which also seems to do the length prefixing on Windows. However, in the case of Encrypt it seems that the justification actually comes from the high-level NegotiateStream specification. MakeSignature is not used in context of NegotiateStream though.

The reversed order of message and signature on macOS could be a bug in the provider default (https://github.com/apple-opensource/Heimdal/blob/9fed6a5818d85a439310b43727dd299366b397c2/lib/gssapi/ntlm/crypto.c#L699) but likely there's a way to enforce the proper order through different API call.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions