check for null Promise *pp before dereferencing
New option `--print-digest`/`-p` for `cf-key`.

With the new option it is possible to print the default CFEngine
digest value for a given public key file.
New option `--trust-key`/`-t` for `cf-key`.

This new option copies the given public key file
to the file name where `cf-serverd` would have stored
it if it had been gotten as the result of a successful
network exchange.

Such an option is intended to be used in fully-automated
installs, when there is a trusted way of deploying client
keys on the server and vice-versa.

  modified:   cf-key.c
Unsilent error when lsdir() is not able to read the directory
Rename update.cf bundle names to fit internal naming schema.
Change BufferNew signature:

int BufferNew(Buffer **buffer) -> Buffer* BufferNew(void)

Since BufferNew uses xmalloc internally, checking its return value seems redundant.
Buffer initialization can be done in a single line now. Semantics similar to Map, Set and other data structures.
Merge pull request #337 from awsiv/master

Change BufferNew Signature
Remove dead stuff from ReadPromises

Move SetAuditVersion into ReadPromises
Rename variable ok -> policy_check_ok in generic_agent:ReadPromises
Pull REQUIRE_COMMENTS logic out of generic_agent:VerifyPromises

There's no verification in this.
Fix formatting in CheckConstraint
Remove global BODYPARTS, introduce PolicyCheckRunnable

Previously, referenced bodies from bundles where appended to the global
BODYPARTS list when calling CheckConstraint from the parser. These were
subsequently accounted for in generic_agent:VerifyPromises.

Now, PolicyCheck is split into PolicyCheckPartial and PolicyCheckRunnable.
PolicyCheckPartial verifies a partial policy, while PolicyCheckRunnable
verifies the integrity of a runnable policy. The latter now checks for
undefined bodies from the policy DOM alone.
Remove global SUBBUNDLES, use PolicyCheckRunnable
Merge pull request #338 from sigurdteigen/cleanup/runnable-policy-checks

Cleanup/runnable policy checks
Merge pull request #334 from estenberg/bugfix/lsdir-report

Unsilent error when lsdir() is not able to read the directory
Define failsafe_fallback class on main policy error, useful for special handling in failsafe.cf and reporting
Remove global REQUIRE_COMMENTS, use PolicyCheckRunnable
Remove unused variable freport_html in OpenCompilationReportFiles
Add explicit check for body common control to PolicyCheckRunnable
Add --full-check flag to cf-promises

Previously, cf-promises did full validation checks requiring a
runnable policy (with body common control) as input. It also did
certain checks to see that bundle/body references were accounted for.

Now, cf-promises will validate a partial policy file if this is given.
If it is given a runnable policy file, it will additionally validate
the integrity as before.

To enforce integrity checks, use the new --full-check flag. This is
also being used by other agents when running cf-promises for validation.

The new lighter partial checks makes it possible to use cf-promises as
a tool operating on incomplete policies.