+#ifndef DISABLE_LEGACY
+ /* Don't use key material until every check has passed. */
+ cipher_free(&from->outcipher);
+ digest_free(&from->outdigest);
+#endif
+
+ if(!from->status.sptps) {
+ from->status.validkey = false;
+ }
+
+ switch(compression) {
+ case COMPRESS_LZ4:
+#ifdef HAVE_LZ4
+ break;
+#else
+ logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses bogus compression level!", from->name, from->hostname);
+ logger(DEBUG_ALWAYS, LOG_ERR, "LZ4 compression is unavailable on this node.");
+ return true;
+#endif
+
+ case COMPRESS_LZO_HI:
+ case COMPRESS_LZO_LO:
+#ifdef HAVE_LZO
+ break;
+#else
+ logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses bogus compression level!", from->name, from->hostname);
+ logger(DEBUG_ALWAYS, LOG_ERR, "LZO compression is unavailable on this node.");
+ return true;
+#endif
+
+ case COMPRESS_ZLIB_9:
+ case COMPRESS_ZLIB_8:
+ case COMPRESS_ZLIB_7:
+ case COMPRESS_ZLIB_6:
+ case COMPRESS_ZLIB_5:
+ case COMPRESS_ZLIB_4:
+ case COMPRESS_ZLIB_3:
+ case COMPRESS_ZLIB_2:
+ case COMPRESS_ZLIB_1:
+#ifdef HAVE_ZLIB
+ break;
+#else
+ logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses bogus compression level!", from->name, from->hostname);
+ logger(DEBUG_ALWAYS, LOG_ERR, "ZLIB compression is unavailable on this node.");
+ return true;
+#endif
+
+ case COMPRESS_NONE:
+ break;
+
+ default:
+ logger(DEBUG_ALWAYS, LOG_ERR, "Node %s (%s) uses bogus compression level!", from->name, from->hostname);
+ logger(DEBUG_ALWAYS, LOG_ERR, "Compression level %i is unrecognized by this node.", compression);
+ return true;
+ }
+
+ from->outcompression = compression;
+