mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-24 02:24:07 +00:00
Don't allow enabling encryption when it's not compiled in
This commit is contained in:
parent
8eb087120e
commit
182038c743
16
src/cfg.c
16
src/cfg.c
|
@ -861,9 +861,7 @@ int kvz_config_parse(kvz_config *cfg, const char *name, const char *value)
|
|||
if (toggle == 1) {
|
||||
cfg->crypto_features = KVZ_CRYPTO_ON;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
} else {
|
||||
// Try and parse "feature1+feature2" type list.
|
||||
for (;;) {
|
||||
if (*cur == '+' || *cur == '\0') {
|
||||
|
@ -884,6 +882,18 @@ int kvz_config_parse(kvz_config *cfg, const char *name, const char *value)
|
|||
++cur;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Disallow turning on the encryption when it's not compiled in.
|
||||
bool encryption_compiled_in = false;
|
||||
#ifdef KVZ_SEL_ENCRYPTION
|
||||
encryption_compiled_in = true;
|
||||
#endif
|
||||
if (!encryption_compiled_in && cfg->crypto_features) {
|
||||
fprintf(stderr, "--crypto cannot be enabled because it's not compiled in.\n");
|
||||
cfg->crypto_features = KVZ_CRYPTO_OFF;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue