Directory CommModule

This directory contains the CommModule that is implemented in Perl:

CommModule/ implements the signer protocol client, running on the webserver and talking to the server via a serial link.

The style of the Perl code seems a bit inconsistent (mix of uppercase and lowercase function names, usage of brackets). The code uses database polling in a loop. It might be a better idea to use some kind of queueing (Redis, AMQP, …) to not waste resources when there is nothing to do). Function parameters are not named which makes the code hard to read.

The script calls several system binaries that need to be present in compatible versions:

  • openssl

  • xdelta

The script uses several Perl standard library modules as well as the following third party modules:

The script references several openssl configuration files in the HandleCerts function that are not included in the code repository. There are some openssl configuration files with similar names in

The database password is parsed from includes/mysql.php and relies on the exact code that is defined there. Database name, user and host are hardcoded in the DBI->connect call.

The script implements the client side of the signer protocol which is specified in The Signer Protocol.

The script performs the following operations:

  • parse password from includes/mysql.php

  • read a list of CRL files and logs their SHA-1 hashes

  • read serial.conf, create a Device::SerialPort instance $portObj, sets serial parameters and saves serial.conf

  • run a main loop as long as a file ./ is present. The main loop performs the following tasks

    • handle pending OpenPGP key signing request via HandleGPG()

    • handle pending certificate signing requests:

      • personal client certificates via HandleCerts(0, 0)

      • personal server certificates via HandleCerts(0, 1)

      • organization client certificates via HandleCerts(1, 0)

      • organization server certificates via HandleCerts(1, 1)

    • handle pending certificate revocation requests

      • personal client certificates via RevokeCerts(0, 0)

      • personal server certificates via RevokeCerts(0, 1)

      • organization client certificates via RevokeCerts(1, 0)

      • organization server certificates via RevokeCerts(1, 1)

    • refresh CRLs via RefreshCRLs() in every 100st iteration

    • send a NUL request to keep the signer connection alive

    • sleep for 2.7 seconds

The script uses a lot of temporary files instead of piping input and output to and from external commands.


describe more in-depth what each of the main loop steps does


commdaemon is a script to run or

This bash script is automatically restarting the script given as the first parameter as long as a file script-active exists. Informational messages and errors are logged to syslog via logger.

The script is most probably used to recover from crashed scripts. This could be implemented via supervisor or systemd instead of a custom script.


commodule is a System V style init script for startup/shutdown of CommModule

On two slightly different versions are deployed in /etc/init.d the first version starts in /home/cacert/www/CommModule/ and the second variant starts in /home/signer/cacert-devel/CommModule/.

CommModule/ is a maintenance script for logfiles generated by CommModule.

The script performs log rotation of signer logfiles.


discuss replacement of this script with logrotate and a custom logrotate.conf for the signer


serial.conf serial port configuration file

This file is read and written by both and therefore both cannot be run from the same directory without interfering with each other.


add a serial.conf template and move the actual serial.conf into configuration management

CommModule/ is the signing server software.

This script implements the signer (server) side of the signer protocol and performs the actual signing operations.

The script contains a some code that is duplicated by


The used on is different from the version in the cacert-devel repository. The git origin is recorded as git:// and there are some small uncommitted changes too.


get the versions of on, the real production signer and the cacert-devel repository synchronized

CommModule/ is an obsoleted USB version of above


remove unused file (