Comparing version 0.0.18 to 0.0.19
Changelog | ||
--------- | ||
##### 0.0.19 | ||
- Removed dependency on ursa package. | ||
##### 0.0.18 | ||
@@ -5,0 +8,0 @@ - Locked down dependencies, moved to mdns package |
@@ -11,9 +11,9 @@ "use strict"; | ||
stream.on('data', function(d) { | ||
process.stdout.write('\rWriting for Server 1: ' + d.length + ' bytes @ ' + new Date().getTime() + '\t'); | ||
process.stdout.write('\rWriting for Server 1: ' + d.length + ' bytes @ ' + new Date().getTime() + '\t'); | ||
}) | ||
}); | ||
server2.on('clientConnected', function(stream) { | ||
server2.on('clientConnected', function(stream) { | ||
stream.on('data', function(d) { | ||
process.stdout.write('\rWriting for Server 2: ' + d.length + ' bytes @ ' + new Date().getTime() + '\t'); | ||
process.stdout.write('\rWriting for Server 2: ' + d.length + ' bytes @ ' + new Date().getTime() + '\t'); | ||
}) | ||
@@ -20,0 +20,0 @@ }); |
@@ -16,2 +16,2 @@ "use strict"; | ||
server.start(); | ||
server.start(); |
"use strict"; | ||
var ursa = require('ursa'); | ||
var forge = require('node-forge'); | ||
var rsa = forge.pki.rsa; | ||
var fs = require('fs'); | ||
@@ -68,4 +70,12 @@ var crypto = require('crypto'); | ||
var privkey = ursa.createPrivateKey(fs.readFileSync(__dirname + '/../private.key')); | ||
var getPrivateKey = function() { | ||
var keyFile = fs.readFileSync(__dirname + '/../private.key'); | ||
var privkey = forge.pki.privateKeyFromPem(keyFile); | ||
return privkey; | ||
}; | ||
var privateKey = getPrivateKey(); | ||
var generateAppleResponse = function(challengeBuf, ipAddr, macAddr) { | ||
@@ -79,7 +89,7 @@ var fullChallenge = Buffer.concat([ challengeBuf, ipAddr, macAddr ]); | ||
} | ||
fullChallenge = Buffer.concat([ fullChallenge, new Buffer(padding) ]); | ||
var response = privkey.privateEncrypt(fullChallenge, 'base64', 'base64'); | ||
fullChallenge = Buffer.concat([ fullChallenge, new Buffer(padding) ]).toString('binary'); | ||
var response = forge.pki.rsa.encrypt(fullChallenge, privateKey, 0x01); | ||
return response; | ||
return forge.util.encode64(response); | ||
}; | ||
@@ -100,2 +110,2 @@ | ||
module.exports.generateRfc2617Response = generateRfc2617Response; | ||
module.exports.rsaOperations = privkey; | ||
module.exports.rsaPrivateKey = privateKey; |
@@ -25,3 +25,2 @@ "use strict"; | ||
// pull method processors | ||
this.methodMapping = require('./rtspmethods')(this); | ||
@@ -43,3 +42,2 @@ | ||
parser.on('message', function(req, res) { | ||
//console.log(socket.id, 'received req:', req.method); | ||
@@ -73,3 +71,3 @@ res.set('CSeq', req.getHeader('CSeq')); | ||
this.self.rtp.stop(); | ||
this.self.external.emit('clientDisconnected'); | ||
this.self.external.emit('clientDisconnected'); | ||
} | ||
@@ -76,0 +74,0 @@ |
@@ -78,3 +78,3 @@ "use strict"; | ||
if (sp[0] == 'rsaaeskey') { | ||
rtspServer.audioAesKey = tools.rsaOperations.decrypt(new Buffer(sp[1], 'base64')); | ||
rtspServer.audioAesKey = tools.rsaPrivateKey.decrypt(new Buffer(sp[1], 'base64').toString('binary'), 'RSA-OAEP'); | ||
} else if (sp[0] == 'aesiv') { | ||
@@ -94,3 +94,3 @@ rtspServer.audioAesIv = new Buffer(sp[1], 'base64'); | ||
} | ||
rtspServer.clientName = sdp.i; | ||
@@ -107,3 +107,3 @@ | ||
rtspServer.ports = []; | ||
var getRandomPort = function() { | ||
@@ -157,3 +157,3 @@ var min = 5000; | ||
if (req.getHeader('Content-Type') == 'application/x-dmap-tagged') { | ||
// metadata dmap/daap format | ||
@@ -165,3 +165,3 @@ var dmapData = tools.parseDmap(req.content); | ||
} else if (req.getHeader('Content-Type') == 'image/jpeg') { | ||
rtspServer.metadata.artwork = req.content; | ||
@@ -183,3 +183,3 @@ rtspServer.external.emit('artworkChange', req.content); | ||
rtspServer.external.emit('progressChange', rtspServer.metadata.progress); | ||
} | ||
@@ -186,0 +186,0 @@ |
@@ -71,5 +71,5 @@ "use strict"; | ||
if (callback) { | ||
callback(null, { | ||
port: port, | ||
macAddress: this.options.macAddress, | ||
callback(null, { | ||
port: port, | ||
macAddress: this.options.macAddress, | ||
}); | ||
@@ -76,0 +76,0 @@ |
{ | ||
"name": "nodetunes", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"author": "Stephen Wan <stephen@stephenwan.net>", | ||
"description": "AirTunes v2 Music Server", | ||
"description": "AirTunes v2 Server Implementation", | ||
"contributors": [ | ||
@@ -24,11 +24,12 @@ { | ||
"dependencies": { | ||
"forge": "^2.2.0", | ||
"httplike": "0.0.8", | ||
"ip": "0.3.2", | ||
"mdns": "2.2.0", | ||
"ursa": "0.8.0", | ||
"ip": "0.3.2", | ||
"metricstream": "0.0.0", | ||
"node-forge": "^0.6.16", | ||
"portastic": "0.0.1", | ||
"priorityqueuejs": "0.2.0", | ||
"portastic": "0.0.1", | ||
"randomstring": "1.0.3", | ||
"httplike": "0.0.8", | ||
"random-mac": "0.0.4", | ||
"metricstream": "0.0.0" | ||
"randomstring": "1.0.3" | ||
}, | ||
@@ -35,0 +36,0 @@ "devDependencies": { |
@@ -28,3 +28,3 @@ var net = require('net'); | ||
beforeEach(function(done) { | ||
beforeEach(function(done) { | ||
client = new net.Socket(); | ||
@@ -98,3 +98,3 @@ parser = new Parser(client); | ||
parser.on('message', function(m) { | ||
assert(m.protocol === 'RTSP/1.0'); | ||
assert(m.protocol === 'RTSP/1.0'); | ||
assert(m.statusCode === 200); | ||
@@ -136,3 +136,3 @@ assert(m.statusMessage === 'OK'); | ||
assert(server.rtspServer.audioCodec === codec); | ||
assert(server.rtspServer.audioAesKey.toString('base64') === helper.rsaOperations.decrypt(new Buffer(rsaAesKey, 'base64')).toString('base64')); | ||
assert(server.rtspServer.audioAesKey.toString('base64') === helper.rsaPrivateKey.decrypt(new Buffer(rsaAesKey, 'base64').toString('binary'), 'RSA-OAEP').toString('base64')); | ||
assert(server.rtspServer.audioAesIv.toString('base64') === rsaAesIv); | ||
@@ -154,3 +154,3 @@ assert(server.rtspServer.metadata.clientName === 'Stephen\'s iPad'); | ||
assert(server.rtspServer.audioCodec === codec); | ||
assert(server.rtspServer.audioAesKey.toString('base64') === helper.rsaOperations.decrypt(new Buffer(rsaAesKey, 'base64')).toString('base64')); | ||
assert(server.rtspServer.audioAesKey.toString('base64') === helper.rsaPrivateKey.decrypt(new Buffer(rsaAesKey, 'base64').toString('binary'), 'RSA-OAEP').toString('base64')); | ||
assert(server.rtspServer.audioAesIv.toString('base64') === rsaAesIv); | ||
@@ -172,3 +172,3 @@ done(); | ||
assert(server.rtspServer.audioCodec === codec); | ||
assert(server.rtspServer.audioAesKey.toString('base64') === helper.rsaOperations.decrypt(new Buffer(rsaAesKey, 'base64')).toString('base64')); | ||
assert(server.rtspServer.audioAesKey.toString('base64') === helper.rsaPrivateKey.decrypt(new Buffer(rsaAesKey, 'base64').toString('binary'), 'RSA-OAEP').toString('base64')); | ||
assert(server.rtspServer.audioAesIv.toString('base64') === rsaAesIv); | ||
@@ -307,3 +307,3 @@ done(); | ||
}); | ||
var content = 'bawkbawk'; | ||
@@ -323,3 +323,3 @@ | ||
}); | ||
var content = 'bawkbawk'; | ||
@@ -326,0 +326,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2
32170
10
18
711
+ Addedforge@^2.2.0
+ Addednode-forge@^0.6.16
+ Addedacorn@5.7.4(transitive)
+ Addedamdefine@1.0.1(transitive)
+ Addedast-types@0.9.6(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbase62@0.1.1(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcli@1.0.1(transitive)
+ Addedcommander@2.20.3(transitive)
+ Addedcommoner@0.10.8(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconsole-browserify@1.1.0(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddate-now@0.1.4(transitive)
+ Addeddeep-is@0.1.4(transitive)
+ Addeddefined@1.0.1(transitive)
+ Addeddetective@4.7.1(transitive)
+ Addeddom-serializer@0.2.2(transitive)
+ Addeddomelementtype@1.3.12.3.0(transitive)
+ Addeddomhandler@2.3.0(transitive)
+ Addeddomutils@1.5.1(transitive)
+ Addedentities@1.0.02.2.0(transitive)
+ Addedescodegen@1.3.32.1.0(transitive)
+ Addedescope@1.0.3(transitive)
+ Addedesmangle@1.0.1(transitive)
+ Addedesprima@1.1.13.1.34.0.1(transitive)
+ Addedesprima-fb@13001.1001.0-dev-harmony-fb(transitive)
+ Addedesshorten@1.1.1(transitive)
+ Addedestraverse@1.5.12.0.04.1.15.3.0(transitive)
+ Addedesutils@1.0.02.0.3(transitive)
+ Addedexit@0.1.2(transitive)
+ Addedfast-levenshtein@1.0.7(transitive)
+ Addedforge@2.3.0(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfu@0.1.0(transitive)
+ Addedglob@5.0.157.2.3(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhtmlparser2@3.8.3(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedjshint@2.13.6(transitive)
+ Addedjshintify@0.1.0(transitive)
+ Addedjstransform@10.1.0(transitive)
+ Addedlevn@0.2.5(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmangleify@0.1.0(transitive)
+ Addedminimatch@3.0.83.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addednode-forge@0.6.49(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedoptionator@0.3.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedprelude-ls@1.1.2(transitive)
+ Addedprivate@0.1.8(transitive)
+ Addedq@1.5.1(transitive)
+ Addedreact-tools@0.13.3(transitive)
+ Addedreactify@1.1.1(transitive)
+ Addedreadable-stream@1.1.14(transitive)
+ Addedrecast@0.11.23(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsource-map@0.1.310.1.430.5.70.6.1(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedstrip-json-comments@1.0.4(transitive)
+ Addedsubarg@1.0.0(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedtype-check@0.3.2(transitive)
+ Addedwordwrap@0.0.3(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedursa@0.8.0
- Removedursa@0.8.0(transitive)