If running on a node that has openssl built in, then this will be used for the SHA1 hashing.
Otherwise will fallback to the pure JS (original) SHA! implementation.
This commit is contained in:
		
							
								
								
									
										10
									
								
								lib/oauth.js
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								lib/oauth.js
									
									
									
									
									
								
							| @ -165,10 +165,14 @@ exports.OAuth.prototype._createSignature= function(signatureBase, tokenSecret) { | ||||
|      hash= this._encodeData(key); | ||||
|    } | ||||
|    else { | ||||
|      hash= sha1.HMACSHA1(key, signatureBase); | ||||
|        if( crypto.Hmac ) { | ||||
|          hash = crypto.createHmac("sha1", key).update(signatureBase).digest("base64"); | ||||
|        } | ||||
|        else { | ||||
|          hash= sha1.HMACSHA1(key, signatureBase);   | ||||
|        } | ||||
|    } | ||||
|  | ||||
|    return hash; | ||||
|    return hash;     | ||||
| } | ||||
| exports.OAuth.prototype.NONCE_CHARS= ['a','b','c','d','e','f','g','h','i','j','k','l','m','n', | ||||
|               'o','p','q','r','s','t','u','v','w','x','y','z','A','B', | ||||
|  | ||||
		Reference in New Issue
	
	Block a user