freezerwatch 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +40 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/freezerwatch +9 -0
- data/bin/setup +7 -0
- data/freezerwatch.gemspec +23 -0
- data/lib/freezerwatch.rb +5 -0
- data/lib/freezerwatch/version.rb +3 -0
- data/node_modules/.bin/freezerwatch +139 -0
- data/node_modules/freezerwatch/.npmignore +3 -0
- data/node_modules/freezerwatch/.ruby-version +1 -0
- data/node_modules/freezerwatch/Gemfile +4 -0
- data/node_modules/freezerwatch/Gemfile.lock +79 -0
- data/node_modules/freezerwatch/LICENSE +23 -0
- data/node_modules/freezerwatch/README.md +41 -0
- data/node_modules/freezerwatch/Rakefile +13 -0
- data/node_modules/freezerwatch/freezerwatch.js +139 -0
- data/node_modules/freezerwatch/metrics/bigfiles_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/cane_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/flay_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/flog_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/punchlist_high_water_mark +2 -0
- data/node_modules/freezerwatch/metrics/reek_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/rubocop_high_water_mark +1 -0
- data/node_modules/freezerwatch/node_modules/async/.jshintrc +25 -0
- data/node_modules/freezerwatch/node_modules/async/.travis.yml +6 -0
- data/node_modules/freezerwatch/node_modules/async/CHANGELOG.md +65 -0
- data/node_modules/freezerwatch/node_modules/async/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/async/README.md +1803 -0
- data/node_modules/freezerwatch/node_modules/async/bower.json +43 -0
- data/node_modules/freezerwatch/node_modules/async/component.json +17 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/base.css +182 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/base.css +182 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/lib/async.js.html +3900 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/lib/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/prettify.css +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/prettify.js +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/sorter.js +156 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov.info +1452 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lib/async.js.html +3597 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lib/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/prettify.css +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/prettify.js +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/sort-arrow-sprite.png +0 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/sorter.js +156 -0
- data/node_modules/freezerwatch/node_modules/async/lib/async.js +1191 -0
- data/node_modules/freezerwatch/node_modules/async/nyc_output/5074.json +1 -0
- data/node_modules/freezerwatch/node_modules/async/package.json +96 -0
- data/node_modules/freezerwatch/node_modules/async/support/sync-package-managers.js +53 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/.npmignore +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/Client.js +60 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/Device.js +38 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/DeviceRawReadStream.js +36 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/DeviceSingleRawReadStream.js +29 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/DeviceStream.js +35 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/LICENSE +23 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/README.md +25 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/.travis.yml +12 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/README.md +364 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/index.js +156 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/copy.js +8 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/debug.js +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/getSafe.js +34 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/optional.js +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/.bin/uuid +26 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/index.js +202 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/package.json +46 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/index.js +119 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/package.json +45 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/License +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/Readme.md +175 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/lib/form_data.js +351 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/README.md +1647 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/bower.json +38 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/component.json +16 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +1123 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/package.json +84 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js +53 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +132 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +188 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +154 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +99 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json +42 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +38 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js +21 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js +14 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js +48 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js +13 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js +13 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +60 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/package.json +80 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/Makefile +10 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/README.md +627 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/example/usage.js +78 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/images/hawk.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/images/logo.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/browser.js +485 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/client.js +367 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/crypto.js +111 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/index.js +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/server.js +524 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/utils.js +183 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/Makefile +11 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/README.md +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js +207 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/package.json +64 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js +245 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile +11 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js +68 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +65 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js +101 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE +33 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile +10 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/README.md +436 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js +132 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js +585 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js +86 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js +1078 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile +11 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/README.md +68 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js +16 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js +25 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js +409 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +65 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js +359 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/browser.js +771 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/client.js +206 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/crypto.js +86 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/index.js +316 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/message.js +246 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/readme.js +98 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/server.js +686 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/uri.js +456 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/utils.js +120 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/.dir-locals.el +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/.npmignore +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/LICENSE +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/README.md +79 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/http_signing.md +296 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/index.js +26 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/parser.js +304 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/signer.js +178 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/util.js +304 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/verify.js +42 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md +50 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js +13 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js +27 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js +267 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js +36 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js +317 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js +20 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json +63 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js +172 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js +296 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md +126 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js +245 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +45 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG +78 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/README +82 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old +298 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js +245 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js +1485 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js +944 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype +241 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +42 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf +129 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle +839 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/package.json +72 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/.npmignore +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md +14 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/LICENSE +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/Makefile +35 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/README.md +52 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/package.json +68 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/stringify.js +27 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js +246 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/README.md +66 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/mime.js +114 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/package.json +57 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/test.js +84 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/types/mime.types +1588 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/types/node.types +77 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/LICENSE.md +21 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/README.md +243 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/README.md +53 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +174 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +34 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +34 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +84 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/bin/uuid +26 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/bower.json +23 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/component.json +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/package.json +65 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/compare_v1.js +63 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/test.html +17 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/test.js +228 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/uuid.js +247 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/index.js +43 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/package.json +48 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/test.js +49 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/.gitmodules +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/.npmignore +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/Readme.md +58 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/index.js +366 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/package.json +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/.jshintrc +72 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/.npmignore +3 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/LICENSE +78 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/README.md +380 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js +230 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/cookie.js +947 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/memstore.js +102 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js +69 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt +20 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md +176 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json +81 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js +530 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/package.json +63 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/public-suffix.txt +5229 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/test.js +1340 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/index.js +227 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/package.json +45 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/package.json +74 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/request.js +1244 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/package.json +34 -0
- data/node_modules/freezerwatch/node_modules/optparse/README.md +163 -0
- data/node_modules/freezerwatch/node_modules/optparse/TODO +1 -0
- data/node_modules/freezerwatch/node_modules/optparse/examples/browser-test.html +75 -0
- data/node_modules/freezerwatch/node_modules/optparse/examples/nodejs-test.js +86 -0
- data/node_modules/freezerwatch/node_modules/optparse/lib/optparse.js +309 -0
- data/node_modules/freezerwatch/node_modules/optparse/package.json +46 -0
- data/node_modules/freezerwatch/node_modules/optparse/seed.yml +5 -0
- data/node_modules/freezerwatch/node_modules/osenv/.npmignore +13 -0
- data/node_modules/freezerwatch/node_modules/osenv/.travis.yml +9 -0
- data/node_modules/freezerwatch/node_modules/osenv/LICENSE +15 -0
- data/node_modules/freezerwatch/node_modules/osenv/README.md +63 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/index.js +24 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/license +21 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/readme.md +33 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/index.js +25 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/license +21 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/readme.md +36 -0
- data/node_modules/freezerwatch/node_modules/osenv/osenv.js +72 -0
- data/node_modules/freezerwatch/node_modules/osenv/package.json +76 -0
- data/node_modules/freezerwatch/node_modules/osenv/test/unix.js +71 -0
- data/node_modules/freezerwatch/node_modules/osenv/test/windows.js +74 -0
- data/node_modules/freezerwatch/node_modules/osenv/x.tap +39 -0
- data/node_modules/freezerwatch/package.json +37 -0
- metadata +384 -0
@@ -0,0 +1,304 @@
|
|
1
|
+
// Copyright 2012 Joyent, Inc. All rights reserved.
|
2
|
+
|
3
|
+
var assert = require('assert-plus');
|
4
|
+
var crypto = require('crypto');
|
5
|
+
|
6
|
+
var asn1 = require('asn1');
|
7
|
+
var ctype = require('ctype');
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
///--- Helpers
|
12
|
+
|
13
|
+
function readNext(buffer, offset) {
|
14
|
+
var len = ctype.ruint32(buffer, 'big', offset);
|
15
|
+
offset += 4;
|
16
|
+
|
17
|
+
var newOffset = offset + len;
|
18
|
+
|
19
|
+
return {
|
20
|
+
data: buffer.slice(offset, newOffset),
|
21
|
+
offset: newOffset
|
22
|
+
};
|
23
|
+
}
|
24
|
+
|
25
|
+
|
26
|
+
function writeInt(writer, buffer) {
|
27
|
+
writer.writeByte(0x02); // ASN1.Integer
|
28
|
+
writer.writeLength(buffer.length);
|
29
|
+
|
30
|
+
for (var i = 0; i < buffer.length; i++)
|
31
|
+
writer.writeByte(buffer[i]);
|
32
|
+
|
33
|
+
return writer;
|
34
|
+
}
|
35
|
+
|
36
|
+
|
37
|
+
function rsaToPEM(key) {
|
38
|
+
var buffer;
|
39
|
+
var der;
|
40
|
+
var exponent;
|
41
|
+
var i;
|
42
|
+
var modulus;
|
43
|
+
var newKey = '';
|
44
|
+
var offset = 0;
|
45
|
+
var type;
|
46
|
+
var tmp;
|
47
|
+
|
48
|
+
try {
|
49
|
+
buffer = new Buffer(key.split(' ')[1], 'base64');
|
50
|
+
|
51
|
+
tmp = readNext(buffer, offset);
|
52
|
+
type = tmp.data.toString();
|
53
|
+
offset = tmp.offset;
|
54
|
+
|
55
|
+
if (type !== 'ssh-rsa')
|
56
|
+
throw new Error('Invalid ssh key type: ' + type);
|
57
|
+
|
58
|
+
tmp = readNext(buffer, offset);
|
59
|
+
exponent = tmp.data;
|
60
|
+
offset = tmp.offset;
|
61
|
+
|
62
|
+
tmp = readNext(buffer, offset);
|
63
|
+
modulus = tmp.data;
|
64
|
+
} catch (e) {
|
65
|
+
throw new Error('Invalid ssh key: ' + key);
|
66
|
+
}
|
67
|
+
|
68
|
+
// DER is a subset of BER
|
69
|
+
der = new asn1.BerWriter();
|
70
|
+
|
71
|
+
der.startSequence();
|
72
|
+
|
73
|
+
der.startSequence();
|
74
|
+
der.writeOID('1.2.840.113549.1.1.1');
|
75
|
+
der.writeNull();
|
76
|
+
der.endSequence();
|
77
|
+
|
78
|
+
der.startSequence(0x03); // bit string
|
79
|
+
der.writeByte(0x00);
|
80
|
+
|
81
|
+
// Actual key
|
82
|
+
der.startSequence();
|
83
|
+
writeInt(der, modulus);
|
84
|
+
writeInt(der, exponent);
|
85
|
+
der.endSequence();
|
86
|
+
|
87
|
+
// bit string
|
88
|
+
der.endSequence();
|
89
|
+
|
90
|
+
der.endSequence();
|
91
|
+
|
92
|
+
tmp = der.buffer.toString('base64');
|
93
|
+
for (i = 0; i < tmp.length; i++) {
|
94
|
+
if ((i % 64) === 0)
|
95
|
+
newKey += '\n';
|
96
|
+
newKey += tmp.charAt(i);
|
97
|
+
}
|
98
|
+
|
99
|
+
if (!/\\n$/.test(newKey))
|
100
|
+
newKey += '\n';
|
101
|
+
|
102
|
+
return '-----BEGIN PUBLIC KEY-----' + newKey + '-----END PUBLIC KEY-----\n';
|
103
|
+
}
|
104
|
+
|
105
|
+
|
106
|
+
function dsaToPEM(key) {
|
107
|
+
var buffer;
|
108
|
+
var offset = 0;
|
109
|
+
var tmp;
|
110
|
+
var der;
|
111
|
+
var newKey = '';
|
112
|
+
|
113
|
+
var type;
|
114
|
+
var p;
|
115
|
+
var q;
|
116
|
+
var g;
|
117
|
+
var y;
|
118
|
+
|
119
|
+
try {
|
120
|
+
buffer = new Buffer(key.split(' ')[1], 'base64');
|
121
|
+
|
122
|
+
tmp = readNext(buffer, offset);
|
123
|
+
type = tmp.data.toString();
|
124
|
+
offset = tmp.offset;
|
125
|
+
|
126
|
+
/* JSSTYLED */
|
127
|
+
if (!/^ssh-ds[as].*/.test(type))
|
128
|
+
throw new Error('Invalid ssh key type: ' + type);
|
129
|
+
|
130
|
+
tmp = readNext(buffer, offset);
|
131
|
+
p = tmp.data;
|
132
|
+
offset = tmp.offset;
|
133
|
+
|
134
|
+
tmp = readNext(buffer, offset);
|
135
|
+
q = tmp.data;
|
136
|
+
offset = tmp.offset;
|
137
|
+
|
138
|
+
tmp = readNext(buffer, offset);
|
139
|
+
g = tmp.data;
|
140
|
+
offset = tmp.offset;
|
141
|
+
|
142
|
+
tmp = readNext(buffer, offset);
|
143
|
+
y = tmp.data;
|
144
|
+
} catch (e) {
|
145
|
+
console.log(e.stack);
|
146
|
+
throw new Error('Invalid ssh key: ' + key);
|
147
|
+
}
|
148
|
+
|
149
|
+
// DER is a subset of BER
|
150
|
+
der = new asn1.BerWriter();
|
151
|
+
|
152
|
+
der.startSequence();
|
153
|
+
|
154
|
+
der.startSequence();
|
155
|
+
der.writeOID('1.2.840.10040.4.1');
|
156
|
+
|
157
|
+
der.startSequence();
|
158
|
+
writeInt(der, p);
|
159
|
+
writeInt(der, q);
|
160
|
+
writeInt(der, g);
|
161
|
+
der.endSequence();
|
162
|
+
|
163
|
+
der.endSequence();
|
164
|
+
|
165
|
+
der.startSequence(0x03); // bit string
|
166
|
+
der.writeByte(0x00);
|
167
|
+
writeInt(der, y);
|
168
|
+
der.endSequence();
|
169
|
+
|
170
|
+
der.endSequence();
|
171
|
+
|
172
|
+
tmp = der.buffer.toString('base64');
|
173
|
+
for (var i = 0; i < tmp.length; i++) {
|
174
|
+
if ((i % 64) === 0)
|
175
|
+
newKey += '\n';
|
176
|
+
newKey += tmp.charAt(i);
|
177
|
+
}
|
178
|
+
|
179
|
+
if (!/\\n$/.test(newKey))
|
180
|
+
newKey += '\n';
|
181
|
+
|
182
|
+
return '-----BEGIN PUBLIC KEY-----' + newKey + '-----END PUBLIC KEY-----\n';
|
183
|
+
}
|
184
|
+
|
185
|
+
|
186
|
+
///--- API
|
187
|
+
|
188
|
+
module.exports = {
|
189
|
+
|
190
|
+
/**
|
191
|
+
* Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file.
|
192
|
+
*
|
193
|
+
* The intent of this module is to interoperate with OpenSSL only,
|
194
|
+
* specifically the node crypto module's `verify` method.
|
195
|
+
*
|
196
|
+
* @param {String} key an OpenSSH public key.
|
197
|
+
* @return {String} PEM encoded form of the RSA public key.
|
198
|
+
* @throws {TypeError} on bad input.
|
199
|
+
* @throws {Error} on invalid ssh key formatted data.
|
200
|
+
*/
|
201
|
+
sshKeyToPEM: function sshKeyToPEM(key) {
|
202
|
+
assert.string(key, 'ssh_key');
|
203
|
+
|
204
|
+
/* JSSTYLED */
|
205
|
+
if (/^ssh-rsa.*/.test(key))
|
206
|
+
return rsaToPEM(key);
|
207
|
+
|
208
|
+
/* JSSTYLED */
|
209
|
+
if (/^ssh-ds[as].*/.test(key))
|
210
|
+
return dsaToPEM(key);
|
211
|
+
|
212
|
+
throw new Error('Only RSA and DSA public keys are allowed');
|
213
|
+
},
|
214
|
+
|
215
|
+
|
216
|
+
/**
|
217
|
+
* Generates an OpenSSH fingerprint from an ssh public key.
|
218
|
+
*
|
219
|
+
* @param {String} key an OpenSSH public key.
|
220
|
+
* @return {String} key fingerprint.
|
221
|
+
* @throws {TypeError} on bad input.
|
222
|
+
* @throws {Error} if what you passed doesn't look like an ssh public key.
|
223
|
+
*/
|
224
|
+
fingerprint: function fingerprint(key) {
|
225
|
+
assert.string(key, 'ssh_key');
|
226
|
+
|
227
|
+
var pieces = key.split(' ');
|
228
|
+
if (!pieces || !pieces.length || pieces.length < 2)
|
229
|
+
throw new Error('invalid ssh key');
|
230
|
+
|
231
|
+
var data = new Buffer(pieces[1], 'base64');
|
232
|
+
|
233
|
+
var hash = crypto.createHash('md5');
|
234
|
+
hash.update(data);
|
235
|
+
var digest = hash.digest('hex');
|
236
|
+
|
237
|
+
var fp = '';
|
238
|
+
for (var i = 0; i < digest.length; i++) {
|
239
|
+
if (i && i % 2 === 0)
|
240
|
+
fp += ':';
|
241
|
+
|
242
|
+
fp += digest[i];
|
243
|
+
}
|
244
|
+
|
245
|
+
return fp;
|
246
|
+
},
|
247
|
+
|
248
|
+
/**
|
249
|
+
* Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa)
|
250
|
+
*
|
251
|
+
* The reverse of the above function.
|
252
|
+
*/
|
253
|
+
pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) {
|
254
|
+
assert.equal('string', typeof pem, 'typeof pem');
|
255
|
+
|
256
|
+
// chop off the BEGIN PUBLIC KEY and END PUBLIC KEY portion
|
257
|
+
var cleaned = pem.split('\n').slice(1, -2).join('');
|
258
|
+
|
259
|
+
var buf = new Buffer(cleaned, 'base64');
|
260
|
+
|
261
|
+
var der = new asn1.BerReader(buf);
|
262
|
+
|
263
|
+
der.readSequence();
|
264
|
+
der.readSequence();
|
265
|
+
|
266
|
+
var oid = der.readOID();
|
267
|
+
assert.equal(oid, '1.2.840.113549.1.1.1', 'pem not in RSA format');
|
268
|
+
|
269
|
+
// Null -- XXX this probably isn't good practice
|
270
|
+
der.readByte();
|
271
|
+
der.readByte();
|
272
|
+
|
273
|
+
// bit string sequence
|
274
|
+
der.readSequence(0x03);
|
275
|
+
der.readByte();
|
276
|
+
der.readSequence();
|
277
|
+
|
278
|
+
// modulus
|
279
|
+
assert.equal(der.peek(), asn1.Ber.Integer, 'modulus not an integer');
|
280
|
+
der._offset = der.readLength(der.offset + 1);
|
281
|
+
var modulus = der._buf.slice(der.offset, der.offset + der.length);
|
282
|
+
der._offset += der.length;
|
283
|
+
|
284
|
+
// exponent
|
285
|
+
assert.equal(der.peek(), asn1.Ber.Integer, 'exponent not an integer');
|
286
|
+
der._offset = der.readLength(der.offset + 1);
|
287
|
+
var exponent = der._buf.slice(der.offset, der.offset + der.length);
|
288
|
+
der._offset += der.length;
|
289
|
+
|
290
|
+
// now, make the key
|
291
|
+
var type = new Buffer('ssh-rsa');
|
292
|
+
var buffer = new Buffer(4 + type.length + 4 + modulus.length + 4 + exponent.length);
|
293
|
+
var i = 0;
|
294
|
+
buffer.writeUInt32BE(type.length, i); i += 4;
|
295
|
+
type.copy(buffer, i); i += type.length;
|
296
|
+
buffer.writeUInt32BE(exponent.length, i); i += 4;
|
297
|
+
exponent.copy(buffer, i); i += exponent.length;
|
298
|
+
buffer.writeUInt32BE(modulus.length, i); i += 4;
|
299
|
+
modulus.copy(buffer, i); i += modulus.length;
|
300
|
+
|
301
|
+
var s = type.toString() + ' ' + buffer.toString('base64') + ' ' + (comment || '');
|
302
|
+
return s;
|
303
|
+
}
|
304
|
+
};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
// Copyright 2011 Joyent, Inc. All rights reserved.
|
2
|
+
|
3
|
+
var assert = require('assert-plus');
|
4
|
+
var crypto = require('crypto');
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
///--- Exported API
|
9
|
+
|
10
|
+
module.exports = {
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Simply wraps up the node crypto operations for you, and returns
|
14
|
+
* true or false. You are expected to pass in an object that was
|
15
|
+
* returned from `parse()`.
|
16
|
+
*
|
17
|
+
* @param {Object} parsedSignature the object you got from `parse`.
|
18
|
+
* @param {String} key either an RSA private key PEM or HMAC secret.
|
19
|
+
* @return {Boolean} true if valid, false otherwise.
|
20
|
+
* @throws {TypeError} if you pass in bad arguments.
|
21
|
+
*/
|
22
|
+
verifySignature: function verifySignature(parsedSignature, key) {
|
23
|
+
assert.object(parsedSignature, 'parsedSignature');
|
24
|
+
assert.string(key, 'key');
|
25
|
+
|
26
|
+
var alg = parsedSignature.algorithm.match(/(HMAC|RSA|DSA)-(\w+)/);
|
27
|
+
if (!alg || alg.length !== 3)
|
28
|
+
throw new TypeError('parsedSignature: unsupported algorithm ' +
|
29
|
+
parsedSignature.algorithm);
|
30
|
+
|
31
|
+
if (alg[1] === 'HMAC') {
|
32
|
+
var hmac = crypto.createHmac(alg[2].toUpperCase(), key);
|
33
|
+
hmac.update(parsedSignature.signingString);
|
34
|
+
return (hmac.digest('base64') === parsedSignature.params.signature);
|
35
|
+
} else {
|
36
|
+
var verify = crypto.createVerify(alg[0]);
|
37
|
+
verify.update(parsedSignature.signingString);
|
38
|
+
return verify.verify(key, parsedSignature.params.signature, 'base64');
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2011 Mark Cavage, All rights reserved.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE
|
@@ -0,0 +1,50 @@
|
|
1
|
+
node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS.
|
2
|
+
Currently BER encoding is supported; at some point I'll likely have to do DER.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
|
6
|
+
Mostly, if you're *actually* needing to read and write ASN.1, you probably don't
|
7
|
+
need this readme to explain what and why. If you have no idea what ASN.1 is,
|
8
|
+
see this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc
|
9
|
+
|
10
|
+
The source is pretty much self-explanatory, and has read/write methods for the
|
11
|
+
common types out there.
|
12
|
+
|
13
|
+
### Decoding
|
14
|
+
|
15
|
+
The following reads an ASN.1 sequence with a boolean.
|
16
|
+
|
17
|
+
var Ber = require('asn1').Ber;
|
18
|
+
|
19
|
+
var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));
|
20
|
+
|
21
|
+
reader.readSequence();
|
22
|
+
console.log('Sequence len: ' + reader.length);
|
23
|
+
if (reader.peek() === Ber.Boolean)
|
24
|
+
console.log(reader.readBoolean());
|
25
|
+
|
26
|
+
### Encoding
|
27
|
+
|
28
|
+
The following generates the same payload as above.
|
29
|
+
|
30
|
+
var Ber = require('asn1').Ber;
|
31
|
+
|
32
|
+
var writer = new Ber.Writer();
|
33
|
+
|
34
|
+
writer.startSequence();
|
35
|
+
writer.writeBoolean(true);
|
36
|
+
writer.endSequence();
|
37
|
+
|
38
|
+
console.log(writer.buffer);
|
39
|
+
|
40
|
+
## Installation
|
41
|
+
|
42
|
+
npm install asn1
|
43
|
+
|
44
|
+
## License
|
45
|
+
|
46
|
+
MIT.
|
47
|
+
|
48
|
+
## Bugs
|
49
|
+
|
50
|
+
See <https://github.com/mcavage/node-asn1/issues>.
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
|
2
|
+
|
3
|
+
var errors = require('./errors');
|
4
|
+
var types = require('./types');
|
5
|
+
|
6
|
+
var Reader = require('./reader');
|
7
|
+
var Writer = require('./writer');
|
8
|
+
|
9
|
+
|
10
|
+
///--- Exports
|
11
|
+
|
12
|
+
module.exports = {
|
13
|
+
|
14
|
+
Reader: Reader,
|
15
|
+
|
16
|
+
Writer: Writer
|
17
|
+
|
18
|
+
};
|
19
|
+
|
20
|
+
for (var t in types) {
|
21
|
+
if (types.hasOwnProperty(t))
|
22
|
+
module.exports[t] = types[t];
|
23
|
+
}
|
24
|
+
for (var e in errors) {
|
25
|
+
if (errors.hasOwnProperty(e))
|
26
|
+
module.exports[e] = errors[e];
|
27
|
+
}
|