- if (stream == STREAM_WIN32_DATA) {
- stream = STREAM_WIN32_GZIP_DATA;
- } else if (stream == STREAM_FILE_DATA) {
- stream = STREAM_GZIP_DATA;
- } else {
- stream = STREAM_SPARSE_GZIP_DATA;
+ switch (stream) {
+ case STREAM_WIN32_DATA:
+ stream = STREAM_WIN32_GZIP_DATA;
+ break;
+ case STREAM_SPARSE_DATA:
+ stream = STREAM_SPARSE_GZIP_DATA;
+ break;
+ case STREAM_FILE_DATA:
+ stream = STREAM_GZIP_DATA;
+ break;
+ default:
+ /* All stream types that do not support gzip should clear out
+ * FO_GZIP above, and this code block should be unreachable. */
+ ASSERT(!(ff_pkt->flags & FO_GZIP));
+ return STREAM_NONE;
+ }
+ }
+#endif
+#ifdef HAVE_CRYPTO
+ if (ff_pkt->flags & FO_ENCRYPT) {
+ switch (stream) {
+ case STREAM_WIN32_DATA:
+ stream = STREAM_ENCRYPTED_WIN32_DATA;
+ break;
+ case STREAM_WIN32_GZIP_DATA:
+ stream = STREAM_ENCRYPTED_WIN32_GZIP_DATA;
+ break;
+ case STREAM_FILE_DATA:
+ stream = STREAM_ENCRYPTED_FILE_DATA;
+ break;
+ case STREAM_GZIP_DATA:
+ stream = STREAM_ENCRYPTED_FILE_GZIP_DATA;
+ break;
+ default:
+ /* All stream types that do not support encryption should clear out
+ * FO_ENCRYPT above, and this code block should be unreachable. */
+ ASSERT(!ff_pkt->flags & FO_ENCRYPT);
+ return STREAM_NONE;