Skip to content

Commit

Permalink
if private key is empty check
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfly722 committed Sep 14, 2024
1 parent c6fa10d commit 960042d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cloak-wg-helper/wireguard.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@
return generatePrivateKey();
},
generateKeypairForPrivate: function(base64PrivateKey){
if (base64PrivateKey === undefined || base64PrivateKey == null || base64PrivateKey.length <= 0) {
return {
publicKey: 'INCORRECT PRIVATE KEY',
privateKey: base64PrivateKey
}
}
try {
var privateKey = base64ToUint8Array(base64PrivateKey);
} catch {
Expand Down

0 comments on commit 960042d

Please sign in to comment.