mirror of
https://github.com/open-quantum-safe/liboqs.git
synced 2025-10-08 00:03:38 -04:00
Fix NULL init of KEM and Sig contexts (#477)
* Added example_kem/sig and speed_kem/sig to Visual Studio. * Added check for NULL method name in KEM/Sig context generation. Avoids a crash in the following strcasecmp if NULL is passed as argument.
This commit is contained in:
parent
a8b6c2c1d6
commit
64c6af6921
@ -30,6 +30,9 @@ OQS_API int OQS_KEM_alg_count() {
|
||||
}
|
||||
|
||||
OQS_API OQS_KEM *OQS_KEM_new(const char *method_name) {
|
||||
if (method_name == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
if (0 == strcasecmp(method_name, OQS_KEM_alg_default)) {
|
||||
return OQS_KEM_new(OQS_KEM_DEFAULT);
|
||||
} else if (0 == strcasecmp(method_name, OQS_KEM_alg_bike1_l1)) {
|
||||
|
@ -33,6 +33,9 @@ OQS_API int OQS_SIG_alg_count() {
|
||||
}
|
||||
|
||||
OQS_API OQS_SIG *OQS_SIG_new(const char *method_name) {
|
||||
if (method_name == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
if (0 == strcasecmp(method_name, OQS_SIG_alg_default)) {
|
||||
return OQS_SIG_new(OQS_SIG_DEFAULT);
|
||||
} else if (0 == strcasecmp(method_name, OQS_SIG_alg_picnic_L1_FS)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user