Skip to content

Commit c675c9b

Browse files
Upgrading dependencies after Infer fixes.
1 parent 3e76570 commit c675c9b

31 files changed

+4334
-4435
lines changed

25519/Classes/Curve25519.m

+7-1
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,19 @@ -(NSData*) generateSharedSecretFromPublicKey:(NSData*)theirPublicKey {
9494
}
9595

9696
sharedSecret = malloc(32);
97+
9798
if (sharedSecret == NULL) {
99+
free(sharedSecret);
98100
return nil;
99101
}
100102

101103
curve25519_donna(sharedSecret,self->privateKey, [theirPublicKey bytes]);
102104

103-
return [NSData dataWithBytes:sharedSecret length:32];
105+
NSData *sharedSecretData = [NSData dataWithBytes:sharedSecret length:32];
106+
107+
free(sharedSecret);
108+
109+
return sharedSecretData;
104110
}
105111

106112
@end

25519/Sources/ed25519/additions/curve_sigs.c

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <string.h>
2+
#include <stdlib.h>
23
#include "ge.h"
34
#include "curve_sigs.h"
45
#include "crypto_sign.h"
@@ -125,13 +126,13 @@ int curve25519_verify(const unsigned char* signature,
125126

126127
err:
127128

128-
// if (verifybuf != NULL) {
129-
// free(verifybuf);
130-
// }
131-
//
132-
// if (verifybuf2 != NULL) {
133-
// free(verifybuf2);
134-
// }
129+
if (verifybuf != NULL) {
130+
free(verifybuf);
131+
}
132+
133+
if (verifybuf2 != NULL) {
134+
free(verifybuf2);
135+
}
135136

136137
return result;
137138
}

AxolotlKit/AxolotlKit/Classes/Crypto/AES-CBC.m

+8-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ +(NSData*)encryptCBCMode:(NSData*)data withKey:(NSData*)key withIV:(NSData*)iv{
3434
&bytesEncrypted);
3535

3636
if (cryptStatus == kCCSuccess){
37-
return [NSData dataWithBytesNoCopy:buffer length:bytesEncrypted];
37+
NSData *data = [NSData dataWithBytes:buffer length:bytesEncrypted];
38+
free(buffer);
39+
40+
return data;
3841
} else{
3942
free(buffer);
4043
@throw [NSException exceptionWithName:CipherException reason:@"We encountered an issue while encrypting." userInfo:nil];
@@ -55,7 +58,10 @@ +(NSData*) decryptCBCMode:(NSData*)data withKey:(NSData*)key withIV:(NSData*)iv
5558
&bytesDecrypted);
5659

5760
if (cryptStatus == kCCSuccess) {
58-
return [NSData dataWithBytesNoCopy:buffer length:bytesDecrypted];
61+
NSData *plaintext = [NSData dataWithBytes:buffer length:bytesDecrypted];
62+
free(buffer);
63+
64+
return plaintext;
5965
} else{
6066
free(buffer);
6167
@throw [NSException exceptionWithName:CipherException reason:@"We encountered an issue while decrypting." userInfo:nil];

AxolotlKit/AxolotlKit/Classes/Sessions/SessionBuilder.m

+8-6
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ - (instancetype)initWithSessionStore:(id<SessionStore>)sessionStore
5959
deviceId:(int)deviceId{
6060
self = [super init];
6161

62-
_sessionStore = sessionStore;
63-
_prekeyStore = preKeyStore;
64-
_signedPreKeyStore = signedPreKeyStore;
65-
_identityStore = identityKeyStore;
66-
_recipientId = recipientId;
67-
_deviceId = deviceId;
62+
if (self) {
63+
_sessionStore = sessionStore;
64+
_prekeyStore = preKeyStore;
65+
_signedPreKeyStore = signedPreKeyStore;
66+
_identityStore = identityKeyStore;
67+
_recipientId = recipientId;
68+
_deviceId = deviceId;
69+
}
6870

6971
return self;
7072
}

Manifest.lock

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- 25519 (1.9)
2+
- 25519 (2.0.1)
33
- AFNetworking (2.5.4):
44
- AFNetworking/NSURLConnection (= 2.5.4)
55
- AFNetworking/NSURLSession (= 2.5.4)
@@ -22,10 +22,10 @@ PODS:
2222
- AFNetworking/NSURLConnection
2323
- AFNetworking/NSURLSession
2424
- APDropDownNavToolbar (1.1)
25-
- AxolotlKit (0.6.3):
26-
- 25519 (~> 1.9)
25+
- AxolotlKit (0.7):
26+
- 25519 (~> 2.0.1)
2727
- HKDFKit (~> 0.0.3)
28-
- ProtocolBuffers (~> 1.9.7)
28+
- ProtocolBuffers (~> 1.9.8)
2929
- CocoaLumberjack (1.9.2):
3030
- CocoaLumberjack/Extensions (= 1.9.2)
3131
- CocoaLumberjack/Core (1.9.2)
@@ -63,7 +63,7 @@ DEPENDENCIES:
6363
- AFNetworking (~> 2.5.3)
6464
- APDropDownNavToolbar (from `https://github.com/corbett/APDropDownNavToolbar.git`,
6565
branch `master`)
66-
- AxolotlKit (~> 0.6.3)
66+
- AxolotlKit (~> 0.7)
6767
- DJWActionSheet
6868
- FFCircularProgressView (>= 0.1)
6969
- JSQMessagesViewController (from `https://github.com/WhisperSystems/JSQMessagesViewController`,
@@ -105,10 +105,10 @@ CHECKOUT OPTIONS:
105105
:git: https://github.com/FredericJacobs/SocketRocket.git
106106

107107
SPEC CHECKSUMS:
108-
'25519': 64b9ee595df81056693072b0a84246483988afac
108+
'25519': cd3f6f0658ac9dd4f95d7fb906378e1d0649c46c
109109
AFNetworking: 05edc0ac4c4c8cf57bcf4b84be5b0744b6d8e71e
110110
APDropDownNavToolbar: 5d0c3f363208543d20e86ddb4630927c28cdfd4b
111-
AxolotlKit: 1e4afc7ed1d0c724888f1d986c032976436f8bef
111+
AxolotlKit: 8652fca51f4bc8225cbda791b0026c21e912b694
112112
CocoaLumberjack: 628fca2e88ef06f7cf6817309aa405f325d9a6fa
113113
DJWActionSheet: 2fe54b1298a7f0fe44462233752c76a530e0cd80
114114
FFCircularProgressView: 683a4ab1e1bd613246a3dffa61503ffdebcde8d8
@@ -129,4 +129,4 @@ SPEC CHECKSUMS:
129129
UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d
130130
YapDatabase: f9051e178a38f48d0f3a78562423a5bc969f1ca3
131131

132-
COCOAPODS: 0.37.1
132+
COCOAPODS: 0.37.2

0 commit comments

Comments
 (0)