diff options
-rw-r--r-- | src/lib/pk_pad/eme.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/pk_pad/eme.cpp b/src/lib/pk_pad/eme.cpp index 23c444506..5164157f7 100644 --- a/src/lib/pk_pad/eme.cpp +++ b/src/lib/pk_pad/eme.cpp @@ -43,12 +43,13 @@ EME* get_eme(const std::string& algo_spec) req.algo_name() == "EME-OAEP" || req.algo_name() == "EME1") { - if(req.arg_count() == 1 ||(req.arg_count() == 2 && req.arg(1) == "MGF1")) + if(req.arg_count() == 1 || + ((req.arg_count() == 2 || req.arg_count() == 3) && req.arg(1) == "MGF1")) { if(auto hash = HashFunction::create(req.arg(0))) - return new OAEP(hash.release()); + return new OAEP(hash.release(), req.arg(2, "")); } - else if(req.arg_count() == 2) + else if(req.arg_count() == 2 || req.arg_count() == 3) { auto mgf_params = parse_algorithm_name(req.arg(1)); @@ -59,7 +60,7 @@ EME* get_eme(const std::string& algo_spec) if(hash && mgf1_hash) { - return new OAEP(hash.release(), mgf1_hash.release()); + return new OAEP(hash.release(), mgf1_hash.release(), req.arg(2, "")); } } } |