| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 254a03b commit 0a4ff2f
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -83,16 +83,12 @@ Maybe<bool> DsaKeyGenTraits::AdditionalConfig( | |||
| 83 | 83 | const FunctionCallbackInfo<Value>& args, | |
| 84 | 84 | unsigned int* offset, | |
| 85 | 85 | DsaKeyPairGenConfig* params) { | |
| 86 | - Environment* env = Environment::GetCurrent(args); | ||
| 87 | 86 | CHECK(args[*offset]->IsUint32()); // modulus bits | |
| 88 | 87 | CHECK(args[*offset + 1]->IsInt32()); // divisor bits | |
| 89 | 88 | ||
| 90 | 89 | params->params.modulus_bits = args[*offset].As<Uint32>()->Value(); | |
| 91 | 90 | params->params.divisor_bits = args[*offset + 1].As<Int32>()->Value(); | |
| 92 | - if (params->params.divisor_bits < -1) { | ||
| 93 | - THROW_ERR_OUT_OF_RANGE(env, "invalid value for divisor_bits"); | ||
| 94 | - return Nothing<bool>(); | ||
| 95 | - } | ||
| 91 | + CHECK_GE(params->params.divisor_bits, -1); | ||
| 96 | 92 | ||
| 97 | 93 | *offset += 2; | |
| 98 | 94 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1278,7 +1278,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); | |||
| 1278 | 1278 | } | |
| 1279 | 1279 | ||
| 1280 | 1280 | // Test invalid divisor lengths. (out of range) | |
| 1281 | - for (const divisorLength of [-6, -9, 2147483648]) { | ||
| 1281 | + for (const divisorLength of [-1, -6, -9, 2147483648]) { | ||
| 1282 | 1282 | assert.throws(() => generateKeyPair('dsa', { | |
| 1283 | 1283 | modulusLength: 2048, | |
| 1284 | 1284 | divisorLength | |
| Back | FazBrowse Home | New Git URL |
0 commit comments