Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
fix: allow sender verkey to be null when packing with anoncrypt (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTreek authored Dec 17, 2021
1 parent 222b2d0 commit e23aa64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ios/IndySdk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class IndySdk : NSObject {
IndyCrypto.verifySignature(signatureData, forMessage: messageData, key: signerVk, completion: completionWithBool(resolve, reject))
}

@objc func packMessage(_ wh: NSNumber, message: Array<UInt8>, receiverKeys: String, senderVk: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void {
@objc func packMessage(_ wh: NSNumber, message: Array<UInt8>, receiverKeys: String, senderVk: String?, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void {
let whNumber = Int32(truncating: wh)
let messageData = Data(message)
IndyCrypto.packMessage(messageData, receivers: receiverKeys, sender: senderVk, walletHandle: whNumber, completion: completionWithData(resolve, reject))
Expand Down
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,12 @@ const indy = {
return IndySdk.cryptoVerify(signerVk, Array.from(message), Array.from(signature))
},

async packMessage(wh: WalletHandle, message: Buffer, receiverKeys: Verkey[], senderVk: string): Promise<Buffer> {
async packMessage(
wh: WalletHandle,
message: Buffer,
receiverKeys: Verkey[],
senderVk: string | null
): Promise<Buffer> {
if (Platform.OS == 'ios') {
return Buffer.from(await IndySdk.packMessage(wh, Array.from(message), JSON.stringify(receiverKeys), senderVk))
}
Expand Down

0 comments on commit e23aa64

Please sign in to comment.