ProFTPD module mod_digest



The mod_digest module offers functions to calculate the hash value or digest of files. This is particularly useful to verify the integrity of files.

Depending on the file size and the hash function it takes a fair amount of CPU and IO resources to calculate the result. Therefore decide wisely where to enable the features and set the DigestMaxSize configuration directive appropriately. It's also recommended to disable all features within the <Anonymous> context.

This module was compiled and tested against ProFTPD 1.2.10 and 1.3.0 Installation instructions are discussed here.

The most current version of mod_digest can be found at:

  http://www.smartftp.com/oss/proftpd/

Author

Please contact Mathias Berchtold <mb at smartftp.com> with any questions, concerns, or suggestions regarding this module.

Directives


DigestTypes

Syntax:DigestTypes [ "crc32" | "md5" | "sha1" | "sha256" | "all" ]
Default: all
Context: server config, <VirtualHost>, <Global>, <Anonymous>
Module: mod_digest
Compatibility: 1.2.10 or later

The DigestTypes directive configures the enabled digest/hash algorithms. If no DigestTypes directive is configured, then all digest algorithms are enabled. Digest algorithms enabled are announced in the server FEAT reply. Following a list of digest types with the corresponding FTP command:
Digest TypeFTP Command
crc32XCRC
md5XMD5
sha1XSHA1
sha256XSHA256
allEnables all


DigestMaxSize

Syntax:DigestMaxSize number
Default: unlimited
Context: server config, <VirtualHost>, <Global>, <Anonymous>
Module: mod_digest
Compatibility: 1.2.10 or later

The DigestMaxSize directive configures the maximum number of bytes a single hash command is allowed to read from a file. If the number of bytes to be read from the file is greater than the configured limit the server will return an error. If no DigestMaxSize directive is configured, then there is no limit. It is stronly recommended to set an upper limit.


Installation

To install mod_digest, copy the mod_digest.c file into
  proftpd-dir/contrib/
Unpack the latest proftpd-1.2.x source code, then follow the usual steps for using third-party modules in proftpd:
  ./configure --with-modules=mod_digest
  make
  make install


Usage

Example Configuration
  <IfModule mod_digest.c>
    DigestTypes all
    DigestMaxSize 104857600 # 100MB
  </IfModule>



Author: Mathias Berchtold
Last Updated: 02/20/2006 10:57 PM


© Copyright 2006 SmartFTP
All Rights Reserved