Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'master' of git://github.com/richardbuckle/oauthconsumer

Conflicts:
	Crypto/sha1.c
	OAToken.m
  • Loading branch information...
commit 469d6b1d07895d33b88da63075f455f501544563 2 parents da0507c + baddff4
Clint authored
3  Crypto/Base64Transcoder.c
@@ -160,6 +160,7 @@ else if (theRemainingBytes == 2)
160 160
 		outOutputData[theOutIndex++] = '\n';
161 161
 		}
162 162
 	}
  163
+(void)theOutIndex; // tell the static analyser we don't care that the last postincrement is never read
163 164
 return(true);
164 165
 
165 166
 // MODS THS - silence analyzer warnings about stored values never being read
@@ -177,7 +178,7 @@ if (*ioOutputDataSize < theDecodedDataSize)
177 178
 const u_int8_t *theInPtr = (const u_int8_t *)inInputData;
178 179
 u_int8_t *theOutPtr = (u_int8_t *)ioOutputData;
179 180
 size_t theInIndex = 0, theOutIndex = 0;
180  
-u_int8_t theOutputOctet;
  181
+u_int8_t theOutputOctet = 0;
181 182
 size_t theSequence = 0;
182 183
 for (; theInIndex < inInputDataSize; )
183 184
 	{
8  Crypto/hmac.c
@@ -29,13 +29,14 @@
29 29
  */
30 30
 
31 31
 #include "sha1.h"
  32
+#include "hmac.h"
32 33
 
33 34
 #include <stdlib.h>
34 35
 #include <string.h>
35 36
 
36  
-void hmac_sha1(const unsigned char *inText, size_t inTextLength, unsigned char* inKey, size_t inKeyLength, unsigned char *outDigest)
  37
+void hmac_sha1(const unsigned char *inText, int inTextLength, unsigned char* inKey, const unsigned int inKeyLengthConst, unsigned char *outDigest)
37 38
 {
38  
-const size_t B = 64;
  39
+const int B = 64;
39 40
 const size_t L = 20;
40 41
 
41 42
 SHA1_CTX theSHA1Context;
@@ -43,6 +44,7 @@ unsigned char k_ipad[B + 1]; /* inner padding - key XORd with ipad */
43 44
 unsigned char k_opad[B + 1]; /* outer padding - key XORd with opad */
44 45
 
45 46
 /* if key is longer than 64 bytes reset it to key=SHA1 (key) */
  47
+unsigned int inKeyLength = inKeyLengthConst;
46 48
 if (inKeyLength > B)
47 49
 	{
48 50
 	SHA1Init(&theSHA1Context);
@@ -83,4 +85,4 @@ SHA1Update(&theSHA1Context, outDigest, L);     /* then results of 1st
83 85
 * hash */
84 86
 SHA1Final(outDigest, &theSHA1Context);          /* finish up 2nd pass */
85 87
 
86  
-}
  88
+}
2  Crypto/hmac.h
@@ -28,4 +28,4 @@
28 28
 
29 29
 extern void hmac_sha1(const unsigned char *inText, int inTextLength, unsigned char* inKey, const unsigned int inKeyLength, unsigned char *outDigest);
30 30
 
31  
-#endif /* HMAC_H */
  31
+#endif /* HMAC_H */
6  Crypto/sha1.c
@@ -99,8 +99,7 @@ static unsigned char workspace[64];
99 99
     /* Wipe variables */
100 100
     a = b = c = d = e = 0;
101 101
 
102  
-// MODS THS - silence analyzer warnings about stored values never being read
103  
-#pragma unused(a,b,c,d,e)
  102
+    (void)a; (void)b; (void)c; (void)d; (void)e;
104 103
 }
105 104
 
106 105
 
@@ -163,8 +162,7 @@ unsigned char finalcount[8];
163 162
     /* Wipe variables */
164 163
     i = j = 0;
165 164
 
166  
-// MODS THS - silence analyzer warnings about stored values never being read
167  
-#pragma unused(i,j)
  165
+    (void)i; (void)j;
168 166
 
169 167
     memset(context->buffer, 0, 64);
170 168
     memset(context->state, 0, 20);
16  OAToken.m
@@ -33,14 +33,13 @@ + (NSString *)settingsKey:(const NSString *)name provider:(const NSString *)prov
33 33
 + (id)loadSetting:(const NSString *)name provider:(const NSString *)provider prefix:(const NSString *)prefix;
34 34
 + (void)saveSetting:(NSString *)name object:(id)object provider:(const NSString *)provider prefix:(const NSString *)prefix;
35 35
 + (NSNumber *)durationWithString:(NSString *)aDuration;
36  
-+ (NSDictionary *)attributesWithString:(NSString *)theAttributes;
  36
++ (NSMutableDictionary *)attributesWithString:(NSString *)theAttributes;
37 37
 
38 38
 @end
39 39
 
40 40
 @implementation OAToken
41 41
 
42  
-@synthesize key, secret, verifier, session, duration, forRenewal;
43  
-@dynamic attributes;
  42
+@synthesize key, secret, session, duration, forRenewal;
44 43
 
45 44
 #pragma mark init
46 45
 
@@ -53,8 +52,8 @@ - (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret {
53 52
                   attributes:nil created:nil renewable:NO];
54 53
 }
55 54
 
56  
-- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret verifier:(NSString *)aVerifier session:(NSString *)aSession
57  
-		 duration:(NSNumber *)aDuration attributes:(NSDictionary *)theAttributes created:(NSDate *)creation
  55
+- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret session:(NSString *)aSession
  56
+		 duration:(NSNumber *)aDuration attributes:(NSMutableDictionary *)theAttributes created:(NSDate *)creation
58 57
 		renewable:(BOOL)renew {
59 58
 	[super init];
60 59
 	self.key = aKey;
@@ -184,13 +183,14 @@ - (void)setAttribute:(const NSString *)aKey value:(const NSString *)aAttribute {
184 183
 	[attributes setObject: aAttribute forKey: aKey];
185 184
 }
186 185
 
187  
-- (NSDictionary *)attributes {
188  
-	return [attributes autorelease];
  186
+- (NSDictionary*) attributes
  187
+{
  188
+	return attributes;
189 189
 }
190 190
 
191 191
 - (void)setAttributes:(NSDictionary *)theAttributes {
192 192
 	[attributes release];
193  
-	attributes = [[NSMutableDictionary alloc] initWithDictionary:theAttributes];
  193
+	attributes = [theAttributes mutableCopy];
194 194
 	
195 195
 }
196 196
 

0 notes on commit 469d6b1

Please sign in to comment.
Something went wrong with that request. Please try again.