GithubHelp home page GithubHelp logo

chatsecure / signalprotocol-objc Goto Github PK

View Code? Open in Web Editor NEW
12.0 5.0 15.0 90 KB

Unofficial Objective-C wrapper for libsignal-protocol-c

Home Page: https://github.com/WhisperSystems/libsignal-protocol-c

License: GNU General Public License v3.0

Objective-C 94.91% Ruby 4.41% Swift 0.69%

signalprotocol-objc's Introduction

SignalProtocolObjC

Build Status Version Status Carthage compatible Platform License (GPLv3)

Unofficial Objective-C wrapper for libsignal-protocol-c, built for use in ChatSecure iOS to provide OMEMO support. This library depends on SignalProtocolC, which provides Xcode-friendly packaging for libsignal-protocol-c.

This software is not affiliated with or endorsed by Open Whisper Systems.

Cryptography Notice

This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.

The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.

License

Copyright 2016-2018 Chris Ballinger

Licensed under the GPLv3: http://www.gnu.org/licenses/gpl-3.0.html

Additional Permissions For Submission to Apple App Store: Provided that you are otherwise in compliance with the GPLv3 for each covered work you convey (including without limitation making the Corresponding Source available in compliance with Section 6 of the GPLv3), the author(s) also grant you the additional permission to convey through the Apple App Store non-source executable versions of the Program as incorporated into each applicable covered work as Executable Versions only under the Mozilla Public License version 2.0 (https://www.mozilla.org/en-US/MPL/2.0/).

This software depends on libsignal-protocol-c which is covered by a separate license.

signalprotocol-objc's People

Contributors

chrisballinger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

signalprotocol-objc's Issues

Unable to use existed prekeys

I try to use this Objective-C wrapper classes for our Swift app, but we are facing issue with using existing pre-keys & signed pre-keys. As per the signal protocol, the keys are generated on client install time and then read from server for encryption/decryption. We saw tests where keys are generated everytime before encryption/decryption, but none for the above scenario. We can't find the methods for using existing pre-keys & signed pre-keys. Can you please help us to solve this issue.

Error in DecryptCiphertext in session cipher class

Good evening,

We are trying to use Signal with OMEMO in an XMPP application, however we are stuck in decrypting the message payload in session cipher:
NSData *decryptedKeyData = [sessionCipher decryptCiphertext:ciphertext error:&error];

Session builder processing pre key message returns "Invalid ProtoBuf" error -

Screenshot 2020-03-27 at 4 33 02 PM

And i am getting the error as mentioned below:

Screenshot 2020-03-27 at 4 34 18 PM

Could you please help us?

Thanks in advance

Option to export SignalKeyPair as serialized data

Hello! I've been combing over this CocoaPod wrapper for the Signal Protocol library for Objective-C. It's a very interesting port so far!

One blocker I've hit is trying to serialize the publicKey and privateKey for a SignalKeyPair through this pod. Using the JAVA library I was able to call something like...

SignalKeyPair.getPublicKey().serialize()

Which I could then export as a base64, and import again elsewhere and load back in as a serialized data source.

Is this something not possible with this wrapper?

Make two public header files private

Shouldn't SignalCommonCryptoProvider.h be private? And, shouldn't SignalPreKeyMessage.h be private like SignalMessage.h?

I can't think of any good reasons that an application using SignalProtocol-ObjC would need to know about SignalCommonCryptoProvider and/or its instance method cryptoProvider or SignalPreKeyMessage and/or its designated initializer.

Encryption of SignalMessage fails 'n' times then succeeds with the same message

I have a strange situation where after having successfully processed/decrypted the PreSignalMessage, calling SignalSessionCipher.encryptData fails with a 'Code 0 - Unknown error'

After some investigation, I found that if simply repeating the call to SignalSessionCipher.encryptData step recursively it will eventually succeed.

Can anyone shed some light on this or point me in the direction of how to isolate the problem?

Error trying to run test

I have cloned the code, I ran pod install inside the folder Testing and when I want to run the project I get this error:

Module 'SignalProtocolC' not found

screen shot 2017-11-15 at 11 04 07 am

Error in SignalPreKeyBundle initWithRegistrationId method

Good evening,

we are trying to use Signal with OMEMO in an XMPP app, however we are stuck in this method:

SignalPreKeyBundle* preKey = [[SignalPreKeyBundle alloc] initWithRegistrationId:0 deviceId:deviceId preKeyId:key.preKeyId preKeyPublic:key.publicKey signedPreKeyId:bundle.signedPreKey.preKeyId signedPreKeyPublic:bundle.signedPreKey.publicKey signature:bundle.signedPreKey.signature identityKey:bundle.identityKey error:&error];

As the init method is not able to use prekey publickey generated by the SignalHelper of the same framework. Could you please help us?

As you can see

captura de pantalla 2019-01-08 a las 18 04 53

ec_public_key *pre_key_public = [SignalKeyPair publicKeyFromData:preKeyPublic error:error];
if (!pre_key_public) {
return nil;
}

is returning nil.. the error is domain: "org.whispersystems.SignalProtocol" - code: 4

Thanks in advance

Curious why SignalPreKeyMessage appears to be unsupported

I've noticed in the codebase that most references to SignalPreKeyMessage have been commented out and thus unsupported for use.

Was there a specific reason or decision that led to this? In the JAVA library this appears to be used and is working.

One example: Classes/SignalSessionBuilder.m

/*
- (void) processPreKeyMessage:(SignalPreKeyMessage*)preKeyMessage {
    NSParameterAssert(preKeyMessage);
    if (!preKeyMessage) { return; }
    session_record *record = NULL;
    //int result = session_record_create(&record, <#session_state *state#>, <#signal_context *global_context#>)
    //int result = session_builder_process_pre_key_signal_message(_builder, <#session_record *record#>, <#pre_key_signal_message *message#>, <#uint32_t *unsigned_pre_key_id#>)
}
 */

Cocoapods 0.39.0 errors

Encountered the problem using Cocoapods 0.39.0 on both the test project and ChatSecure-iOS.

XCode gives the following errors for SignalContext.m:

SignalContext.m:10:9: Use of private header from outside its module: 'SignalContext_Internal.h'
SignalContext.m:12:9: Use of private header from outside its module: 'SignalStorage_Internal.h'

Changes to ChatSecure-iOS Podfile:

pod 'SignalProtocolC', :podspec => 'https://raw.githubusercontent.com/ChatSecure/SignalProtocolC.podspec/3f30f3d50d1a85305df3ff5f047b3dd379f12e73/SignalProtocolC.podspec'
pod 'SignalProtocol-ObjC', :path => 'Submodules/SignalProtocol-ObjC/SignalProtocol-ObjC.podspec'

Since we still can't use Cocoapods 1.x.x with ChatSecure-iOS we should try to find a way to make this work on 0.39.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.