Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
View
@@ -160,6 +160,7 @@ else if (theRemainingBytes == 2)
outOutputData[theOutIndex++] = '\n';
}
}
+(void)theOutIndex; // tell the static analyser we don't care that the last postincrement is never read
return(true);
// MODS THS - silence analyzer warnings about stored values never being read
@@ -177,7 +178,7 @@ if (*ioOutputDataSize < theDecodedDataSize)
const u_int8_t *theInPtr = (const u_int8_t *)inInputData;
u_int8_t *theOutPtr = (u_int8_t *)ioOutputData;
size_t theInIndex = 0, theOutIndex = 0;
-u_int8_t theOutputOctet;
+u_int8_t theOutputOctet = 0;
size_t theSequence = 0;
for (; theInIndex < inInputDataSize; )
{
8 Crypto/hmac.c
View
@@ -29,13 +29,14 @@
*/
#include "sha1.h"
+#include "hmac.h"
#include <stdlib.h>
#include <string.h>
-void hmac_sha1(const unsigned char *inText, size_t inTextLength, unsigned char* inKey, size_t inKeyLength, unsigned char *outDigest)
+void hmac_sha1(const unsigned char *inText, int inTextLength, unsigned char* inKey, const unsigned int inKeyLengthConst, unsigned char *outDigest)
{
-const size_t B = 64;
+const int B = 64;
const size_t L = 20;
SHA1_CTX theSHA1Context;
@@ -43,6 +44,7 @@ unsigned char k_ipad[B + 1]; /* inner padding - key XORd with ipad */
unsigned char k_opad[B + 1]; /* outer padding - key XORd with opad */
/* if key is longer than 64 bytes reset it to key=SHA1 (key) */
+unsigned int inKeyLength = inKeyLengthConst;
if (inKeyLength > B)
{
SHA1Init(&theSHA1Context);
@@ -83,4 +85,4 @@ SHA1Update(&theSHA1Context, outDigest, L); /* then results of 1st
* hash */
SHA1Final(outDigest, &theSHA1Context); /* finish up 2nd pass */
-}
+}
2  Crypto/hmac.h
View
@@ -28,4 +28,4 @@
extern void hmac_sha1(const unsigned char *inText, int inTextLength, unsigned char* inKey, const unsigned int inKeyLength, unsigned char *outDigest);
-#endif /* HMAC_H */
+#endif /* HMAC_H */
6 Crypto/sha1.c
View
@@ -99,8 +99,7 @@ static unsigned char workspace[64];
/* Wipe variables */
a = b = c = d = e = 0;
-// MODS THS - silence analyzer warnings about stored values never being read
-#pragma unused(a,b,c,d,e)
+ (void)a; (void)b; (void)c; (void)d; (void)e;
}
@@ -163,8 +162,7 @@ unsigned char finalcount[8];
/* Wipe variables */
i = j = 0;
-// MODS THS - silence analyzer warnings about stored values never being read
-#pragma unused(i,j)
+ (void)i; (void)j;
memset(context->buffer, 0, 64);
memset(context->state, 0, 20);
16 OAToken.m
View
@@ -33,14 +33,13 @@ + (NSString *)settingsKey:(const NSString *)name provider:(const NSString *)prov
+ (id)loadSetting:(const NSString *)name provider:(const NSString *)provider prefix:(const NSString *)prefix;
+ (void)saveSetting:(NSString *)name object:(id)object provider:(const NSString *)provider prefix:(const NSString *)prefix;
+ (NSNumber *)durationWithString:(NSString *)aDuration;
-+ (NSDictionary *)attributesWithString:(NSString *)theAttributes;
++ (NSMutableDictionary *)attributesWithString:(NSString *)theAttributes;
@end
@implementation OAToken
-@synthesize key, secret, verifier, session, duration, forRenewal;
-@dynamic attributes;
+@synthesize key, secret, session, duration, forRenewal;
#pragma mark init
@@ -53,8 +52,8 @@ - (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret {
attributes:nil created:nil renewable:NO];
}
-- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret verifier:(NSString *)aVerifier session:(NSString *)aSession
- duration:(NSNumber *)aDuration attributes:(NSDictionary *)theAttributes created:(NSDate *)creation
+- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret session:(NSString *)aSession
+ duration:(NSNumber *)aDuration attributes:(NSMutableDictionary *)theAttributes created:(NSDate *)creation
renewable:(BOOL)renew {
[super init];
self.key = aKey;
@@ -184,13 +183,14 @@ - (void)setAttribute:(const NSString *)aKey value:(const NSString *)aAttribute {
[attributes setObject: aAttribute forKey: aKey];
}
-- (NSDictionary *)attributes {
- return [attributes autorelease];
+- (NSDictionary*) attributes
+{
+ return attributes;
}
- (void)setAttributes:(NSDictionary *)theAttributes {
[attributes release];
- attributes = [[NSMutableDictionary alloc] initWithDictionary:theAttributes];
+ attributes = [theAttributes mutableCopy];
}
Please sign in to comment.
Something went wrong with that request. Please try again.