First release
This commit is contained in:
commit
fa6c85266e
2339 changed files with 761050 additions and 0 deletions
18
node_modules/pkcs7/CHANGELOG.md
generated
vendored
Normal file
18
node_modules/pkcs7/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
<a name="1.0.4"></a>
|
||||
## [1.0.4](https://github.com/brightcove/pkcs7/compare/v1.0.3...v1.0.4) (2020-09-09)
|
||||
|
||||
### Chores
|
||||
|
||||
* **package:** remove postcss-cli ([aed7b3a](https://github.com/brightcove/pkcs7/commit/aed7b3a))
|
||||
|
||||
<a name="1.0.3"></a>
|
||||
## [1.0.3](https://github.com/brightcove/pkcs7/compare/v1.0.2...v1.0.3) (2019-08-21)
|
||||
|
||||
### Chores
|
||||
|
||||
* generator 7.7.3 update ([#13](https://github.com/brightcove/pkcs7/issues/13)) ([da31c29](https://github.com/brightcove/pkcs7/commit/da31c29))
|
||||
* remove pkg.engines field ([#9](https://github.com/brightcove/pkcs7/issues/9)) ([17a1d1d](https://github.com/brightcove/pkcs7/commit/17a1d1d))
|
||||
* update npm-run-all to fix security issue ([#11](https://github.com/brightcove/pkcs7/issues/11)) ([a07d6d7](https://github.com/brightcove/pkcs7/commit/a07d6d7))
|
||||
* Update to generator v7 standards ([#10](https://github.com/brightcove/pkcs7/issues/10)) ([e075fe6](https://github.com/brightcove/pkcs7/commit/e075fe6))
|
||||
* update videojs-generator-verify to fix security issue ([c1e6bd7](https://github.com/brightcove/pkcs7/commit/c1e6bd7))
|
||||
|
30
node_modules/pkcs7/CONTRIBUTING.md
generated
vendored
Normal file
30
node_modules/pkcs7/CONTRIBUTING.md
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
# CONTRIBUTING
|
||||
|
||||
We welcome contributions from everyone!
|
||||
|
||||
## Getting Started
|
||||
|
||||
Make sure you have Node.js 4.8 or higher and npm installed.
|
||||
|
||||
1. Fork this repository and clone your fork
|
||||
1. Install dependencies: `npm install`
|
||||
1. Run a development server: `npm start`
|
||||
|
||||
### Making Changes
|
||||
|
||||
Refer to the [video.js plugin conventions][conventions] for more detail on best practices and tooling for video.js plugin authorship.
|
||||
|
||||
When you've made your changes, push your commit(s) to your fork and issue a pull request against the original repository.
|
||||
|
||||
### Running Tests
|
||||
|
||||
Testing is a crucial part of any software project. For all but the most trivial changes (typos, etc) test cases are expected. Tests are run in actual browsers using [Karma][karma].
|
||||
|
||||
- In all available and supported browsers: `npm test`
|
||||
- In a specific browser: `npm run test:chrome`, `npm run test:firefox`, etc.
|
||||
- While development server is running (`npm start`), navigate to [`http://localhost:9999/test/`][local]
|
||||
|
||||
|
||||
[karma]: http://karma-runner.github.io/
|
||||
[local]: http://localhost:9999/test/
|
||||
[conventions]: https://github.com/videojs/generator-videojs-plugin/blob/master/docs/conventions.md
|
13
node_modules/pkcs7/LICENSE
generated
vendored
Normal file
13
node_modules/pkcs7/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
Copyright Brightcove Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
75
node_modules/pkcs7/README.md
generated
vendored
Normal file
75
node_modules/pkcs7/README.md
generated
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
# pkcs7
|
||||
|
||||
[](https://travis-ci.org/brightcove/pkcs7)
|
||||
[](https://greenkeeper.io/)
|
||||
[](http://slack.videojs.com)
|
||||
|
||||
[](https://nodei.co/npm/pkcs7/)
|
||||
|
||||
> Add and remove pkcs7-style padding.
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
|
||||
|
||||
- [Getting Started](#getting-started)
|
||||
- [Documentation](#documentation)
|
||||
- [Examples](#examples)
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
## Getting Started
|
||||
|
||||
Install the module with: `npm install pkcs7`
|
||||
|
||||
```js
|
||||
var pkcs7 = require('pkcs7'), encrypted;
|
||||
// pad a buffer!
|
||||
enctcrypted = encrypt(pkcs7.pad(buffer));
|
||||
|
||||
// later, you can unpad it:
|
||||
console.log('the secret is out! ' + pkcs7.unpad(decrypt(encrypted)));
|
||||
```
|
||||
|
||||
Install with cli command
|
||||
|
||||
```sh
|
||||
$ npm install -g pkcs7
|
||||
$ pkcs7 --help
|
||||
$ pkcs7 --version
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
PKCS#7 padding a really simple transformation some crytographic algorithms use to ensure the number of input bytes is a multiple of some constant. Here's how it works:
|
||||
|
||||
01 -- if lth mod k = k-1
|
||||
02 02 -- if lth mod k = k-2
|
||||
.
|
||||
.
|
||||
.
|
||||
k k ... k k -- if lth mod k = 0
|
||||
|
||||
`k` is the constant value the encryption algorithm wants your input to be a multiple of. This project assumes `k` is *always* sixteen. Not much to it, right? If reading specs is your thing, check out [RFC 5652](http://tools.ietf.org/html/rfc5652).
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
You can run pkcs7 from the command line:
|
||||
|
||||
```shell
|
||||
# pad a string generated by echo and the hex dump the result
|
||||
echo -n "0123456789AB" | pkcs7 | xxd
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com).
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Copyright (c) 2014 Brightcove
|
||||
Licensed under the Apache-2 license.
|
46
node_modules/pkcs7/bin/cli.js
generated
vendored
Normal file
46
node_modules/pkcs7/bin/cli.js
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
#! /usr/bin/env node
|
||||
|
||||
'use strict';
|
||||
|
||||
const pkcs7 = require('../dist/pkcs7.cjs.js');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const userArgs = process.argv;
|
||||
|
||||
if (userArgs.indexOf('-h') !== -1 || userArgs.indexOf('--help') !== -1) {
|
||||
// eslint-disable-next-line
|
||||
console.log('usage: pkcs7');
|
||||
// eslint-disable-next-line
|
||||
console.log('pkcs7 expects input on stdin and outputs to stdout');
|
||||
process.exit();
|
||||
}
|
||||
|
||||
if (userArgs.indexOf('-v') !== -1 || userArgs.indexOf('--version') !== -1) {
|
||||
// eslint-disable-next-line
|
||||
console.log(JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json'))).version);
|
||||
process.exit();
|
||||
}
|
||||
|
||||
const data = [];
|
||||
|
||||
process.stdin.on('readable', function() {
|
||||
const chunk = process.stdin.read();
|
||||
|
||||
if (chunk !== null) {
|
||||
data.push(chunk);
|
||||
}
|
||||
});
|
||||
|
||||
process.stdin.on('end', function() {
|
||||
const buffer = Buffer.concat(data);
|
||||
const bytes = new Uint8Array(buffer.length);
|
||||
let i = buffer.length;
|
||||
|
||||
while (i--) {
|
||||
bytes[i] = buffer[i];
|
||||
}
|
||||
|
||||
// output the padded input
|
||||
process.stdout.write(new Buffer(pkcs7.pad(bytes)));
|
||||
});
|
47
node_modules/pkcs7/dist/pkcs7.cjs.js
generated
vendored
Normal file
47
node_modules/pkcs7/dist/pkcs7.cjs.js
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
/*
|
||||
* pkcs7.pad
|
||||
* https://github.com/brightcove/pkcs7
|
||||
*
|
||||
* Copyright (c) 2014 Brightcove
|
||||
* Licensed under the apache2 license.
|
||||
*/
|
||||
var PADDING;
|
||||
/**
|
||||
* Returns a new Uint8Array that is padded with PKCS#7 padding.
|
||||
*
|
||||
* @param plaintext {Uint8Array} the input bytes before encryption
|
||||
* @return {Uint8Array} the padded bytes
|
||||
* @see http://tools.ietf.org/html/rfc5652
|
||||
*/
|
||||
|
||||
function pad(plaintext) {
|
||||
var padding = PADDING[plaintext.byteLength % 16 || 0];
|
||||
var result = new Uint8Array(plaintext.byteLength + padding.length);
|
||||
result.set(plaintext);
|
||||
result.set(padding, plaintext.byteLength);
|
||||
return result;
|
||||
} // pre-define the padding values
|
||||
|
||||
PADDING = [[16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16], [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15], [14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14], [13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10], [9, 9, 9, 9, 9, 9, 9, 9, 9], [8, 8, 8, 8, 8, 8, 8, 8], [7, 7, 7, 7, 7, 7, 7], [6, 6, 6, 6, 6, 6], [5, 5, 5, 5, 5], [4, 4, 4, 4], [3, 3, 3], [2, 2], [1]];
|
||||
|
||||
/**
|
||||
* Returns the subarray of a Uint8Array without PKCS#7 padding.
|
||||
*
|
||||
* @param padded {Uint8Array} unencrypted bytes that have been padded
|
||||
* @return {Uint8Array} the unpadded bytes
|
||||
* @see http://tools.ietf.org/html/rfc5652
|
||||
*/
|
||||
function unpad(padded) {
|
||||
return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
|
||||
}
|
||||
|
||||
var version = "1.0.4";
|
||||
|
||||
exports.VERSION = version;
|
||||
exports.pad = pad;
|
||||
exports.unpad = unpad;
|
41
node_modules/pkcs7/dist/pkcs7.es.js
generated
vendored
Normal file
41
node_modules/pkcs7/dist/pkcs7.es.js
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
|
||||
/*
|
||||
* pkcs7.pad
|
||||
* https://github.com/brightcove/pkcs7
|
||||
*
|
||||
* Copyright (c) 2014 Brightcove
|
||||
* Licensed under the apache2 license.
|
||||
*/
|
||||
var PADDING;
|
||||
/**
|
||||
* Returns a new Uint8Array that is padded with PKCS#7 padding.
|
||||
*
|
||||
* @param plaintext {Uint8Array} the input bytes before encryption
|
||||
* @return {Uint8Array} the padded bytes
|
||||
* @see http://tools.ietf.org/html/rfc5652
|
||||
*/
|
||||
|
||||
function pad(plaintext) {
|
||||
var padding = PADDING[plaintext.byteLength % 16 || 0];
|
||||
var result = new Uint8Array(plaintext.byteLength + padding.length);
|
||||
result.set(plaintext);
|
||||
result.set(padding, plaintext.byteLength);
|
||||
return result;
|
||||
} // pre-define the padding values
|
||||
|
||||
PADDING = [[16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16], [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15], [14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14], [13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10], [9, 9, 9, 9, 9, 9, 9, 9, 9], [8, 8, 8, 8, 8, 8, 8, 8], [7, 7, 7, 7, 7, 7, 7], [6, 6, 6, 6, 6, 6], [5, 5, 5, 5, 5], [4, 4, 4, 4], [3, 3, 3], [2, 2], [1]];
|
||||
|
||||
/**
|
||||
* Returns the subarray of a Uint8Array without PKCS#7 padding.
|
||||
*
|
||||
* @param padded {Uint8Array} unencrypted bytes that have been padded
|
||||
* @return {Uint8Array} the unpadded bytes
|
||||
* @see http://tools.ietf.org/html/rfc5652
|
||||
*/
|
||||
function unpad(padded) {
|
||||
return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
|
||||
}
|
||||
|
||||
var version = "1.0.4";
|
||||
|
||||
export { version as VERSION, pad, unpad };
|
53
node_modules/pkcs7/dist/pkcs7.js
generated
vendored
Normal file
53
node_modules/pkcs7/dist/pkcs7.js
generated
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = global || self, factory(global.pkcs7 = {}));
|
||||
}(this, function (exports) { 'use strict';
|
||||
|
||||
/*
|
||||
* pkcs7.pad
|
||||
* https://github.com/brightcove/pkcs7
|
||||
*
|
||||
* Copyright (c) 2014 Brightcove
|
||||
* Licensed under the apache2 license.
|
||||
*/
|
||||
var PADDING;
|
||||
/**
|
||||
* Returns a new Uint8Array that is padded with PKCS#7 padding.
|
||||
*
|
||||
* @param plaintext {Uint8Array} the input bytes before encryption
|
||||
* @return {Uint8Array} the padded bytes
|
||||
* @see http://tools.ietf.org/html/rfc5652
|
||||
*/
|
||||
|
||||
function pad(plaintext) {
|
||||
var padding = PADDING[plaintext.byteLength % 16 || 0];
|
||||
var result = new Uint8Array(plaintext.byteLength + padding.length);
|
||||
result.set(plaintext);
|
||||
result.set(padding, plaintext.byteLength);
|
||||
return result;
|
||||
} // pre-define the padding values
|
||||
|
||||
PADDING = [[16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16], [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15], [14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14], [13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10], [9, 9, 9, 9, 9, 9, 9, 9, 9], [8, 8, 8, 8, 8, 8, 8, 8], [7, 7, 7, 7, 7, 7, 7], [6, 6, 6, 6, 6, 6], [5, 5, 5, 5, 5], [4, 4, 4, 4], [3, 3, 3], [2, 2], [1]];
|
||||
|
||||
/**
|
||||
* Returns the subarray of a Uint8Array without PKCS#7 padding.
|
||||
*
|
||||
* @param padded {Uint8Array} unencrypted bytes that have been padded
|
||||
* @return {Uint8Array} the unpadded bytes
|
||||
* @see http://tools.ietf.org/html/rfc5652
|
||||
*/
|
||||
function unpad(padded) {
|
||||
return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
|
||||
}
|
||||
|
||||
var version = "1.0.4";
|
||||
|
||||
exports.VERSION = version;
|
||||
exports.pad = pad;
|
||||
exports.unpad = unpad;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
}));
|
2
node_modules/pkcs7/dist/pkcs7.min.js
generated
vendored
Normal file
2
node_modules/pkcs7/dist/pkcs7.min.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).pkcs7={})}(this,function(e){"use strict";var t;t=[[16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16],[15,15,15,15,15,15,15,15,15,15,15,15,15,15,15],[14,14,14,14,14,14,14,14,14,14,14,14,14,14],[13,13,13,13,13,13,13,13,13,13,13,13,13],[12,12,12,12,12,12,12,12,12,12,12,12],[11,11,11,11,11,11,11,11,11,11,11],[10,10,10,10,10,10,10,10,10,10],[9,9,9,9,9,9,9,9,9],[8,8,8,8,8,8,8,8],[7,7,7,7,7,7,7],[6,6,6,6,6,6],[5,5,5,5,5],[4,4,4,4],[3,3,3],[2,2],[1]];e.VERSION="1.0.4",e.pad=function(e){var n=t[e.byteLength%16||0],r=new Uint8Array(e.byteLength+n.length);return r.set(e),r.set(n,e.byteLength),r},e.unpad=function(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])},Object.defineProperty(e,"__esModule",{value:!0})});
|
36
node_modules/pkcs7/dist/pkcs7.pad.js
generated
vendored
Normal file
36
node_modules/pkcs7/dist/pkcs7.pad.js
generated
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = global || self, (global.pkcs7 = global.pkcs7 || {}, global.pkcs7.pad = factory()));
|
||||
}(this, function () { 'use strict';
|
||||
|
||||
/*
|
||||
* pkcs7.pad
|
||||
* https://github.com/brightcove/pkcs7
|
||||
*
|
||||
* Copyright (c) 2014 Brightcove
|
||||
* Licensed under the apache2 license.
|
||||
*/
|
||||
var PADDING;
|
||||
/**
|
||||
* Returns a new Uint8Array that is padded with PKCS#7 padding.
|
||||
*
|
||||
* @param plaintext {Uint8Array} the input bytes before encryption
|
||||
* @return {Uint8Array} the padded bytes
|
||||
* @see http://tools.ietf.org/html/rfc5652
|
||||
*/
|
||||
|
||||
function pad(plaintext) {
|
||||
var padding = PADDING[plaintext.byteLength % 16 || 0];
|
||||
var result = new Uint8Array(plaintext.byteLength + padding.length);
|
||||
result.set(plaintext);
|
||||
result.set(padding, plaintext.byteLength);
|
||||
return result;
|
||||
} // pre-define the padding values
|
||||
|
||||
PADDING = [[16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16], [15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15], [14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14], [13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12], [11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11], [10, 10, 10, 10, 10, 10, 10, 10, 10, 10], [9, 9, 9, 9, 9, 9, 9, 9, 9], [8, 8, 8, 8, 8, 8, 8, 8], [7, 7, 7, 7, 7, 7, 7], [6, 6, 6, 6, 6, 6], [5, 5, 5, 5, 5], [4, 4, 4, 4], [3, 3, 3], [2, 2], [1]];
|
||||
|
||||
return pad;
|
||||
|
||||
}));
|
2
node_modules/pkcs7/dist/pkcs7.pad.min.js
generated
vendored
Normal file
2
node_modules/pkcs7/dist/pkcs7.pad.min.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e=e||self).pkcs7=e.pkcs7||{},e.pkcs7.pad=t())}(this,function(){"use strict";var e;return e=[[16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16],[15,15,15,15,15,15,15,15,15,15,15,15,15,15,15],[14,14,14,14,14,14,14,14,14,14,14,14,14,14],[13,13,13,13,13,13,13,13,13,13,13,13,13],[12,12,12,12,12,12,12,12,12,12,12,12],[11,11,11,11,11,11,11,11,11,11,11],[10,10,10,10,10,10,10,10,10,10],[9,9,9,9,9,9,9,9,9],[8,8,8,8,8,8,8,8],[7,7,7,7,7,7,7],[6,6,6,6,6,6],[5,5,5,5,5],[4,4,4,4],[3,3,3],[2,2],[1]],function(t){var n=e[t.byteLength%16||0],f=new Uint8Array(t.byteLength+n.length);return f.set(t),f.set(n,t.byteLength),f}});
|
21
node_modules/pkcs7/dist/pkcs7.unpad.js
generated
vendored
Normal file
21
node_modules/pkcs7/dist/pkcs7.unpad.js
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = global || self, (global.pkcs7 = global.pkcs7 || {}, global.pkcs7.unpad = factory()));
|
||||
}(this, function () { 'use strict';
|
||||
|
||||
/**
|
||||
* Returns the subarray of a Uint8Array without PKCS#7 padding.
|
||||
*
|
||||
* @param padded {Uint8Array} unencrypted bytes that have been padded
|
||||
* @return {Uint8Array} the unpadded bytes
|
||||
* @see http://tools.ietf.org/html/rfc5652
|
||||
*/
|
||||
function unpad(padded) {
|
||||
return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
|
||||
}
|
||||
|
||||
return unpad;
|
||||
|
||||
}));
|
2
node_modules/pkcs7/dist/pkcs7.unpad.min.js
generated
vendored
Normal file
2
node_modules/pkcs7/dist/pkcs7.unpad.min.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e=e||self).pkcs7=e.pkcs7||{},e.pkcs7.unpad=t())}(this,function(){"use strict";return function(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}});
|
125
node_modules/pkcs7/package.json
generated
vendored
Normal file
125
node_modules/pkcs7/package.json
generated
vendored
Normal file
|
@ -0,0 +1,125 @@
|
|||
{
|
||||
"_from": "pkcs7@^1.0.4",
|
||||
"_id": "pkcs7@1.0.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-afRERtHn54AlwaF2/+LFszyAANTCggGilmcmILUzEjvs3XgFZT+xE6+QWQcAGmu4xajy+Xtj7acLOPdx5/eXWQ==",
|
||||
"_location": "/pkcs7",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "pkcs7@^1.0.4",
|
||||
"name": "pkcs7",
|
||||
"escapedName": "pkcs7",
|
||||
"rawSpec": "^1.0.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/aes-decrypter"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/pkcs7/-/pkcs7-1.0.4.tgz",
|
||||
"_shasum": "6090b9e71160dabf69209d719cbafa538b00a1cb",
|
||||
"_spec": "pkcs7@^1.0.4",
|
||||
"_where": "F:\\Documents\\websites\\BMM\\node_modules\\aes-decrypter",
|
||||
"author": {
|
||||
"name": "Brightcove"
|
||||
},
|
||||
"bin": {
|
||||
"pkcs7": "bin/cli.js"
|
||||
},
|
||||
"browserslist": [
|
||||
"defaults",
|
||||
"ie 11"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/brightcove/pkcs7/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.5.5"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Add and remove pkcs7-style padding.",
|
||||
"devDependencies": {
|
||||
"@videojs/generator-helpers": "~1.2.0",
|
||||
"karma": "^4.0.0",
|
||||
"rollup": "^1.19.4",
|
||||
"sinon": "^7.2.2",
|
||||
"videojs-generate-karma-config": "~5.3.1",
|
||||
"videojs-generate-rollup-config": "~5.0.0",
|
||||
"videojs-generator-verify": "~2.0.0",
|
||||
"videojs-standard": "^8.0.3"
|
||||
},
|
||||
"files": [
|
||||
"CONTRIBUTING.md",
|
||||
"dist/",
|
||||
"docs/",
|
||||
"index.html",
|
||||
"scripts/",
|
||||
"src/",
|
||||
"test/",
|
||||
"bin"
|
||||
],
|
||||
"generator-videojs-plugin": {
|
||||
"version": "7.7.3"
|
||||
},
|
||||
"homepage": "https://github.com/brightcove/pkcs7",
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"keywords": [
|
||||
"pkcs7",
|
||||
"pkcs7 encrypt decrypt padding pkcs",
|
||||
"videojs",
|
||||
"videojs-plugin"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"vjsstandard --fix",
|
||||
"git add"
|
||||
],
|
||||
"README.md": [
|
||||
"doctoc --notitle",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"main": "dist/pkcs7.cjs.js",
|
||||
"module": "dist/pkcs7.es.js",
|
||||
"name": "pkcs7",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/brightcove/pkcs7.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm-run-all -s clean -p build:*",
|
||||
"build-prod": "cross-env-shell NO_TEST_BUNDLE=1 'npm run build'",
|
||||
"build-test": "cross-env-shell TEST_BUNDLE_ONLY=1 'npm run build'",
|
||||
"build:js": "rollup -c scripts/rollup.config.js",
|
||||
"clean": "shx rm -rf ./dist ./test/dist && shx mkdir -p ./dist ./test/dist",
|
||||
"lint": "vjsstandard",
|
||||
"posttest": "shx cat test/dist/coverage/text.txt",
|
||||
"prepublishOnly": "npm-run-all build-prod && vjsverify --verbose",
|
||||
"preversion": "npm test",
|
||||
"server": "karma start scripts/karma.conf.js --singleRun=false --auto-watch",
|
||||
"start": "npm-run-all -p server watch",
|
||||
"test": "npm-run-all lint build-test -p test:*",
|
||||
"test:browser": "karma start scripts/karma.conf.js",
|
||||
"test:node": "qunit test/dist/bundle.js",
|
||||
"update-changelog": "conventional-changelog -p videojs -i CHANGELOG.md -s",
|
||||
"version": "is-prerelease || npm run update-changelog && git add CHANGELOG.md",
|
||||
"watch": "npm-run-all -p watch:*",
|
||||
"watch:js": "npm run build:js -- -w"
|
||||
},
|
||||
"version": "1.0.4",
|
||||
"vjsstandard": {
|
||||
"ignore": [
|
||||
"dist",
|
||||
"docs",
|
||||
"test/dist"
|
||||
]
|
||||
}
|
||||
}
|
12
node_modules/pkcs7/scripts/karma.conf.js
generated
vendored
Normal file
12
node_modules/pkcs7/scripts/karma.conf.js
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
const generate = require('videojs-generate-karma-config');
|
||||
|
||||
module.exports = function(config) {
|
||||
|
||||
// see https://github.com/videojs/videojs-generate-karma-config
|
||||
// for options
|
||||
const options = {};
|
||||
|
||||
config = generate(config, options);
|
||||
|
||||
// any other custom stuff not supported by options here!
|
||||
};
|
38
node_modules/pkcs7/scripts/rollup.config.js
generated
vendored
Normal file
38
node_modules/pkcs7/scripts/rollup.config.js
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
const generate = require('videojs-generate-rollup-config');
|
||||
|
||||
// see https://github.com/videojs/videojs-generate-rollup-config
|
||||
// for options
|
||||
const options = {input: 'src/pkcs7.js'};
|
||||
const config = generate(options);
|
||||
|
||||
// Add additonal builds/customization here!
|
||||
|
||||
config.builds = Object.assign(config.builds, {
|
||||
pad: config.makeBuild('browser', {
|
||||
input: 'src/pad.js',
|
||||
output: [{
|
||||
name: 'pkcs7.pad',
|
||||
file: 'dist/pkcs7.pad.js',
|
||||
format: 'umd'
|
||||
}, {
|
||||
name: 'pkcs7.pad',
|
||||
file: 'dist/pkcs7.pad.min.js',
|
||||
format: 'umd'
|
||||
}]
|
||||
}),
|
||||
unpad: config.makeBuild('browser', {
|
||||
input: 'src/unpad.js',
|
||||
output: [{
|
||||
name: 'pkcs7.unpad',
|
||||
file: 'dist/pkcs7.unpad.js',
|
||||
format: 'umd'
|
||||
}, {
|
||||
name: 'pkcs7.unpad',
|
||||
file: 'dist/pkcs7.unpad.min.js',
|
||||
format: 'umd'
|
||||
}]
|
||||
})
|
||||
});
|
||||
|
||||
// export the builds to rollup
|
||||
export default Object.values(config.builds);
|
85
node_modules/pkcs7/src/pad.js
generated
vendored
Normal file
85
node_modules/pkcs7/src/pad.js
generated
vendored
Normal file
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
* pkcs7.pad
|
||||
* https://github.com/brightcove/pkcs7
|
||||
*
|
||||
* Copyright (c) 2014 Brightcove
|
||||
* Licensed under the apache2 license.
|
||||
*/
|
||||
|
||||
let PADDING;
|
||||
|
||||
/**
|
||||
* Returns a new Uint8Array that is padded with PKCS#7 padding.
|
||||
*
|
||||
* @param plaintext {Uint8Array} the input bytes before encryption
|
||||
* @return {Uint8Array} the padded bytes
|
||||
* @see http://tools.ietf.org/html/rfc5652
|
||||
*/
|
||||
export default function pad(plaintext) {
|
||||
const padding = PADDING[(plaintext.byteLength % 16) || 0];
|
||||
const result = new Uint8Array(plaintext.byteLength + padding.length);
|
||||
|
||||
result.set(plaintext);
|
||||
result.set(padding, plaintext.byteLength);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// pre-define the padding values
|
||||
PADDING = [
|
||||
[16, 16, 16, 16,
|
||||
16, 16, 16, 16,
|
||||
16, 16, 16, 16,
|
||||
16, 16, 16, 16],
|
||||
|
||||
[15, 15, 15, 15,
|
||||
15, 15, 15, 15,
|
||||
15, 15, 15, 15,
|
||||
15, 15, 15],
|
||||
|
||||
[14, 14, 14, 14,
|
||||
14, 14, 14, 14,
|
||||
14, 14, 14, 14,
|
||||
14, 14],
|
||||
|
||||
[13, 13, 13, 13,
|
||||
13, 13, 13, 13,
|
||||
13, 13, 13, 13,
|
||||
13],
|
||||
|
||||
[12, 12, 12, 12,
|
||||
12, 12, 12, 12,
|
||||
12, 12, 12, 12],
|
||||
|
||||
[11, 11, 11, 11,
|
||||
11, 11, 11, 11,
|
||||
11, 11, 11],
|
||||
|
||||
[10, 10, 10, 10,
|
||||
10, 10, 10, 10,
|
||||
10, 10],
|
||||
|
||||
[9, 9, 9, 9,
|
||||
9, 9, 9, 9,
|
||||
9],
|
||||
|
||||
[8, 8, 8, 8,
|
||||
8, 8, 8, 8],
|
||||
|
||||
[7, 7, 7, 7,
|
||||
7, 7, 7],
|
||||
|
||||
[6, 6, 6, 6,
|
||||
6, 6],
|
||||
|
||||
[5, 5, 5, 5,
|
||||
5],
|
||||
|
||||
[4, 4, 4, 4],
|
||||
|
||||
[3, 3, 3],
|
||||
|
||||
[2, 2],
|
||||
|
||||
[1]
|
||||
];
|
5
node_modules/pkcs7/src/pkcs7.js
generated
vendored
Normal file
5
node_modules/pkcs7/src/pkcs7.js
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
import pad from './pad.js';
|
||||
import unpad from './unpad.js';
|
||||
import {version as VERSION} from '../package.json';
|
||||
|
||||
export { pad, unpad, VERSION };
|
10
node_modules/pkcs7/src/unpad.js
generated
vendored
Normal file
10
node_modules/pkcs7/src/unpad.js
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* Returns the subarray of a Uint8Array without PKCS#7 padding.
|
||||
*
|
||||
* @param padded {Uint8Array} unencrypted bytes that have been padded
|
||||
* @return {Uint8Array} the unpadded bytes
|
||||
* @see http://tools.ietf.org/html/rfc5652
|
||||
*/
|
||||
export default function unpad(padded) {
|
||||
return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
|
||||
}
|
64
node_modules/pkcs7/test/pkcs7.test.js
generated
vendored
Normal file
64
node_modules/pkcs7/test/pkcs7.test.js
generated
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
/* eslint-disable object-shorthand */
|
||||
|
||||
import {pad, unpad} from '../src/pkcs7.js';
|
||||
import QUnit from 'qunit';
|
||||
|
||||
const pkcs7 = {pad, unpad};
|
||||
|
||||
QUnit.module('pkcs7');
|
||||
|
||||
QUnit.test('pads empty buffers', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const result = pkcs7.unpad(pkcs7.pad(new Uint8Array([])));
|
||||
|
||||
assert.deepEqual(
|
||||
new Uint8Array(result, result.byteOffset, result.byteLength),
|
||||
new Uint8Array(0),
|
||||
'accepts an empty buffer'
|
||||
);
|
||||
});
|
||||
|
||||
QUnit.test('pads non-empty buffers', function(assert) {
|
||||
|
||||
let i = 16;
|
||||
|
||||
assert.expect(i * 3);
|
||||
|
||||
while (i--) {
|
||||
// build the test buffer
|
||||
const buffer = new Uint8Array(i + 1);
|
||||
let result;
|
||||
|
||||
result = pkcs7.pad(buffer);
|
||||
assert.equal(result.length % 16, 0, 'padded length is a multiple of 16');
|
||||
assert.equal(result.slice(-1)[0], 16 - ((i + 1) % 16), 'appended the correct value');
|
||||
|
||||
result = pkcs7.unpad(result);
|
||||
|
||||
assert.deepEqual(
|
||||
new Uint8Array(result, result.byteOffset, result.byteLength),
|
||||
buffer,
|
||||
'padding is reversible'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.test('works on buffers greater than sixteen bytes', function(assert) {
|
||||
const buffer = new Uint8Array(16 * 3 + 9);
|
||||
|
||||
assert.expect(2);
|
||||
|
||||
assert.equal(
|
||||
pkcs7.pad(buffer).length - buffer.length,
|
||||
16 - 9,
|
||||
'adds the correct amount of padding'
|
||||
);
|
||||
const result = pkcs7.unpad(pkcs7.pad(buffer));
|
||||
|
||||
assert.deepEqual(
|
||||
new Uint8Array(result, result.byteOffset, result.byteLength),
|
||||
buffer,
|
||||
'is reversible'
|
||||
);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue