# dkim_sig_getcanonlen()

[back to index]

SYNOPSIS

    #include <dkim.h>
    DKIM_STAT dkim_sig_getcanonlen(
    	DKIM *dkim,
    	DKIM_SIGINFO *sig,
            ssize_t *msglen,
            ssize_t *canonlen,
            ssize_t *signlen
    );

Retrieve the number of bytes of message body presented for signing or verifying, and/or the number of bytes actually signed or verified.

DESCRIPTION

Called When | `dkim_sig_getcanonlen()` is called after `dkim_eom()` to get the number of bytes of message body presented for signing or verifying, and/or the number of bytes actually signed or verified. This is used to allow a verifier to insist on minimum signing volumes or percentages (e.g., a verifier may decide not to trust a message which was only partially signed).

ARGUMENTS

Argument | Description
--- | ---
dkim | Message-specific handle, returned by `dkim_sign()` or `dkim_verify`.
sig | The `DKIM_SIGINFO` handle representing the signature being evaluated.

msglen

A pointer to an `ssize_t` which will receive a count of the number of bytes in the canonicalized form of the message. This should always be the number of bytes in the message body plus or minus whatever was required to canonicalize it (so for "simple" canonicalization it should be roughly the exact byte count, while for "relaxed" canonicalization it should be somewhat less). Can be NULL if this information is not needed by the caller.

canonlen

A pointer to an `ssize_t` which will receive a count of the number of bytes in the canonicalized form of the message that were included in the signed data. If `msglen` and `canonlen` are the same, then the entire message was signed. If it is less, then the signer didn't sign the entire message. A verifier can compare this value with that of `msglen` to see what portion of the total message was signed by the signer. Note that `msglen` and `canonlen` can differ even if no signature length limit was set if, for example, there were trailing blank lines on the message as these are always stripped. Can be NULL if this information is not needed by the caller.

signlen | A pointer to an `ssize_t` which will receive the signature length limit for this signature (i.e. the value of the "l=" tag if one was present on the signature). If no limit was set by the signer, a value of -1 is returned. Can be NULL if this information is not needed by the caller.

NOTES

- None.

Copyright (c) 2005-2007 Sendmail, Inc. and its suppliers. All rights reserved.
Copyright (c) 2009-2011, The OpenDKIM Project. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the respective licenses.