Skip to content

Commit

Permalink
Hot fix for keys not being loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
racerxdl committed Jan 17, 2019
1 parent 2e2a511 commit e384fdd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion RemoteSigner/KeyRingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void AddKey(string publicKey, bool nonErasable = false) {


public void AddKey(PgpPublicKey publicKey, bool nonErasable = false) {
var fingerPrint = Tools.H16FP(publicKey.GetFingerprint().ToHexString());
var fingerPrint = Tools.H16FP(publicKey.KeyId.ToString("X16"));
if (!publicKeys.ContainsKey(fingerPrint)) {
publicKeys[fingerPrint] = publicKey;
FP8TO16[Tools.H8FP(fingerPrint)] = fingerPrint;
Expand Down Expand Up @@ -78,6 +78,12 @@ public PgpPublicKey GetKey(string fingerPrint) {
return null;
}
AddKey(key);
using (var s = Tools.GenerateStreamFromString(key)) {
var pgpPub = new PgpPublicKeyRing(PgpUtilities.GetDecoderStream(s));
foreach (PgpPublicKey pubKey in pgpPub.GetPublicKeys()) {
return pubKey;
}
}
}

return fingerPrint.Length == 8 ? publicKeys[FP8TO16[fingerPrint]] : publicKeys[fingerPrint];
Expand Down

0 comments on commit e384fdd

Please sign in to comment.