@parcel/utils 2.7.0 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -81,7 +81,13 @@ parcelRequire.register("iGlOy", function(module, exports) {
81
81
  });
82
82
 
83
83
  parcelRequire.register("ai0Z9", function(module, exports) {
84
-
84
+ /**
85
+ * Node.js module for Forge message digests.
86
+ *
87
+ * @author Dave Longley
88
+ *
89
+ * Copyright 2011-2017 Digital Bazaar, Inc.
90
+ */
85
91
  var $iGlOy = parcelRequire("iGlOy");
86
92
  module.exports = $iGlOy.md = $iGlOy.md || {};
87
93
  $iGlOy.md.algorithms = $iGlOy.md.algorithms || {};
@@ -3078,12 +3084,10 @@ function $6e1ae4ed5b62d1d9$var$parseAsync(str, opts) {
3078
3084
  setImmediate(parseAsyncNext, index, blocksize, resolve, reject);
3079
3085
  });
3080
3086
  function parseAsyncNext(index, blocksize, resolve, reject) {
3081
- if (index >= str.length) {
3082
- try {
3083
- return resolve(parser.finish());
3084
- } catch (err) {
3085
- return reject($ciuZ9(err, str));
3086
- }
3087
+ if (index >= str.length) try {
3088
+ return resolve(parser.finish());
3089
+ } catch (err) {
3090
+ return reject($ciuZ9(err, str));
3087
3091
  }
3088
3092
  try {
3089
3093
  parser.parse(str.slice(index, index + blocksize));
@@ -3406,6 +3410,7 @@ $parcel$export(module.exports, "countLines", () => $fddc9169ba2fd655$export$2e2b
3406
3410
  $parcel$export(module.exports, "generateBuildMetrics", () => $15d4bc8b6fca8c7e$export$2e2bcd8739ae039);
3407
3411
  $parcel$export(module.exports, "generateCertificate", () => $c6cbdbdbaf0fafc1$export$2e2bcd8739ae039);
3408
3412
  $parcel$export(module.exports, "getCertificate", () => $186980c178984fd2$export$2e2bcd8739ae039);
3413
+ $parcel$export(module.exports, "getModuleParts", () => $313980afb666b13e$export$2e2bcd8739ae039);
3409
3414
  $parcel$export(module.exports, "getRootDir", () => $275c1a71c92a4142$export$2e2bcd8739ae039);
3410
3415
  $parcel$export(module.exports, "isDirectoryInside", () => $ea105385370dfccd$export$2e2bcd8739ae039);
3411
3416
  $parcel$export(module.exports, "isURL", () => $f7d48e99e9c9e3b2$export$2e2bcd8739ae039);
@@ -3578,22 +3583,50 @@ async function $15d4bc8b6fca8c7e$export$2e2bcd8739ae039(bundles, fs, projectRoot
3578
3583
 
3579
3584
 
3580
3585
  var $99e85628b30fe009$exports = {};
3581
-
3582
3586
  /**
3583
3587
  * Node.js module for Forge.
3584
3588
  *
3585
3589
  * @author Dave Longley
3586
3590
  *
3587
3591
  * Copyright 2011-2016 Digital Bazaar, Inc.
3588
- */ $99e85628b30fe009$exports = (parcelRequire("iGlOy"));
3592
+ */
3593
+ $99e85628b30fe009$exports = (parcelRequire("iGlOy"));
3589
3594
  var $ca9d5cba0afae339$exports = {};
3590
-
3595
+ /**
3596
+ * Advanced Encryption Standard (AES) implementation.
3597
+ *
3598
+ * This implementation is based on the public domain library 'jscrypto' which
3599
+ * was written by:
3600
+ *
3601
+ * Emily Stark (estark@stanford.edu)
3602
+ * Mike Hamburg (mhamburg@stanford.edu)
3603
+ * Dan Boneh (dabo@cs.stanford.edu)
3604
+ *
3605
+ * Parts of this code are based on the OpenSSL implementation of AES:
3606
+ * http://www.openssl.org
3607
+ *
3608
+ * @author Dave Longley
3609
+ *
3610
+ * Copyright (c) 2010-2014 Digital Bazaar, Inc.
3611
+ */
3591
3612
  var $iGlOy = parcelRequire("iGlOy");
3592
3613
  var $871289bd32ea5f15$exports = {};
3593
-
3614
+ /**
3615
+ * Cipher base API.
3616
+ *
3617
+ * @author Dave Longley
3618
+ *
3619
+ * Copyright (c) 2010-2014 Digital Bazaar, Inc.
3620
+ */
3594
3621
  var $iGlOy = parcelRequire("iGlOy");
3595
3622
  var $4143f576ffbec226$exports = {};
3596
-
3623
+ /**
3624
+ * Utility functions for web applications.
3625
+ *
3626
+ * @author Dave Longley
3627
+ *
3628
+ * Copyright (c) 2010-2018 Digital Bazaar, Inc.
3629
+ */
3597
3630
  var $iGlOy = parcelRequire("iGlOy");
3598
3631
  var $53abc20733f4b0dc$exports = {};
3599
3632
  /**
@@ -5624,7 +5657,7 @@ $4143f576ffbec226$var$util.text = {
5624
5657
  case "s":
5625
5658
  case "o":
5626
5659
  // check if enough arguments were given
5627
- if (argi < arguments.length) parts.push(arguments[(argi++) + 1]);
5660
+ if (argi < arguments.length) parts.push(arguments[argi++ + 1]);
5628
5661
  else parts.push("<?>");
5629
5662
  break;
5630
5663
  // FIXME: do proper formating for numbers, etc
@@ -6073,7 +6106,13 @@ var $871289bd32ea5f15$var$BlockCipher = $iGlOy.cipher.BlockCipher = function(opt
6073
6106
 
6074
6107
 
6075
6108
  var $8e7d87db09a5396f$exports = {};
6076
-
6109
+ /**
6110
+ * Supported cipher modes.
6111
+ *
6112
+ * @author Dave Longley
6113
+ *
6114
+ * Copyright (c) 2010-2014 Digital Bazaar, Inc.
6115
+ */
6077
6116
  var $iGlOy = parcelRequire("iGlOy");
6078
6117
 
6079
6118
  $iGlOy.cipher = $iGlOy.cipher || {};
@@ -7355,8 +7394,14 @@ var $ca9d5cba0afae339$var$imix; // inverse mix-columns table
7355
7394
  e2 = xtime[e];
7356
7395
  e4 = xtime[e2];
7357
7396
  e8 = xtime[e4];
7358
- me = sx2 << 24 ^ sx << 16 ^ sx << 8 ^ (sx ^ sx2); // 3
7359
- ime = (e2 ^ e4 ^ e8) << 24 ^ (e ^ e8) << 16 ^ (e ^ e4 ^ e8) << 8 ^ (e ^ e2 ^ e8); // B (11)
7397
+ me = sx2 << 24 ^ // 2
7398
+ sx << 16 ^ // 1
7399
+ sx << 8 ^ // 1
7400
+ (sx ^ sx2); // 3
7401
+ ime = (e2 ^ e4 ^ e8) << 24 ^ // E (14)
7402
+ (e ^ e8) << 16 ^ // 9
7403
+ (e ^ e4 ^ e8) << 8 ^ // D (13)
7404
+ (e ^ e2 ^ e8); // B (11)
7360
7405
  // produce each of the mix tables by rotating the 2,1,1,3 value
7361
7406
  for(var n = 0; n < 4; ++n){
7362
7407
  $ca9d5cba0afae339$var$mix[n][e] = me;
@@ -7757,18 +7802,396 @@ var $ca9d5cba0afae339$var$imix; // inverse mix-columns table
7757
7802
 
7758
7803
 
7759
7804
  var $48103dfbc323e2e4$exports = {};
7760
-
7805
+ /**
7806
+ * A Javascript implementation of AES Cipher Suites for TLS.
7807
+ *
7808
+ * @author Dave Longley
7809
+ *
7810
+ * Copyright (c) 2009-2015 Digital Bazaar, Inc.
7811
+ *
7812
+ */
7761
7813
  var $iGlOy = parcelRequire("iGlOy");
7762
7814
 
7763
7815
  var $e55982d45da68b81$exports = {};
7764
-
7816
+ /**
7817
+ * A Javascript implementation of Transport Layer Security (TLS).
7818
+ *
7819
+ * @author Dave Longley
7820
+ *
7821
+ * Copyright (c) 2009-2014 Digital Bazaar, Inc.
7822
+ *
7823
+ * The TLS Handshake Protocol involves the following steps:
7824
+ *
7825
+ * - Exchange hello messages to agree on algorithms, exchange random values,
7826
+ * and check for session resumption.
7827
+ *
7828
+ * - Exchange the necessary cryptographic parameters to allow the client and
7829
+ * server to agree on a premaster secret.
7830
+ *
7831
+ * - Exchange certificates and cryptographic information to allow the client
7832
+ * and server to authenticate themselves.
7833
+ *
7834
+ * - Generate a master secret from the premaster secret and exchanged random
7835
+ * values.
7836
+ *
7837
+ * - Provide security parameters to the record layer.
7838
+ *
7839
+ * - Allow the client and server to verify that their peer has calculated the
7840
+ * same security parameters and that the handshake occurred without tampering
7841
+ * by an attacker.
7842
+ *
7843
+ * Up to 4 different messages may be sent during a key exchange. The server
7844
+ * certificate, the server key exchange, the client certificate, and the
7845
+ * client key exchange.
7846
+ *
7847
+ * A typical handshake (from the client's perspective).
7848
+ *
7849
+ * 1. Client sends ClientHello.
7850
+ * 2. Client receives ServerHello.
7851
+ * 3. Client receives optional Certificate.
7852
+ * 4. Client receives optional ServerKeyExchange.
7853
+ * 5. Client receives ServerHelloDone.
7854
+ * 6. Client sends optional Certificate.
7855
+ * 7. Client sends ClientKeyExchange.
7856
+ * 8. Client sends optional CertificateVerify.
7857
+ * 9. Client sends ChangeCipherSpec.
7858
+ * 10. Client sends Finished.
7859
+ * 11. Client receives ChangeCipherSpec.
7860
+ * 12. Client receives Finished.
7861
+ * 13. Client sends/receives application data.
7862
+ *
7863
+ * To reuse an existing session:
7864
+ *
7865
+ * 1. Client sends ClientHello with session ID for reuse.
7866
+ * 2. Client receives ServerHello with same session ID if reusing.
7867
+ * 3. Client receives ChangeCipherSpec message if reusing.
7868
+ * 4. Client receives Finished.
7869
+ * 5. Client sends ChangeCipherSpec.
7870
+ * 6. Client sends Finished.
7871
+ *
7872
+ * Note: Client ignores HelloRequest if in the middle of a handshake.
7873
+ *
7874
+ * Record Layer:
7875
+ *
7876
+ * The record layer fragments information blocks into TLSPlaintext records
7877
+ * carrying data in chunks of 2^14 bytes or less. Client message boundaries are
7878
+ * not preserved in the record layer (i.e., multiple client messages of the
7879
+ * same ContentType MAY be coalesced into a single TLSPlaintext record, or a
7880
+ * single message MAY be fragmented across several records).
7881
+ *
7882
+ * struct {
7883
+ * uint8 major;
7884
+ * uint8 minor;
7885
+ * } ProtocolVersion;
7886
+ *
7887
+ * struct {
7888
+ * ContentType type;
7889
+ * ProtocolVersion version;
7890
+ * uint16 length;
7891
+ * opaque fragment[TLSPlaintext.length];
7892
+ * } TLSPlaintext;
7893
+ *
7894
+ * type:
7895
+ * The higher-level protocol used to process the enclosed fragment.
7896
+ *
7897
+ * version:
7898
+ * The version of the protocol being employed. TLS Version 1.2 uses version
7899
+ * {3, 3}. TLS Version 1.0 uses version {3, 1}. Note that a client that
7900
+ * supports multiple versions of TLS may not know what version will be
7901
+ * employed before it receives the ServerHello.
7902
+ *
7903
+ * length:
7904
+ * The length (in bytes) of the following TLSPlaintext.fragment. The length
7905
+ * MUST NOT exceed 2^14 = 16384 bytes.
7906
+ *
7907
+ * fragment:
7908
+ * The application data. This data is transparent and treated as an
7909
+ * independent block to be dealt with by the higher-level protocol specified
7910
+ * by the type field.
7911
+ *
7912
+ * Implementations MUST NOT send zero-length fragments of Handshake, Alert, or
7913
+ * ChangeCipherSpec content types. Zero-length fragments of Application data
7914
+ * MAY be sent as they are potentially useful as a traffic analysis
7915
+ * countermeasure.
7916
+ *
7917
+ * Note: Data of different TLS record layer content types MAY be interleaved.
7918
+ * Application data is generally of lower precedence for transmission than
7919
+ * other content types. However, records MUST be delivered to the network in
7920
+ * the same order as they are protected by the record layer. Recipients MUST
7921
+ * receive and process interleaved application layer traffic during handshakes
7922
+ * subsequent to the first one on a connection.
7923
+ *
7924
+ * struct {
7925
+ * ContentType type; // same as TLSPlaintext.type
7926
+ * ProtocolVersion version;// same as TLSPlaintext.version
7927
+ * uint16 length;
7928
+ * opaque fragment[TLSCompressed.length];
7929
+ * } TLSCompressed;
7930
+ *
7931
+ * length:
7932
+ * The length (in bytes) of the following TLSCompressed.fragment.
7933
+ * The length MUST NOT exceed 2^14 + 1024.
7934
+ *
7935
+ * fragment:
7936
+ * The compressed form of TLSPlaintext.fragment.
7937
+ *
7938
+ * Note: A CompressionMethod.null operation is an identity operation; no fields
7939
+ * are altered. In this implementation, since no compression is supported,
7940
+ * uncompressed records are always the same as compressed records.
7941
+ *
7942
+ * Encryption Information:
7943
+ *
7944
+ * The encryption and MAC functions translate a TLSCompressed structure into a
7945
+ * TLSCiphertext. The decryption functions reverse the process. The MAC of the
7946
+ * record also includes a sequence number so that missing, extra, or repeated
7947
+ * messages are detectable.
7948
+ *
7949
+ * struct {
7950
+ * ContentType type;
7951
+ * ProtocolVersion version;
7952
+ * uint16 length;
7953
+ * select (SecurityParameters.cipher_type) {
7954
+ * case stream: GenericStreamCipher;
7955
+ * case block: GenericBlockCipher;
7956
+ * case aead: GenericAEADCipher;
7957
+ * } fragment;
7958
+ * } TLSCiphertext;
7959
+ *
7960
+ * type:
7961
+ * The type field is identical to TLSCompressed.type.
7962
+ *
7963
+ * version:
7964
+ * The version field is identical to TLSCompressed.version.
7965
+ *
7966
+ * length:
7967
+ * The length (in bytes) of the following TLSCiphertext.fragment.
7968
+ * The length MUST NOT exceed 2^14 + 2048.
7969
+ *
7970
+ * fragment:
7971
+ * The encrypted form of TLSCompressed.fragment, with the MAC.
7972
+ *
7973
+ * Note: Only CBC Block Ciphers are supported by this implementation.
7974
+ *
7975
+ * The TLSCompressed.fragment structures are converted to/from block
7976
+ * TLSCiphertext.fragment structures.
7977
+ *
7978
+ * struct {
7979
+ * opaque IV[SecurityParameters.record_iv_length];
7980
+ * block-ciphered struct {
7981
+ * opaque content[TLSCompressed.length];
7982
+ * opaque MAC[SecurityParameters.mac_length];
7983
+ * uint8 padding[GenericBlockCipher.padding_length];
7984
+ * uint8 padding_length;
7985
+ * };
7986
+ * } GenericBlockCipher;
7987
+ *
7988
+ * The MAC is generated as described in Section 6.2.3.1.
7989
+ *
7990
+ * IV:
7991
+ * The Initialization Vector (IV) SHOULD be chosen at random, and MUST be
7992
+ * unpredictable. Note that in versions of TLS prior to 1.1, there was no
7993
+ * IV field, and the last ciphertext block of the previous record (the "CBC
7994
+ * residue") was used as the IV. This was changed to prevent the attacks
7995
+ * described in [CBCATT]. For block ciphers, the IV length is of length
7996
+ * SecurityParameters.record_iv_length, which is equal to the
7997
+ * SecurityParameters.block_size.
7998
+ *
7999
+ * padding:
8000
+ * Padding that is added to force the length of the plaintext to be an
8001
+ * integral multiple of the block cipher's block length. The padding MAY be
8002
+ * any length up to 255 bytes, as long as it results in the
8003
+ * TLSCiphertext.length being an integral multiple of the block length.
8004
+ * Lengths longer than necessary might be desirable to frustrate attacks on
8005
+ * a protocol that are based on analysis of the lengths of exchanged
8006
+ * messages. Each uint8 in the padding data vector MUST be filled with the
8007
+ * padding length value. The receiver MUST check this padding and MUST use
8008
+ * the bad_record_mac alert to indicate padding errors.
8009
+ *
8010
+ * padding_length:
8011
+ * The padding length MUST be such that the total size of the
8012
+ * GenericBlockCipher structure is a multiple of the cipher's block length.
8013
+ * Legal values range from zero to 255, inclusive. This length specifies the
8014
+ * length of the padding field exclusive of the padding_length field itself.
8015
+ *
8016
+ * The encrypted data length (TLSCiphertext.length) is one more than the sum of
8017
+ * SecurityParameters.block_length, TLSCompressed.length,
8018
+ * SecurityParameters.mac_length, and padding_length.
8019
+ *
8020
+ * Example: If the block length is 8 bytes, the content length
8021
+ * (TLSCompressed.length) is 61 bytes, and the MAC length is 20 bytes, then the
8022
+ * length before padding is 82 bytes (this does not include the IV. Thus, the
8023
+ * padding length modulo 8 must be equal to 6 in order to make the total length
8024
+ * an even multiple of 8 bytes (the block length). The padding length can be
8025
+ * 6, 14, 22, and so on, through 254. If the padding length were the minimum
8026
+ * necessary, 6, the padding would be 6 bytes, each containing the value 6.
8027
+ * Thus, the last 8 octets of the GenericBlockCipher before block encryption
8028
+ * would be xx 06 06 06 06 06 06 06, where xx is the last octet of the MAC.
8029
+ *
8030
+ * Note: With block ciphers in CBC mode (Cipher Block Chaining), it is critical
8031
+ * that the entire plaintext of the record be known before any ciphertext is
8032
+ * transmitted. Otherwise, it is possible for the attacker to mount the attack
8033
+ * described in [CBCATT].
8034
+ *
8035
+ * Implementation note: Canvel et al. [CBCTIME] have demonstrated a timing
8036
+ * attack on CBC padding based on the time required to compute the MAC. In
8037
+ * order to defend against this attack, implementations MUST ensure that
8038
+ * record processing time is essentially the same whether or not the padding
8039
+ * is correct. In general, the best way to do this is to compute the MAC even
8040
+ * if the padding is incorrect, and only then reject the packet. For instance,
8041
+ * if the pad appears to be incorrect, the implementation might assume a
8042
+ * zero-length pad and then compute the MAC. This leaves a small timing
8043
+ * channel, since MAC performance depends, to some extent, on the size of the
8044
+ * data fragment, but it is not believed to be large enough to be exploitable,
8045
+ * due to the large block size of existing MACs and the small size of the
8046
+ * timing signal.
8047
+ */
7765
8048
  var $iGlOy = parcelRequire("iGlOy");
7766
8049
  var $579f29a8775d6845$exports = {};
7767
-
8050
+ /**
8051
+ * Javascript implementation of Abstract Syntax Notation Number One.
8052
+ *
8053
+ * @author Dave Longley
8054
+ *
8055
+ * Copyright (c) 2010-2015 Digital Bazaar, Inc.
8056
+ *
8057
+ * An API for storing data using the Abstract Syntax Notation Number One
8058
+ * format using DER (Distinguished Encoding Rules) encoding. This encoding is
8059
+ * commonly used to store data for PKI, i.e. X.509 Certificates, and this
8060
+ * implementation exists for that purpose.
8061
+ *
8062
+ * Abstract Syntax Notation Number One (ASN.1) is used to define the abstract
8063
+ * syntax of information without restricting the way the information is encoded
8064
+ * for transmission. It provides a standard that allows for open systems
8065
+ * communication. ASN.1 defines the syntax of information data and a number of
8066
+ * simple data types as well as a notation for describing them and specifying
8067
+ * values for them.
8068
+ *
8069
+ * The RSA algorithm creates public and private keys that are often stored in
8070
+ * X.509 or PKCS#X formats -- which use ASN.1 (encoded in DER format). This
8071
+ * class provides the most basic functionality required to store and load DSA
8072
+ * keys that are encoded according to ASN.1.
8073
+ *
8074
+ * The most common binary encodings for ASN.1 are BER (Basic Encoding Rules)
8075
+ * and DER (Distinguished Encoding Rules). DER is just a subset of BER that
8076
+ * has stricter requirements for how data must be encoded.
8077
+ *
8078
+ * Each ASN.1 structure has a tag (a byte identifying the ASN.1 structure type)
8079
+ * and a byte array for the value of this ASN1 structure which may be data or a
8080
+ * list of ASN.1 structures.
8081
+ *
8082
+ * Each ASN.1 structure using BER is (Tag-Length-Value):
8083
+ *
8084
+ * | byte 0 | bytes X | bytes Y |
8085
+ * |--------|---------|----------
8086
+ * | tag | length | value |
8087
+ *
8088
+ * ASN.1 allows for tags to be of "High-tag-number form" which allows a tag to
8089
+ * be two or more octets, but that is not supported by this class. A tag is
8090
+ * only 1 byte. Bits 1-5 give the tag number (ie the data type within a
8091
+ * particular 'class'), 6 indicates whether or not the ASN.1 value is
8092
+ * constructed from other ASN.1 values, and bits 7 and 8 give the 'class'. If
8093
+ * bits 7 and 8 are both zero, the class is UNIVERSAL. If only bit 7 is set,
8094
+ * then the class is APPLICATION. If only bit 8 is set, then the class is
8095
+ * CONTEXT_SPECIFIC. If both bits 7 and 8 are set, then the class is PRIVATE.
8096
+ * The tag numbers for the data types for the class UNIVERSAL are listed below:
8097
+ *
8098
+ * UNIVERSAL 0 Reserved for use by the encoding rules
8099
+ * UNIVERSAL 1 Boolean type
8100
+ * UNIVERSAL 2 Integer type
8101
+ * UNIVERSAL 3 Bitstring type
8102
+ * UNIVERSAL 4 Octetstring type
8103
+ * UNIVERSAL 5 Null type
8104
+ * UNIVERSAL 6 Object identifier type
8105
+ * UNIVERSAL 7 Object descriptor type
8106
+ * UNIVERSAL 8 External type and Instance-of type
8107
+ * UNIVERSAL 9 Real type
8108
+ * UNIVERSAL 10 Enumerated type
8109
+ * UNIVERSAL 11 Embedded-pdv type
8110
+ * UNIVERSAL 12 UTF8String type
8111
+ * UNIVERSAL 13 Relative object identifier type
8112
+ * UNIVERSAL 14-15 Reserved for future editions
8113
+ * UNIVERSAL 16 Sequence and Sequence-of types
8114
+ * UNIVERSAL 17 Set and Set-of types
8115
+ * UNIVERSAL 18-22, 25-30 Character string types
8116
+ * UNIVERSAL 23-24 Time types
8117
+ *
8118
+ * The length of an ASN.1 structure is specified after the tag identifier.
8119
+ * There is a definite form and an indefinite form. The indefinite form may
8120
+ * be used if the encoding is constructed and not all immediately available.
8121
+ * The indefinite form is encoded using a length byte with only the 8th bit
8122
+ * set. The end of the constructed object is marked using end-of-contents
8123
+ * octets (two zero bytes).
8124
+ *
8125
+ * The definite form looks like this:
8126
+ *
8127
+ * The length may take up 1 or more bytes, it depends on the length of the
8128
+ * value of the ASN.1 structure. DER encoding requires that if the ASN.1
8129
+ * structure has a value that has a length greater than 127, more than 1 byte
8130
+ * will be used to store its length, otherwise just one byte will be used.
8131
+ * This is strict.
8132
+ *
8133
+ * In the case that the length of the ASN.1 value is less than 127, 1 octet
8134
+ * (byte) is used to store the "short form" length. The 8th bit has a value of
8135
+ * 0 indicating the length is "short form" and not "long form" and bits 7-1
8136
+ * give the length of the data. (The 8th bit is the left-most, most significant
8137
+ * bit: also known as big endian or network format).
8138
+ *
8139
+ * In the case that the length of the ASN.1 value is greater than 127, 2 to
8140
+ * 127 octets (bytes) are used to store the "long form" length. The first
8141
+ * byte's 8th bit is set to 1 to indicate the length is "long form." Bits 7-1
8142
+ * give the number of additional octets. All following octets are in base 256
8143
+ * with the most significant digit first (typical big-endian binary unsigned
8144
+ * integer storage). So, for instance, if the length of a value was 257, the
8145
+ * first byte would be set to:
8146
+ *
8147
+ * 10000010 = 130 = 0x82.
8148
+ *
8149
+ * This indicates there are 2 octets (base 256) for the length. The second and
8150
+ * third bytes (the octets just mentioned) would store the length in base 256:
8151
+ *
8152
+ * octet 2: 00000001 = 1 * 256^1 = 256
8153
+ * octet 3: 00000001 = 1 * 256^0 = 1
8154
+ * total = 257
8155
+ *
8156
+ * The algorithm for converting a js integer value of 257 to base-256 is:
8157
+ *
8158
+ * var value = 257;
8159
+ * var bytes = [];
8160
+ * bytes[0] = (value >>> 8) & 0xFF; // most significant byte first
8161
+ * bytes[1] = value & 0xFF; // least significant byte last
8162
+ *
8163
+ * On the ASN.1 UNIVERSAL Object Identifier (OID) type:
8164
+ *
8165
+ * An OID can be written like: "value1.value2.value3...valueN"
8166
+ *
8167
+ * The DER encoding rules:
8168
+ *
8169
+ * The first byte has the value 40 * value1 + value2.
8170
+ * The following bytes, if any, encode the remaining values. Each value is
8171
+ * encoded in base 128, most significant digit first (big endian), with as
8172
+ * few digits as possible, and the most significant bit of each byte set
8173
+ * to 1 except the last in each value's encoding. For example: Given the
8174
+ * OID "1.2.840.113549", its DER encoding is (remember each byte except the
8175
+ * last one in each encoding is OR'd with 0x80):
8176
+ *
8177
+ * byte 1: 40 * 1 + 2 = 42 = 0x2A.
8178
+ * bytes 2-3: 128 * 6 + 72 = 840 = 6 72 = 6 72 = 0x0648 = 0x8648
8179
+ * bytes 4-6: 16384 * 6 + 128 * 119 + 13 = 6 119 13 = 0x06770D = 0x86F70D
8180
+ *
8181
+ * The final value is: 0x2A864886F70D.
8182
+ * The full OID (including ASN.1 tag and length of 6 bytes) is:
8183
+ * 0x06062A864886F70D
8184
+ */
7768
8185
  var $iGlOy = parcelRequire("iGlOy");
7769
8186
 
7770
8187
  var $10862ec0f65326f9$exports = {};
7771
-
8188
+ /**
8189
+ * Object IDs for ASN.1.
8190
+ *
8191
+ * @author Dave Longley
8192
+ *
8193
+ * Copyright (c) 2010-2013 Digital Bazaar, Inc.
8194
+ */
7772
8195
  var $iGlOy = parcelRequire("iGlOy");
7773
8196
  $iGlOy.pki = $iGlOy.pki || {};
7774
8197
  var $10862ec0f65326f9$var$oids = $10862ec0f65326f9$exports = $iGlOy.pki.oids = $iGlOy.oids = $iGlOy.oids || {};
@@ -8244,7 +8667,9 @@ $10862ec0f65326f9$var$_IN("1.3.6.1.5.5.7.3.8", "timeStamping");
8244
8667
  // determine if a non-constructed value should be decoded as a composed
8245
8668
  // value that contains other ASN.1 objects. BIT STRINGs (and OCTET STRINGs)
8246
8669
  // can be used this way.
8247
- if (value === undefined && options.decodeBitStrings && tagClass === $579f29a8775d6845$var$asn1.Class.UNIVERSAL && type === $579f29a8775d6845$var$asn1.Type.BITSTRING /*|| type === asn1.Type.OCTETSTRING*/ && length > 1) {
8670
+ if (value === undefined && options.decodeBitStrings && tagClass === $579f29a8775d6845$var$asn1.Class.UNIVERSAL && // FIXME: OCTET STRINGs not yet supported here
8671
+ // .. other parts of forge expect to decode OCTET STRINGs manually
8672
+ type === $579f29a8775d6845$var$asn1.Type.BITSTRING /*|| type === asn1.Type.OCTETSTRING*/ && length > 1) {
8248
8673
  // save read position
8249
8674
  var savedRead = bytes.read;
8250
8675
  var savedRemaining = remaining;
@@ -8347,7 +8772,9 @@ $10862ec0f65326f9$var$_IN("1.3.6.1.5.5.7.3.8", "timeStamping");
8347
8772
  else // ensure integer is minimally-encoded
8348
8773
  // TODO: should all leading bytes be stripped vs just one?
8349
8774
  // .. ex '00 00 01' => '01'?
8350
- if (obj.type === $579f29a8775d6845$var$asn1.Type.INTEGER && obj.value.length > 1 && (obj.value.charCodeAt(0) === 0 && (obj.value.charCodeAt(1) & 0x80) === 0 || obj.value.charCodeAt(0) === 0xFF && (obj.value.charCodeAt(1) & 0x80) === 0x80)) value.putBytes(obj.value.substr(1));
8775
+ if (obj.type === $579f29a8775d6845$var$asn1.Type.INTEGER && obj.value.length > 1 && // leading 0x00 for positive integer
8776
+ (obj.value.charCodeAt(0) === 0 && (obj.value.charCodeAt(1) & 0x80) === 0 || // leading 0xFF for negative integer
8777
+ obj.value.charCodeAt(0) === 0xFF && (obj.value.charCodeAt(1) & 0x80) === 0x80)) value.putBytes(obj.value.substr(1));
8351
8778
  else value.putBytes(obj.value);
8352
8779
  }
8353
8780
  // add tag byte
@@ -8892,7 +9319,15 @@ var $579f29a8775d6845$var$_nonLatinRegex = /[^\\u0000-\\u00ff]/;
8892
9319
 
8893
9320
 
8894
9321
  var $84d5ddf5dc7c5415$exports = {};
8895
-
9322
+ /**
9323
+ * Hash-based Message Authentication Code implementation. Requires a message
9324
+ * digest object that can be obtained, for example, from forge.md.sha1 or
9325
+ * forge.md.md5.
9326
+ *
9327
+ * @author Dave Longley
9328
+ *
9329
+ * Copyright (c) 2010-2012 Digital Bazaar, Inc. All rights reserved.
9330
+ */
8896
9331
  var $iGlOy = parcelRequire("iGlOy");
8897
9332
  parcelRequire("ai0Z9");
8898
9333
 
@@ -9003,7 +9438,13 @@ parcelRequire("ai0Z9");
9003
9438
 
9004
9439
 
9005
9440
  var $a933e3938fe5f3ff$exports = {};
9006
-
9441
+ /**
9442
+ * Message Digest Algorithm 5 with 128-bit digest (MD5) implementation.
9443
+ *
9444
+ * @author Dave Longley
9445
+ *
9446
+ * Copyright (c) 2010-2014 Digital Bazaar, Inc.
9447
+ */
9007
9448
  var $iGlOy = parcelRequire("iGlOy");
9008
9449
  parcelRequire("ai0Z9");
9009
9450
 
@@ -9362,7 +9803,34 @@ var $a933e3938fe5f3ff$var$_initialized = false;
9362
9803
 
9363
9804
 
9364
9805
  var $6c81a009b991fd79$exports = {};
9365
-
9806
+ /**
9807
+ * Javascript implementation of basic PEM (Privacy Enhanced Mail) algorithms.
9808
+ *
9809
+ * See: RFC 1421.
9810
+ *
9811
+ * @author Dave Longley
9812
+ *
9813
+ * Copyright (c) 2013-2014 Digital Bazaar, Inc.
9814
+ *
9815
+ * A Forge PEM object has the following fields:
9816
+ *
9817
+ * type: identifies the type of message (eg: "RSA PRIVATE KEY").
9818
+ *
9819
+ * procType: identifies the type of processing performed on the message,
9820
+ * it has two subfields: version and type, eg: 4,ENCRYPTED.
9821
+ *
9822
+ * contentDomain: identifies the type of content in the message, typically
9823
+ * only uses the value: "RFC822".
9824
+ *
9825
+ * dekInfo: identifies the message encryption algorithm and mode and includes
9826
+ * any parameters for the algorithm, it has two subfields: algorithm and
9827
+ * parameters, eg: DES-CBC,F8143EDE5960C597.
9828
+ *
9829
+ * headers: contains all other PEM encapsulated headers -- where order is
9830
+ * significant (for pairing data like recipient ID + key info).
9831
+ *
9832
+ * body: the binary-encoded body.
9833
+ */
9366
9834
  var $iGlOy = parcelRequire("iGlOy");
9367
9835
 
9368
9836
  // shortcut for pem API
@@ -9529,17 +9997,72 @@ function $6c81a009b991fd79$var$ltrim(str) {
9529
9997
 
9530
9998
 
9531
9999
  var $71c5302ef2ea3950$exports = {};
9532
-
10000
+ /**
10001
+ * Javascript implementation of a basic Public Key Infrastructure, including
10002
+ * support for RSA public and private keys.
10003
+ *
10004
+ * @author Dave Longley
10005
+ *
10006
+ * Copyright (c) 2010-2013 Digital Bazaar, Inc.
10007
+ */
9533
10008
  var $iGlOy = parcelRequire("iGlOy");
9534
10009
 
9535
10010
 
9536
10011
  var $4ead143e6089ae29$exports = {};
9537
-
10012
+ /**
10013
+ * Password-based encryption functions.
10014
+ *
10015
+ * @author Dave Longley
10016
+ * @author Stefan Siegl <stesie@brokenpipe.de>
10017
+ *
10018
+ * Copyright (c) 2010-2013 Digital Bazaar, Inc.
10019
+ * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>
10020
+ *
10021
+ * An EncryptedPrivateKeyInfo:
10022
+ *
10023
+ * EncryptedPrivateKeyInfo ::= SEQUENCE {
10024
+ * encryptionAlgorithm EncryptionAlgorithmIdentifier,
10025
+ * encryptedData EncryptedData }
10026
+ *
10027
+ * EncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
10028
+ *
10029
+ * EncryptedData ::= OCTET STRING
10030
+ */
9538
10031
  var $iGlOy = parcelRequire("iGlOy");
9539
10032
 
9540
10033
 
9541
10034
  var $ff4c3bd9116e15cc$exports = {};
9542
-
10035
+ /**
10036
+ * DES (Data Encryption Standard) implementation.
10037
+ *
10038
+ * This implementation supports DES as well as 3DES-EDE in ECB and CBC mode.
10039
+ * It is based on the BSD-licensed implementation by Paul Tero:
10040
+ *
10041
+ * Paul Tero, July 2001
10042
+ * http://www.tero.co.uk/des/
10043
+ *
10044
+ * Optimised for performance with large blocks by
10045
+ * Michael Hayworth, November 2001
10046
+ * http://www.netdealing.com
10047
+ *
10048
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND
10049
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
10050
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
10051
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
10052
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
10053
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
10054
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
10055
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
10056
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
10057
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
10058
+ * SUCH DAMAGE.
10059
+ *
10060
+ * @author Stefan Siegl
10061
+ * @author Dave Longley
10062
+ *
10063
+ * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>
10064
+ * Copyright (c) 2012-2014 Digital Bazaar, Inc.
10065
+ */
9543
10066
  var $iGlOy = parcelRequire("iGlOy");
9544
10067
 
9545
10068
 
@@ -10704,7 +11227,15 @@ var $ff4c3bd9116e15cc$var$spfunction8 = [
10704
11227
  parcelRequire("ai0Z9");
10705
11228
 
10706
11229
  var $7436abf0cf29a7b7$exports = {};
10707
-
11230
+ /**
11231
+ * Password-Based Key-Derivation Function #2 implementation.
11232
+ *
11233
+ * See RFC 2898 for details.
11234
+ *
11235
+ * @author Dave Longley
11236
+ *
11237
+ * Copyright (c) 2010-2013 Digital Bazaar, Inc.
11238
+ */
10708
11239
  var $iGlOy = parcelRequire("iGlOy");
10709
11240
 
10710
11241
  parcelRequire("ai0Z9");
@@ -10863,11 +11394,33 @@ if ($iGlOy.util.isNodejs && !$iGlOy.options.usePureJavaScript) $7436abf0cf29a7b7
10863
11394
 
10864
11395
 
10865
11396
  var $b9b57fce3e6d85ef$exports = {};
10866
-
11397
+ /**
11398
+ * An API for getting cryptographically-secure random bytes. The bytes are
11399
+ * generated using the Fortuna algorithm devised by Bruce Schneier and
11400
+ * Niels Ferguson.
11401
+ *
11402
+ * Getting strong random bytes is not yet easy to do in javascript. The only
11403
+ * truish random entropy that can be collected is from the mouse, keyboard, or
11404
+ * from timing with respect to page loads, etc. This generator makes a poor
11405
+ * attempt at providing random bytes when those sources haven't yet provided
11406
+ * enough entropy to initially seed or to reseed the PRNG.
11407
+ *
11408
+ * @author Dave Longley
11409
+ *
11410
+ * Copyright (c) 2009-2014 Digital Bazaar, Inc.
11411
+ */
10867
11412
  var $iGlOy = parcelRequire("iGlOy");
10868
11413
 
10869
11414
  var $e523b90a804c5bd3$exports = {};
10870
-
11415
+ /**
11416
+ * Secure Hash Algorithm with 256-bit digest (SHA-256) implementation.
11417
+ *
11418
+ * See FIPS 180-2 for details.
11419
+ *
11420
+ * @author Dave Longley
11421
+ *
11422
+ * Copyright (c) 2010-2015 Digital Bazaar, Inc.
11423
+ */
10871
11424
  var $iGlOy = parcelRequire("iGlOy");
10872
11425
  parcelRequire("ai0Z9");
10873
11426
 
@@ -11177,7 +11730,17 @@ var $e523b90a804c5bd3$var$_k = null;
11177
11730
 
11178
11731
 
11179
11732
  var $c761b0edb959b99a$exports = {};
11180
-
11733
+ /**
11734
+ * A javascript implementation of a cryptographically-secure
11735
+ * Pseudo Random Number Generator (PRNG). The Fortuna algorithm is followed
11736
+ * here though the use of SHA-256 is not enforced; when generating an
11737
+ * a PRNG context, the hashing algorithm and block cipher used for
11738
+ * the generator are specified via a plugin.
11739
+ *
11740
+ * @author Dave Longley
11741
+ *
11742
+ * Copyright (c) 2010-2014 Digital Bazaar, Inc.
11743
+ */
11181
11744
  var $iGlOy = parcelRequire("iGlOy");
11182
11745
 
11183
11746
  var $c761b0edb959b99a$var$_crypto = null;
@@ -11641,7 +12204,16 @@ if ($iGlOy.util.isNodejs && !$iGlOy.options.usePureJavaScript && !process.versio
11641
12204
 
11642
12205
 
11643
12206
  var $e745366ef6f504e1$exports = {};
11644
-
12207
+ /**
12208
+ * RC2 implementation.
12209
+ *
12210
+ * @author Stefan Siegl
12211
+ *
12212
+ * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>
12213
+ *
12214
+ * Information on the RC2 cipher is available from RFC #2268,
12215
+ * http://www.ietf.org/rfc/rfc2268.txt
12216
+ */
11645
12217
  var $iGlOy = parcelRequire("iGlOy");
11646
12218
 
11647
12219
  var $e745366ef6f504e1$var$piTable = [
@@ -12202,11 +12774,116 @@ var $e745366ef6f504e1$var$s = [
12202
12774
 
12203
12775
 
12204
12776
  var $8ab3548bea1beb81$exports = {};
12205
-
12777
+ /**
12778
+ * Javascript implementation of basic RSA algorithms.
12779
+ *
12780
+ * @author Dave Longley
12781
+ *
12782
+ * Copyright (c) 2010-2014 Digital Bazaar, Inc.
12783
+ *
12784
+ * The only algorithm currently supported for PKI is RSA.
12785
+ *
12786
+ * An RSA key is often stored in ASN.1 DER format. The SubjectPublicKeyInfo
12787
+ * ASN.1 structure is composed of an algorithm of type AlgorithmIdentifier
12788
+ * and a subjectPublicKey of type bit string.
12789
+ *
12790
+ * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters
12791
+ * for the algorithm, if any. In the case of RSA, there aren't any.
12792
+ *
12793
+ * SubjectPublicKeyInfo ::= SEQUENCE {
12794
+ * algorithm AlgorithmIdentifier,
12795
+ * subjectPublicKey BIT STRING
12796
+ * }
12797
+ *
12798
+ * AlgorithmIdentifer ::= SEQUENCE {
12799
+ * algorithm OBJECT IDENTIFIER,
12800
+ * parameters ANY DEFINED BY algorithm OPTIONAL
12801
+ * }
12802
+ *
12803
+ * For an RSA public key, the subjectPublicKey is:
12804
+ *
12805
+ * RSAPublicKey ::= SEQUENCE {
12806
+ * modulus INTEGER, -- n
12807
+ * publicExponent INTEGER -- e
12808
+ * }
12809
+ *
12810
+ * PrivateKeyInfo ::= SEQUENCE {
12811
+ * version Version,
12812
+ * privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
12813
+ * privateKey PrivateKey,
12814
+ * attributes [0] IMPLICIT Attributes OPTIONAL
12815
+ * }
12816
+ *
12817
+ * Version ::= INTEGER
12818
+ * PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
12819
+ * PrivateKey ::= OCTET STRING
12820
+ * Attributes ::= SET OF Attribute
12821
+ *
12822
+ * An RSA private key as the following structure:
12823
+ *
12824
+ * RSAPrivateKey ::= SEQUENCE {
12825
+ * version Version,
12826
+ * modulus INTEGER, -- n
12827
+ * publicExponent INTEGER, -- e
12828
+ * privateExponent INTEGER, -- d
12829
+ * prime1 INTEGER, -- p
12830
+ * prime2 INTEGER, -- q
12831
+ * exponent1 INTEGER, -- d mod (p-1)
12832
+ * exponent2 INTEGER, -- d mod (q-1)
12833
+ * coefficient INTEGER -- (inverse of q) mod p
12834
+ * }
12835
+ *
12836
+ * Version ::= INTEGER
12837
+ *
12838
+ * The OID for the RSA key algorithm is: 1.2.840.113549.1.1.1
12839
+ */
12206
12840
  var $iGlOy = parcelRequire("iGlOy");
12207
12841
 
12208
12842
  var $1831e702d86f54be$exports = {};
12209
-
12843
+ // Copyright (c) 2005 Tom Wu
12844
+ // All Rights Reserved.
12845
+ // See "LICENSE" for details.
12846
+ // Basic JavaScript BN library - subset useful for RSA encryption.
12847
+ /*
12848
+ Licensing (LICENSE)
12849
+ -------------------
12850
+
12851
+ This software is covered under the following copyright:
12852
+ */ /*
12853
+ * Copyright (c) 2003-2005 Tom Wu
12854
+ * All Rights Reserved.
12855
+ *
12856
+ * Permission is hereby granted, free of charge, to any person obtaining
12857
+ * a copy of this software and associated documentation files (the
12858
+ * "Software"), to deal in the Software without restriction, including
12859
+ * without limitation the rights to use, copy, modify, merge, publish,
12860
+ * distribute, sublicense, and/or sell copies of the Software, and to
12861
+ * permit persons to whom the Software is furnished to do so, subject to
12862
+ * the following conditions:
12863
+ *
12864
+ * The above copyright notice and this permission notice shall be
12865
+ * included in all copies or substantial portions of the Software.
12866
+ *
12867
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
12868
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
12869
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
12870
+ *
12871
+ * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
12872
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
12873
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
12874
+ * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
12875
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
12876
+ *
12877
+ * In addition, the following condition applies:
12878
+ *
12879
+ * All redistributions must retain an intact copy of this copyright notice
12880
+ * and disclaimer.
12881
+ */ /*
12882
+ Address all questions regarding this license to:
12883
+
12884
+ Tom Wu
12885
+ tjw@cs.Stanford.EDU
12886
+ */
12210
12887
  var $iGlOy = parcelRequire("iGlOy");
12211
12888
  $1831e702d86f54be$exports = $iGlOy.jsbn = $iGlOy.jsbn || {};
12212
12889
  // Bits per digit
@@ -13535,7 +14212,7 @@ function $1831e702d86f54be$var$bnpMillerRabin(t) {
13535
14212
  var y = a.modPow(r, this);
13536
14213
  if (y.compareTo($1831e702d86f54be$var$BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
13537
14214
  var j = 1;
13538
- while((j++) < k && y.compareTo(n1) != 0){
14215
+ while(j++ < k && y.compareTo(n1) != 0){
13539
14216
  y = y.modPowInt(2, this);
13540
14217
  if (y.compareTo($1831e702d86f54be$var$BigInteger.ONE) == 0) return false;
13541
14218
  }
@@ -13612,12 +14289,62 @@ $1831e702d86f54be$var$BigInteger.prototype.isProbablePrime = $1831e702d86f54be$v
13612
14289
 
13613
14290
 
13614
14291
  var $564ac6480d83471d$exports = {};
13615
-
14292
+ /**
14293
+ * Partial implementation of PKCS#1 v2.2: RSA-OEAP
14294
+ *
14295
+ * Modified but based on the following MIT and BSD licensed code:
14296
+ *
14297
+ * https://github.com/kjur/jsjws/blob/master/rsa.js:
14298
+ *
14299
+ * The 'jsjws'(JSON Web Signature JavaScript Library) License
14300
+ *
14301
+ * Copyright (c) 2012 Kenji Urushima
14302
+ *
14303
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
14304
+ * of this software and associated documentation files (the "Software"), to deal
14305
+ * in the Software without restriction, including without limitation the rights
14306
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14307
+ * copies of the Software, and to permit persons to whom the Software is
14308
+ * furnished to do so, subject to the following conditions:
14309
+ *
14310
+ * The above copyright notice and this permission notice shall be included in
14311
+ * all copies or substantial portions of the Software.
14312
+ *
14313
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14314
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14315
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14316
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14317
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
14318
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
14319
+ * THE SOFTWARE.
14320
+ *
14321
+ * http://webrsa.cvs.sourceforge.net/viewvc/webrsa/Client/RSAES-OAEP.js?content-type=text%2Fplain:
14322
+ *
14323
+ * RSAES-OAEP.js
14324
+ * $Id: RSAES-OAEP.js,v 1.1.1.1 2003/03/19 15:37:20 ellispritchard Exp $
14325
+ * JavaScript Implementation of PKCS #1 v2.1 RSA CRYPTOGRAPHY STANDARD (RSA Laboratories, June 14, 2002)
14326
+ * Copyright (C) Ellis Pritchard, Guardian Unlimited 2003.
14327
+ * Contact: ellis@nukinetics.com
14328
+ * Distributed under the BSD License.
14329
+ *
14330
+ * Official documentation: http://www.rsa.com/rsalabs/node.asp?id=2125
14331
+ *
14332
+ * @author Evan Jones (http://evanjones.ca/)
14333
+ * @author Dave Longley
14334
+ *
14335
+ * Copyright (c) 2013-2014 Digital Bazaar, Inc.
14336
+ */
13616
14337
  var $iGlOy = parcelRequire("iGlOy");
13617
14338
 
13618
14339
 
13619
14340
  var $7dc60e406dad2a14$exports = {};
13620
-
14341
+ /**
14342
+ * Secure Hash Algorithm with 160-bit digest (SHA-1) implementation.
14343
+ *
14344
+ * @author Dave Longley
14345
+ *
14346
+ * Copyright (c) 2010-2015 Digital Bazaar, Inc.
14347
+ */
13621
14348
  var $iGlOy = parcelRequire("iGlOy");
13622
14349
  parcelRequire("ai0Z9");
13623
14350
 
@@ -14052,7 +14779,13 @@ function $564ac6480d83471d$var$rsa_mgf1(seed, maskLength, hash) {
14052
14779
 
14053
14780
 
14054
14781
  var $82c15eca7626be33$exports = {};
14055
-
14782
+ /**
14783
+ * Prime number generation API.
14784
+ *
14785
+ * @author Dave Longley
14786
+ *
14787
+ * Copyright (c) 2014 Digital Bazaar, Inc.
14788
+ */
14056
14789
  var $iGlOy = parcelRequire("iGlOy");
14057
14790
 
14058
14791
 
@@ -14163,7 +14896,7 @@ var $iGlOy = parcelRequire("iGlOy");
14163
14896
  // do primality test
14164
14897
  if (num.isProbablePrime(mrTests)) return callback(null, num);
14165
14898
  // get next potential prime
14166
- num.dAddOffset(GCD_30_DELTA[(deltaIdx++) % 8], 0);
14899
+ num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0);
14167
14900
  }while (maxBlockTime < 0 || +new Date() - start < maxBlockTime);
14168
14901
  // keep trying later
14169
14902
  $iGlOy.util.setImmediate(function() {
@@ -14918,7 +15651,7 @@ var $8ab3548bea1beb81$var$digestInfoValidator = {
14918
15651
  state.pqState = 0;
14919
15652
  else if (state.num.isProbablePrime($8ab3548bea1beb81$var$_getMillerRabinTests(state.num.bitLength()))) ++state.pqState;
14920
15653
  else // get next potential prime
14921
- state.num.dAddOffset($8ab3548bea1beb81$var$GCD_30_DELTA[(deltaIdx++) % 8], 0);
15654
+ state.num.dAddOffset($8ab3548bea1beb81$var$GCD_30_DELTA[deltaIdx++ % 8], 0);
14922
15655
  } else if (state.pqState === 2) // ensure number is coprime with e
14923
15656
  state.pqState = state.num.subtract($8ab3548bea1beb81$var$BigInteger.ONE).gcd(state.e).compareTo($8ab3548bea1beb81$var$BigInteger.ONE) === 0 ? 3 : 0;
14924
15657
  else if (state.pqState === 3) {
@@ -15782,7 +16515,9 @@ var $8ab3548bea1beb81$var$digestInfoValidator = {
15782
16515
  if (hex[0] >= "8") hex = "00" + hex;
15783
16516
  var bytes = $iGlOy.util.hexToBytes(hex);
15784
16517
  // ensure integer is minimally-encoded
15785
- if (bytes.length > 1 && (bytes.charCodeAt(0) === 0 && (bytes.charCodeAt(1) & 0x80) === 0 || bytes.charCodeAt(0) === 0xFF && (bytes.charCodeAt(1) & 0x80) === 0x80)) return bytes.substr(1);
16518
+ if (bytes.length > 1 && // leading 0x00 for positive integer
16519
+ (bytes.charCodeAt(0) === 0 && (bytes.charCodeAt(1) & 0x80) === 0 || // leading 0xFF for negative integer
16520
+ bytes.charCodeAt(0) === 0xFF && (bytes.charCodeAt(1) & 0x80) === 0x80)) return bytes.substr(1);
15786
16521
  return bytes;
15787
16522
  }
15788
16523
  /**
@@ -16733,13 +17468,215 @@ function $4ead143e6089ae29$var$createPbkdf2Params(salt, countBytes, dkLen, prfAl
16733
17468
 
16734
17469
 
16735
17470
  var $6fcb727b03413917$exports = {};
16736
-
17471
+ /**
17472
+ * Javascript implementation of PKCS#12.
17473
+ *
17474
+ * @author Dave Longley
17475
+ * @author Stefan Siegl <stesie@brokenpipe.de>
17476
+ *
17477
+ * Copyright (c) 2010-2014 Digital Bazaar, Inc.
17478
+ * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>
17479
+ *
17480
+ * The ASN.1 representation of PKCS#12 is as follows
17481
+ * (see ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12-tc1.pdf for details)
17482
+ *
17483
+ * PFX ::= SEQUENCE {
17484
+ * version INTEGER {v3(3)}(v3,...),
17485
+ * authSafe ContentInfo,
17486
+ * macData MacData OPTIONAL
17487
+ * }
17488
+ *
17489
+ * MacData ::= SEQUENCE {
17490
+ * mac DigestInfo,
17491
+ * macSalt OCTET STRING,
17492
+ * iterations INTEGER DEFAULT 1
17493
+ * }
17494
+ * Note: The iterations default is for historical reasons and its use is
17495
+ * deprecated. A higher value, like 1024, is recommended.
17496
+ *
17497
+ * DigestInfo is defined in PKCS#7 as follows:
17498
+ *
17499
+ * DigestInfo ::= SEQUENCE {
17500
+ * digestAlgorithm DigestAlgorithmIdentifier,
17501
+ * digest Digest
17502
+ * }
17503
+ *
17504
+ * DigestAlgorithmIdentifier ::= AlgorithmIdentifier
17505
+ *
17506
+ * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters
17507
+ * for the algorithm, if any. In the case of SHA1 there is none.
17508
+ *
17509
+ * AlgorithmIdentifer ::= SEQUENCE {
17510
+ * algorithm OBJECT IDENTIFIER,
17511
+ * parameters ANY DEFINED BY algorithm OPTIONAL
17512
+ * }
17513
+ *
17514
+ * Digest ::= OCTET STRING
17515
+ *
17516
+ *
17517
+ * ContentInfo ::= SEQUENCE {
17518
+ * contentType ContentType,
17519
+ * content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL
17520
+ * }
17521
+ *
17522
+ * ContentType ::= OBJECT IDENTIFIER
17523
+ *
17524
+ * AuthenticatedSafe ::= SEQUENCE OF ContentInfo
17525
+ * -- Data if unencrypted
17526
+ * -- EncryptedData if password-encrypted
17527
+ * -- EnvelopedData if public key-encrypted
17528
+ *
17529
+ *
17530
+ * SafeContents ::= SEQUENCE OF SafeBag
17531
+ *
17532
+ * SafeBag ::= SEQUENCE {
17533
+ * bagId BAG-TYPE.&id ({PKCS12BagSet})
17534
+ * bagValue [0] EXPLICIT BAG-TYPE.&Type({PKCS12BagSet}{@bagId}),
17535
+ * bagAttributes SET OF PKCS12Attribute OPTIONAL
17536
+ * }
17537
+ *
17538
+ * PKCS12Attribute ::= SEQUENCE {
17539
+ * attrId ATTRIBUTE.&id ({PKCS12AttrSet}),
17540
+ * attrValues SET OF ATTRIBUTE.&Type ({PKCS12AttrSet}{@attrId})
17541
+ * } -- This type is compatible with the X.500 type 'Attribute'
17542
+ *
17543
+ * PKCS12AttrSet ATTRIBUTE ::= {
17544
+ * friendlyName | -- from PKCS #9
17545
+ * localKeyId, -- from PKCS #9
17546
+ * ... -- Other attributes are allowed
17547
+ * }
17548
+ *
17549
+ * CertBag ::= SEQUENCE {
17550
+ * certId BAG-TYPE.&id ({CertTypes}),
17551
+ * certValue [0] EXPLICIT BAG-TYPE.&Type ({CertTypes}{@certId})
17552
+ * }
17553
+ *
17554
+ * x509Certificate BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {certTypes 1}}
17555
+ * -- DER-encoded X.509 certificate stored in OCTET STRING
17556
+ *
17557
+ * sdsiCertificate BAG-TYPE ::= {IA5String IDENTIFIED BY {certTypes 2}}
17558
+ * -- Base64-encoded SDSI certificate stored in IA5String
17559
+ *
17560
+ * CertTypes BAG-TYPE ::= {
17561
+ * x509Certificate |
17562
+ * sdsiCertificate,
17563
+ * ... -- For future extensions
17564
+ * }
17565
+ */
16737
17566
  var $iGlOy = parcelRequire("iGlOy");
16738
17567
 
16739
17568
 
16740
17569
 
16741
17570
  var $a5c085c32c6e5e1a$exports = {};
16742
-
17571
+ /**
17572
+ * Javascript implementation of ASN.1 validators for PKCS#7 v1.5.
17573
+ *
17574
+ * @author Dave Longley
17575
+ * @author Stefan Siegl
17576
+ *
17577
+ * Copyright (c) 2012-2015 Digital Bazaar, Inc.
17578
+ * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>
17579
+ *
17580
+ * The ASN.1 representation of PKCS#7 is as follows
17581
+ * (see RFC #2315 for details, http://www.ietf.org/rfc/rfc2315.txt):
17582
+ *
17583
+ * A PKCS#7 message consists of a ContentInfo on root level, which may
17584
+ * contain any number of further ContentInfo nested into it.
17585
+ *
17586
+ * ContentInfo ::= SEQUENCE {
17587
+ * contentType ContentType,
17588
+ * content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL
17589
+ * }
17590
+ *
17591
+ * ContentType ::= OBJECT IDENTIFIER
17592
+ *
17593
+ * EnvelopedData ::= SEQUENCE {
17594
+ * version Version,
17595
+ * recipientInfos RecipientInfos,
17596
+ * encryptedContentInfo EncryptedContentInfo
17597
+ * }
17598
+ *
17599
+ * EncryptedData ::= SEQUENCE {
17600
+ * version Version,
17601
+ * encryptedContentInfo EncryptedContentInfo
17602
+ * }
17603
+ *
17604
+ * id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
17605
+ * us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 }
17606
+ *
17607
+ * SignedData ::= SEQUENCE {
17608
+ * version INTEGER,
17609
+ * digestAlgorithms DigestAlgorithmIdentifiers,
17610
+ * contentInfo ContentInfo,
17611
+ * certificates [0] IMPLICIT Certificates OPTIONAL,
17612
+ * crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,
17613
+ * signerInfos SignerInfos
17614
+ * }
17615
+ *
17616
+ * SignerInfos ::= SET OF SignerInfo
17617
+ *
17618
+ * SignerInfo ::= SEQUENCE {
17619
+ * version Version,
17620
+ * issuerAndSerialNumber IssuerAndSerialNumber,
17621
+ * digestAlgorithm DigestAlgorithmIdentifier,
17622
+ * authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL,
17623
+ * digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier,
17624
+ * encryptedDigest EncryptedDigest,
17625
+ * unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL
17626
+ * }
17627
+ *
17628
+ * EncryptedDigest ::= OCTET STRING
17629
+ *
17630
+ * Attributes ::= SET OF Attribute
17631
+ *
17632
+ * Attribute ::= SEQUENCE {
17633
+ * attrType OBJECT IDENTIFIER,
17634
+ * attrValues SET OF AttributeValue
17635
+ * }
17636
+ *
17637
+ * AttributeValue ::= ANY
17638
+ *
17639
+ * Version ::= INTEGER
17640
+ *
17641
+ * RecipientInfos ::= SET OF RecipientInfo
17642
+ *
17643
+ * EncryptedContentInfo ::= SEQUENCE {
17644
+ * contentType ContentType,
17645
+ * contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier,
17646
+ * encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL
17647
+ * }
17648
+ *
17649
+ * ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
17650
+ *
17651
+ * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters
17652
+ * for the algorithm, if any. In the case of AES and DES3, there is only one,
17653
+ * the IV.
17654
+ *
17655
+ * AlgorithmIdentifer ::= SEQUENCE {
17656
+ * algorithm OBJECT IDENTIFIER,
17657
+ * parameters ANY DEFINED BY algorithm OPTIONAL
17658
+ * }
17659
+ *
17660
+ * EncryptedContent ::= OCTET STRING
17661
+ *
17662
+ * RecipientInfo ::= SEQUENCE {
17663
+ * version Version,
17664
+ * issuerAndSerialNumber IssuerAndSerialNumber,
17665
+ * keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
17666
+ * encryptedKey EncryptedKey
17667
+ * }
17668
+ *
17669
+ * IssuerAndSerialNumber ::= SEQUENCE {
17670
+ * issuer Name,
17671
+ * serialNumber CertificateSerialNumber
17672
+ * }
17673
+ *
17674
+ * CertificateSerialNumber ::= INTEGER
17675
+ *
17676
+ * KeyEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
17677
+ *
17678
+ * EncryptedKey ::= OCTET STRING
17679
+ */
16743
17680
  var $iGlOy = parcelRequire("iGlOy");
16744
17681
 
16745
17682
 
@@ -17086,17 +18023,139 @@ $a5c085c32c6e5e1a$var$p7v.recipientInfoValidator = {
17086
18023
 
17087
18024
 
17088
18025
  var $f71d929f259208f7$exports = {};
17089
-
18026
+ /**
18027
+ * Javascript implementation of X.509 and related components (such as
18028
+ * Certification Signing Requests) of a Public Key Infrastructure.
18029
+ *
18030
+ * @author Dave Longley
18031
+ *
18032
+ * Copyright (c) 2010-2014 Digital Bazaar, Inc.
18033
+ *
18034
+ * The ASN.1 representation of an X.509v3 certificate is as follows
18035
+ * (see RFC 2459):
18036
+ *
18037
+ * Certificate ::= SEQUENCE {
18038
+ * tbsCertificate TBSCertificate,
18039
+ * signatureAlgorithm AlgorithmIdentifier,
18040
+ * signatureValue BIT STRING
18041
+ * }
18042
+ *
18043
+ * TBSCertificate ::= SEQUENCE {
18044
+ * version [0] EXPLICIT Version DEFAULT v1,
18045
+ * serialNumber CertificateSerialNumber,
18046
+ * signature AlgorithmIdentifier,
18047
+ * issuer Name,
18048
+ * validity Validity,
18049
+ * subject Name,
18050
+ * subjectPublicKeyInfo SubjectPublicKeyInfo,
18051
+ * issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
18052
+ * -- If present, version shall be v2 or v3
18053
+ * subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
18054
+ * -- If present, version shall be v2 or v3
18055
+ * extensions [3] EXPLICIT Extensions OPTIONAL
18056
+ * -- If present, version shall be v3
18057
+ * }
18058
+ *
18059
+ * Version ::= INTEGER { v1(0), v2(1), v3(2) }
18060
+ *
18061
+ * CertificateSerialNumber ::= INTEGER
18062
+ *
18063
+ * Name ::= CHOICE {
18064
+ * // only one possible choice for now
18065
+ * RDNSequence
18066
+ * }
18067
+ *
18068
+ * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
18069
+ *
18070
+ * RelativeDistinguishedName ::= SET OF AttributeTypeAndValue
18071
+ *
18072
+ * AttributeTypeAndValue ::= SEQUENCE {
18073
+ * type AttributeType,
18074
+ * value AttributeValue
18075
+ * }
18076
+ * AttributeType ::= OBJECT IDENTIFIER
18077
+ * AttributeValue ::= ANY DEFINED BY AttributeType
18078
+ *
18079
+ * Validity ::= SEQUENCE {
18080
+ * notBefore Time,
18081
+ * notAfter Time
18082
+ * }
18083
+ *
18084
+ * Time ::= CHOICE {
18085
+ * utcTime UTCTime,
18086
+ * generalTime GeneralizedTime
18087
+ * }
18088
+ *
18089
+ * UniqueIdentifier ::= BIT STRING
18090
+ *
18091
+ * SubjectPublicKeyInfo ::= SEQUENCE {
18092
+ * algorithm AlgorithmIdentifier,
18093
+ * subjectPublicKey BIT STRING
18094
+ * }
18095
+ *
18096
+ * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
18097
+ *
18098
+ * Extension ::= SEQUENCE {
18099
+ * extnID OBJECT IDENTIFIER,
18100
+ * critical BOOLEAN DEFAULT FALSE,
18101
+ * extnValue OCTET STRING
18102
+ * }
18103
+ *
18104
+ * The only key algorithm currently supported for PKI is RSA.
18105
+ *
18106
+ * RSASSA-PSS signatures are described in RFC 3447 and RFC 4055.
18107
+ *
18108
+ * PKCS#10 v1.7 describes certificate signing requests:
18109
+ *
18110
+ * CertificationRequestInfo:
18111
+ *
18112
+ * CertificationRequestInfo ::= SEQUENCE {
18113
+ * version INTEGER { v1(0) } (v1,...),
18114
+ * subject Name,
18115
+ * subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }},
18116
+ * attributes [0] Attributes{{ CRIAttributes }}
18117
+ * }
18118
+ *
18119
+ * Attributes { ATTRIBUTE:IOSet } ::= SET OF Attribute{{ IOSet }}
18120
+ *
18121
+ * CRIAttributes ATTRIBUTE ::= {
18122
+ * ... -- add any locally defined attributes here -- }
18123
+ *
18124
+ * Attribute { ATTRIBUTE:IOSet } ::= SEQUENCE {
18125
+ * type ATTRIBUTE.&id({IOSet}),
18126
+ * values SET SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{@type})
18127
+ * }
18128
+ *
18129
+ * CertificationRequest ::= SEQUENCE {
18130
+ * certificationRequestInfo CertificationRequestInfo,
18131
+ * signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }},
18132
+ * signature BIT STRING
18133
+ * }
18134
+ */
17090
18135
  var $iGlOy = parcelRequire("iGlOy");
17091
18136
 
17092
18137
 
17093
18138
 
17094
18139
  parcelRequire("ai0Z9");
17095
18140
  var $c01d1f977f850a49$exports = {};
17096
-
18141
+ /**
18142
+ * Node.js module for Forge mask generation functions.
18143
+ *
18144
+ * @author Stefan Siegl
18145
+ *
18146
+ * Copyright 2012 Stefan Siegl <stesie@brokenpipe.de>
18147
+ */
17097
18148
  var $iGlOy = parcelRequire("iGlOy");
17098
18149
  var $1a758e61c98aa2f6$exports = {};
17099
-
18150
+ /**
18151
+ * Javascript implementation of mask generation function MGF1.
18152
+ *
18153
+ * @author Stefan Siegl
18154
+ * @author Dave Longley
18155
+ *
18156
+ * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>
18157
+ * Copyright (c) 2014 Digital Bazaar, Inc.
18158
+ */
17100
18159
  var $iGlOy = parcelRequire("iGlOy");
17101
18160
 
17102
18161
  $iGlOy.mgf = $iGlOy.mgf || {};
@@ -17141,7 +18200,13 @@ $iGlOy.mgf.mgf1 = $iGlOy.mgf1;
17141
18200
 
17142
18201
 
17143
18202
  var $6aa068716df79957$exports = {};
17144
-
18203
+ /**
18204
+ * Javascript implementation of PKCS#1 PSS signature padding.
18205
+ *
18206
+ * @author Stefan Siegl
18207
+ *
18208
+ * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>
18209
+ */
17145
18210
  var $iGlOy = parcelRequire("iGlOy");
17146
18211
 
17147
18212
 
@@ -23392,7 +24457,12 @@ $e55982d45da68b81$var$hsTable[$e55982d45da68b81$var$tls.ConnectionEnd.server] =
23392
24457
  // cipher suites and compression methods size will need to be
23393
24458
  // updated if more get added to the list
23394
24459
  var sessionId = c.session.id;
23395
- var length = sessionId.length + 1 + 2 + 4 + 28 + 2 + cSuites + 1 + cMethods + extLength; // extensions vector
24460
+ var length = sessionId.length + 1 + // session ID vector
24461
+ 2 + // version (major + minor)
24462
+ 4 + 28 + // random time and random bytes
24463
+ 2 + cSuites + // cipher suites vector
24464
+ 1 + cMethods + // compression methods vector
24465
+ extLength; // extensions vector
23396
24466
  // build record fragment
23397
24467
  var rval = $iGlOy.util.createBuffer();
23398
24468
  rval.putByte($e55982d45da68b81$var$tls.HandshakeType.client_hello);
@@ -23415,7 +24485,11 @@ $e55982d45da68b81$var$hsTable[$e55982d45da68b81$var$tls.ConnectionEnd.server] =
23415
24485
  */ $e55982d45da68b81$var$tls.createServerHello = function(c) {
23416
24486
  // determine length of the handshake message
23417
24487
  var sessionId = c.session.id;
23418
- var length = sessionId.length + 1 + 2 + 4 + 28 + 2 + 1; // chosen compression method
24488
+ var length = sessionId.length + 1 + // session ID vector
24489
+ 2 + // version (major + minor)
24490
+ 4 + 28 + // random time and random bytes
24491
+ 2 + // chosen cipher suite
24492
+ 1; // chosen compression method
23419
24493
  // build record fragment
23420
24494
  var rval = $iGlOy.util.createBuffer();
23421
24495
  rval.putByte($e55982d45da68b81$var$tls.HandshakeType.server_hello);
@@ -24851,12 +25925,32 @@ function $48103dfbc323e2e4$var$initConnectionState(state, c, sp) {
24851
25925
 
24852
25926
 
24853
25927
  var $96695cc1b97188e1$exports = {};
24854
-
25928
+ /**
25929
+ * JavaScript implementation of Ed25519.
25930
+ *
25931
+ * Copyright (c) 2017-2019 Digital Bazaar, Inc.
25932
+ *
25933
+ * This implementation is based on the most excellent TweetNaCl which is
25934
+ * in the public domain. Many thanks to its contributors:
25935
+ *
25936
+ * https://github.com/dchest/tweetnacl-js
25937
+ */
24855
25938
  var $iGlOy = parcelRequire("iGlOy");
24856
25939
 
24857
25940
 
24858
25941
  var $33c8fc1a702f0359$exports = {};
24859
-
25942
+ /**
25943
+ * Secure Hash Algorithm with a 1024-bit block size implementation.
25944
+ *
25945
+ * This includes: SHA-512, SHA-384, SHA-512/224, and SHA-512/256. For
25946
+ * SHA-256 (block size 512 bits), see sha256.js.
25947
+ *
25948
+ * See FIPS 180-4 for details.
25949
+ *
25950
+ * @author Dave Longley
25951
+ *
25952
+ * Copyright (c) 2014-2015 Digital Bazaar, Inc.
25953
+ */
24860
25954
  var $iGlOy = parcelRequire("iGlOy");
24861
25955
  parcelRequire("ai0Z9");
24862
25956
 
@@ -25551,17 +26645,25 @@ var $33c8fc1a702f0359$var$_states = null;
25551
26645
  hi = w2[0];
25552
26646
  lo = w2[1];
25553
26647
  // high bits
25554
- t1_hi = ((hi >>> 19 | lo << 13) ^ (lo >>> 29 | hi << 3) ^ hi >>> 6) >>> 0; // SHR 6
26648
+ t1_hi = ((hi >>> 19 | lo << 13) ^ // ROTR 19
26649
+ (lo >>> 29 | hi << 3) ^ // ROTR 61/(swap + ROTR 29)
26650
+ hi >>> 6) >>> 0; // SHR 6
25555
26651
  // low bits
25556
- t1_lo = ((hi << 13 | lo >>> 19) ^ (lo << 3 | hi >>> 29) ^ (hi << 26 | lo >>> 6)) >>> 0; // SHR 6
26652
+ t1_lo = ((hi << 13 | lo >>> 19) ^ (// ROTR 19
26653
+ lo << 3 | hi >>> 29) ^ // ROTR 61/(swap + ROTR 29)
26654
+ (hi << 26 | lo >>> 6)) >>> 0; // SHR 6
25557
26655
  // for word 15 words ago: ROTR 1(x) ^ ROTR 8(x) ^ SHR 7(x)
25558
26656
  w15 = w[i - 15];
25559
26657
  hi = w15[0];
25560
26658
  lo = w15[1];
25561
26659
  // high bits
25562
- t2_hi = ((hi >>> 1 | lo << 31) ^ (hi >>> 8 | lo << 24) ^ hi >>> 7) >>> 0; // SHR 7
26660
+ t2_hi = ((hi >>> 1 | lo << 31) ^ // ROTR 1
26661
+ (hi >>> 8 | lo << 24) ^ // ROTR 8
26662
+ hi >>> 7) >>> 0; // SHR 7
25563
26663
  // low bits
25564
- t2_lo = ((hi << 31 | lo >>> 1) ^ (hi << 24 | lo >>> 8) ^ (hi << 25 | lo >>> 7)) >>> 0; // SHR 7
26664
+ t2_lo = ((hi << 31 | lo >>> 1) ^ // ROTR 1
26665
+ (hi << 24 | lo >>> 8) ^ (// ROTR 8
26666
+ hi << 25 | lo >>> 7)) >>> 0; // SHR 7
25565
26667
  // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^64 (carry lo overflow)
25566
26668
  w7 = w[i - 7];
25567
26669
  w16 = w[i - 16];
@@ -25589,14 +26691,22 @@ var $33c8fc1a702f0359$var$_states = null;
25589
26691
  // round function
25590
26692
  for(i = 0; i < 80; ++i){
25591
26693
  // Sum1(e) = ROTR 14(e) ^ ROTR 18(e) ^ ROTR 41(e)
25592
- s1_hi = ((e_hi >>> 14 | e_lo << 18) ^ (e_hi >>> 18 | e_lo << 14) ^ (e_lo >>> 9 | e_hi << 23)) >>> 0; // ROTR 41/(swap + ROTR 9)
25593
- s1_lo = ((e_hi << 18 | e_lo >>> 14) ^ (e_hi << 14 | e_lo >>> 18) ^ (e_lo << 23 | e_hi >>> 9)) >>> 0; // ROTR 41/(swap + ROTR 9)
26694
+ s1_hi = ((e_hi >>> 14 | e_lo << 18) ^ (// ROTR 14
26695
+ e_hi >>> 18 | e_lo << 14) ^ (// ROTR 18
26696
+ e_lo >>> 9 | e_hi << 23)) >>> 0; // ROTR 41/(swap + ROTR 9)
26697
+ s1_lo = ((e_hi << 18 | e_lo >>> 14) ^ // ROTR 14
26698
+ (e_hi << 14 | e_lo >>> 18) ^ (// ROTR 18
26699
+ e_lo << 23 | e_hi >>> 9)) >>> 0; // ROTR 41/(swap + ROTR 9)
25594
26700
  // Ch(e, f, g) (optimized the same way as SHA-1)
25595
26701
  ch_hi = (g_hi ^ e_hi & (f_hi ^ g_hi)) >>> 0;
25596
26702
  ch_lo = (g_lo ^ e_lo & (f_lo ^ g_lo)) >>> 0;
25597
26703
  // Sum0(a) = ROTR 28(a) ^ ROTR 34(a) ^ ROTR 39(a)
25598
- s0_hi = ((a_hi >>> 28 | a_lo << 4) ^ (a_lo >>> 2 | a_hi << 30) ^ (a_lo >>> 7 | a_hi << 25)) >>> 0; // ROTR 39/(swap + ROTR 7)
25599
- s0_lo = ((a_hi << 4 | a_lo >>> 28) ^ (a_lo << 30 | a_hi >>> 2) ^ (a_lo << 25 | a_hi >>> 7)) >>> 0; // ROTR 39/(swap + ROTR 7)
26704
+ s0_hi = ((a_hi >>> 28 | a_lo << 4) ^ (// ROTR 28
26705
+ a_lo >>> 2 | a_hi << 30) ^ // ROTR 34/(swap + ROTR 2)
26706
+ (a_lo >>> 7 | a_hi << 25)) >>> 0; // ROTR 39/(swap + ROTR 7)
26707
+ s0_lo = ((a_hi << 4 | a_lo >>> 28) ^ (// ROTR 28
26708
+ a_lo << 30 | a_hi >>> 2) ^ (// ROTR 34/(swap + ROTR 2)
26709
+ a_lo << 25 | a_hi >>> 7)) >>> 0; // ROTR 39/(swap + ROTR 7)
25600
26710
  // Maj(a, b, c) (optimized the same way as SHA-1)
25601
26711
  maj_hi = (a_hi & b_hi | c_hi & (a_hi ^ b_hi)) >>> 0;
25602
26712
  maj_lo = (a_lo & b_lo | c_lo & (a_lo ^ b_lo)) >>> 0;
@@ -25661,7 +26771,9 @@ var $33c8fc1a702f0359$var$_states = null;
25661
26771
 
25662
26772
 
25663
26773
 
25664
- var $4540a91b15e72417$export$fed72f95cdc10258;
26774
+ /**
26775
+ * Copyright (c) 2019 Digital Bazaar, Inc.
26776
+ */ var $4540a91b15e72417$export$fed72f95cdc10258;
25665
26777
  var $4540a91b15e72417$export$16f1063872153885;
25666
26778
 
25667
26779
  var $iGlOy = parcelRequire("iGlOy");
@@ -26767,7 +27879,15 @@ function $96695cc1b97188e1$var$M(o, a, b) {
26767
27879
 
26768
27880
 
26769
27881
  var $8866d3403f6374db$exports = {};
26770
-
27882
+ /**
27883
+ * Javascript implementation of RSA-KEM.
27884
+ *
27885
+ * @author Lautaro Cozzani Rodriguez
27886
+ * @author Dave Longley
27887
+ *
27888
+ * Copyright (c) 2014 Lautaro Cozzani <lautaro.cozzani@scytl.com>
27889
+ * Copyright (c) 2014 Digital Bazaar, Inc.
27890
+ */
26771
27891
  var $iGlOy = parcelRequire("iGlOy");
26772
27892
 
26773
27893
 
@@ -26900,7 +28020,13 @@ var $8866d3403f6374db$var$BigInteger = $iGlOy.jsbn.BigInteger;
26900
28020
 
26901
28021
 
26902
28022
  var $4b898e145571f67c$exports = {};
26903
-
28023
+ /**
28024
+ * Cross-browser support for logging in a web application.
28025
+ *
28026
+ * @author David I. Lehn <dlehn@digitalbazaar.com>
28027
+ *
28028
+ * Copyright (c) 2008-2013 Digital Bazaar, Inc.
28029
+ */
26904
28030
  var $iGlOy = parcelRequire("iGlOy");
26905
28031
 
26906
28032
  /* LOG API */ $4b898e145571f67c$exports = $iGlOy.log = $iGlOy.log || {};
@@ -27171,14 +28297,14 @@ $iGlOy.log.consoleLogger = $4b898e145571f67c$var$sConsoleLogger;
27171
28297
 
27172
28298
 
27173
28299
  var $8e579bac14cccf16$exports = {};
27174
-
27175
28300
  /**
27176
28301
  * Node.js module for all known Forge message digests.
27177
28302
  *
27178
28303
  * @author Dave Longley
27179
28304
  *
27180
28305
  * Copyright 2011-2017 Digital Bazaar, Inc.
27181
- */ $8e579bac14cccf16$exports = (parcelRequire("ai0Z9"));
28306
+ */
28307
+ $8e579bac14cccf16$exports = (parcelRequire("ai0Z9"));
27182
28308
 
27183
28309
 
27184
28310
 
@@ -27191,7 +28317,24 @@ var $8e579bac14cccf16$exports = {};
27191
28317
 
27192
28318
 
27193
28319
  var $e128d865c5cf51a7$exports = {};
27194
-
28320
+ /**
28321
+ * Javascript implementation of PKCS#7 v1.5.
28322
+ *
28323
+ * @author Stefan Siegl
28324
+ * @author Dave Longley
28325
+ *
28326
+ * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>
28327
+ * Copyright (c) 2012-2015 Digital Bazaar, Inc.
28328
+ *
28329
+ * Currently this implementation only supports ContentType of EnvelopedData,
28330
+ * EncryptedData, or SignedData at the root level. The top level elements may
28331
+ * contain only a ContentInfo of ContentType Data, i.e. plain data. Further
28332
+ * nesting is not (yet) supported.
28333
+ *
28334
+ * The Forge validators for PKCS #7's ASN.1 structures are available from
28335
+ * a separate file pkcs7asn1.js, since those are referenced from other
28336
+ * PKCS standards like PKCS #12.
28337
+ */
27195
28338
  var $iGlOy = parcelRequire("iGlOy");
27196
28339
 
27197
28340
 
@@ -27487,39 +28630,31 @@ $e128d865c5cf51a7$var$p7.createSignedData = function() {
27487
28630
  for(var i = 0; i < msg.signers.length; ++i){
27488
28631
  var signer = msg.signers[i];
27489
28632
  var oid = signer.digestAlgorithm;
27490
- if (!(oid in mds)) {
27491
- // content digest
27492
- mds[oid] = $iGlOy.md[$iGlOy.pki.oids[oid]].create();
27493
- }
27494
- if (signer.authenticatedAttributes.length === 0) {
27495
- // no custom attributes to digest; use content message digest
27496
- signer.md = mds[oid];
27497
- } else {
27498
- // custom attributes to be digested; use own message digest
27499
- // TODO: optimize to just copy message digest state if that
27500
- // feature is ever supported with message digests
27501
- signer.md = $iGlOy.md[$iGlOy.pki.oids[oid]].create();
27502
- }
28633
+ if (!(oid in mds)) // content digest
28634
+ mds[oid] = $iGlOy.md[$iGlOy.pki.oids[oid]].create();
28635
+ if (signer.authenticatedAttributes.length === 0) // no custom attributes to digest; use content message digest
28636
+ signer.md = mds[oid];
28637
+ else // custom attributes to be digested; use own message digest
28638
+ // TODO: optimize to just copy message digest state if that
28639
+ // feature is ever supported with message digests
28640
+ signer.md = $iGlOy.md[$iGlOy.pki.oids[oid]].create();
27503
28641
  }
27504
28642
  // add unique digest algorithm identifiers
27505
28643
  msg.digestAlgorithmIdentifiers = [];
27506
- for(var oid in mds){
27507
- msg.digestAlgorithmIdentifiers.push(// AlgorithmIdentifier
27508
- $e128d865c5cf51a7$var$asn1.create($e128d865c5cf51a7$var$asn1.Class.UNIVERSAL, $e128d865c5cf51a7$var$asn1.Type.SEQUENCE, true, [
27509
- // algorithm
27510
- $e128d865c5cf51a7$var$asn1.create($e128d865c5cf51a7$var$asn1.Class.UNIVERSAL, $e128d865c5cf51a7$var$asn1.Type.OID, false, $e128d865c5cf51a7$var$asn1.oidToDer(oid).getBytes()),
27511
- // parameters (null)
27512
- $e128d865c5cf51a7$var$asn1.create($e128d865c5cf51a7$var$asn1.Class.UNIVERSAL, $e128d865c5cf51a7$var$asn1.Type.NULL, false, "")
27513
- ]));
27514
- }
28644
+ for(var oid in mds)msg.digestAlgorithmIdentifiers.push(// AlgorithmIdentifier
28645
+ $e128d865c5cf51a7$var$asn1.create($e128d865c5cf51a7$var$asn1.Class.UNIVERSAL, $e128d865c5cf51a7$var$asn1.Type.SEQUENCE, true, [
28646
+ // algorithm
28647
+ $e128d865c5cf51a7$var$asn1.create($e128d865c5cf51a7$var$asn1.Class.UNIVERSAL, $e128d865c5cf51a7$var$asn1.Type.OID, false, $e128d865c5cf51a7$var$asn1.oidToDer(oid).getBytes()),
28648
+ // parameters (null)
28649
+ $e128d865c5cf51a7$var$asn1.create($e128d865c5cf51a7$var$asn1.Class.UNIVERSAL, $e128d865c5cf51a7$var$asn1.Type.NULL, false, "")
28650
+ ]));
27515
28651
  return mds;
27516
28652
  }
27517
28653
  function addSignerInfos(mds) {
27518
28654
  var content;
27519
- if (msg.detachedContent) {
27520
- // Signature has been made in detached mode.
27521
- content = msg.detachedContent;
27522
- } else {
28655
+ if (msg.detachedContent) // Signature has been made in detached mode.
28656
+ content = msg.detachedContent;
28657
+ else {
27523
28658
  // Note: ContentInfo is a SEQUENCE with 2 values, second value is
27524
28659
  // the content field and is optional for a ContentInfo but required here
27525
28660
  // since signers are present
@@ -27528,9 +28663,7 @@ $e128d865c5cf51a7$var$p7.createSignedData = function() {
27528
28663
  // skip [0] EXPLICIT content wrapper
27529
28664
  content = content.value[0];
27530
28665
  }
27531
- if (!content) {
27532
- throw new Error("Could not sign PKCS#7 message; there is no content to sign.");
27533
- }
28666
+ if (!content) throw new Error("Could not sign PKCS#7 message; there is no content to sign.");
27534
28667
  // get ContentInfo content type
27535
28668
  var contentType = $e128d865c5cf51a7$var$asn1.derToOid(msg.contentInfo.value[0].value);
27536
28669
  // serialize content
@@ -27542,9 +28675,7 @@ $e128d865c5cf51a7$var$p7.createSignedData = function() {
27542
28675
  $e128d865c5cf51a7$var$asn1.getBerValueLength(bytes);
27543
28676
  bytes = bytes.getBytes();
27544
28677
  // digest content DER value bytes
27545
- for(var oid in mds){
27546
- mds[oid].start().update(bytes);
27547
- }
28678
+ for(var oid in mds)mds[oid].start().update(bytes);
27548
28679
  // sign content
27549
28680
  var signingTime = new Date();
27550
28681
  for(var i = 0; i < msg.signers.length; ++i){
@@ -27552,9 +28683,7 @@ $e128d865c5cf51a7$var$p7.createSignedData = function() {
27552
28683
  if (signer.authenticatedAttributes.length === 0) {
27553
28684
  // if ContentInfo content type is not "Data", then
27554
28685
  // authenticatedAttributes must be present per RFC 2315
27555
- if (contentType !== $iGlOy.pki.oids.data) {
27556
- throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.");
27557
- }
28686
+ if (contentType !== $iGlOy.pki.oids.data) throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.");
27558
28687
  } else {
27559
28688
  // process authenticated attributes
27560
28689
  // [0] IMPLICIT
@@ -27564,14 +28693,11 @@ $e128d865c5cf51a7$var$p7.createSignedData = function() {
27564
28693
  var attrsAsn1 = $e128d865c5cf51a7$var$asn1.create($e128d865c5cf51a7$var$asn1.Class.UNIVERSAL, $e128d865c5cf51a7$var$asn1.Type.SET, true, []);
27565
28694
  for(var ai = 0; ai < signer.authenticatedAttributes.length; ++ai){
27566
28695
  var attr = signer.authenticatedAttributes[ai];
27567
- if (attr.type === $iGlOy.pki.oids.messageDigest) {
27568
- // use content message digest as value
27569
- attr.value = mds[signer.digestAlgorithm].digest();
27570
- } else if (attr.type === $iGlOy.pki.oids.signingTime) {
27571
- // auto-populate signing time if not already set
27572
- if (!attr.value) {
27573
- attr.value = signingTime;
27574
- }
28696
+ if (attr.type === $iGlOy.pki.oids.messageDigest) // use content message digest as value
28697
+ attr.value = mds[signer.digestAlgorithm].digest();
28698
+ else if (attr.type === $iGlOy.pki.oids.signingTime) // auto-populate signing time if not already set
28699
+ {
28700
+ if (!attr.value) attr.value = signingTime;
27575
28701
  }
27576
28702
  // convert to ASN.1 and push onto Attributes SET (for signing) and
27577
28703
  // onto authenticatedAttributesAsn1 to complete SignedData ASN.1
@@ -28138,7 +29264,16 @@ $e128d865c5cf51a7$var$p7.createSignedData = function() {
28138
29264
 
28139
29265
 
28140
29266
  var $85c6486b1bf8bee8$exports = {};
28141
-
29267
+ /**
29268
+ * Functions to output keys in SSH-friendly formats.
29269
+ *
29270
+ * This is part of the Forge project which may be used under the terms of
29271
+ * either the BSD License or the GNU General Public License (GPL) Version 2.
29272
+ *
29273
+ * See: https://github.com/digitalbazaar/forge/blob/cbebca3780658703d925b61b2caffb1d263a6c1d/LICENSE
29274
+ *
29275
+ * @author https://github.com/shellac
29276
+ */
28142
29277
  var $iGlOy = parcelRequire("iGlOy");
28143
29278
 
28144
29279
 
@@ -28457,8 +29592,49 @@ async function $186980c178984fd2$export$2e2bcd8739ae039(fs, options) {
28457
29592
  }
28458
29593
 
28459
29594
 
29595
+
29596
+
29597
+ const $3dff16cfd200ff25$var$ABSOLUTE_PATH_REGEX = /^([a-zA-Z]:){0,1}[\\/]+/;
29598
+ const $3dff16cfd200ff25$var$SEPARATOR_REGEX = /[\\]+/g;
29599
+ function $3dff16cfd200ff25$export$e434c7255acda994(filepath) {
29600
+ return $3dff16cfd200ff25$var$ABSOLUTE_PATH_REGEX.test(filepath);
29601
+ }
29602
+ function $3dff16cfd200ff25$export$16778b798ae8e49d(filePath) {
29603
+ return filePath.replace($3dff16cfd200ff25$var$SEPARATOR_REGEX, "/");
29604
+ }
29605
+ function $3dff16cfd200ff25$export$6af368f973c74c5(filePath, leadingDotSlash = true) {
29606
+ if (leadingDotSlash && (filePath[0] !== "." || filePath[1] !== "." && filePath[1] !== "/" && filePath[1] !== "\\") && !(0, ($parcel$interopDefault($8C1kk$path))).isAbsolute(filePath)) return $3dff16cfd200ff25$export$16778b798ae8e49d("./" + filePath);
29607
+ else return $3dff16cfd200ff25$export$16778b798ae8e49d(filePath);
29608
+ }
29609
+ function $3dff16cfd200ff25$export$7413eea5ad243d4(from, to, leadingDotSlash = true) {
29610
+ // Fast path
29611
+ if (to.startsWith(from + "/")) return (leadingDotSlash ? "./" : "") + to.slice(from.length + 1);
29612
+ return $3dff16cfd200ff25$export$6af368f973c74c5((0, ($parcel$interopDefault($8C1kk$path))).relative(from, to), leadingDotSlash);
29613
+ }
29614
+
29615
+
29616
+ function $313980afb666b13e$export$2e2bcd8739ae039(_name) {
29617
+ let name = (0, ($parcel$interopDefault($8C1kk$path))).normalize(_name);
29618
+ let splitOn = name.indexOf((0, ($parcel$interopDefault($8C1kk$path))).sep);
29619
+ if (name.charAt(0) === "@") splitOn = name.indexOf((0, ($parcel$interopDefault($8C1kk$path))).sep, splitOn + 1);
29620
+ if (splitOn < 0) return [
29621
+ (0, $3dff16cfd200ff25$export$16778b798ae8e49d)(name),
29622
+ undefined
29623
+ ];
29624
+ else return [
29625
+ (0, $3dff16cfd200ff25$export$16778b798ae8e49d)(name.substring(0, splitOn)),
29626
+ name.substring(splitOn + 1) || undefined
29627
+ ];
29628
+ }
29629
+
29630
+
28460
29631
  var $5aee5a8e09e874bf$exports = {};
28461
- var $49a059b76f641953$exports = {};
29632
+ /*!
29633
+ * is-glob <https://github.com/jonschlinkert/is-glob>
29634
+ *
29635
+ * Copyright (c) 2014-2017, Jon Schlinkert.
29636
+ * Released under the MIT License.
29637
+ */ var $49a059b76f641953$exports = {};
28462
29638
  /*!
28463
29639
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
28464
29640
  *
@@ -30999,27 +32175,17 @@ function $4609f2cae016f1ac$var$fastqueue(context, worker, concurrency) {
30999
32175
  }
31000
32176
  }
31001
32177
  function release(holder) {
31002
- if (holder) {
31003
- cache.release(holder);
31004
- }
32178
+ if (holder) cache.release(holder);
31005
32179
  var next = queueHead;
31006
32180
  if (next) {
31007
32181
  if (!self.paused) {
31008
- if (queueTail === queueHead) {
31009
- queueTail = null;
31010
- }
32182
+ if (queueTail === queueHead) queueTail = null;
31011
32183
  queueHead = next.next;
31012
32184
  next.next = null;
31013
32185
  worker.call(context, next.value, next.worked);
31014
- if (queueTail === null) {
31015
- self.empty();
31016
- }
31017
- } else {
31018
- _running--;
31019
- }
31020
- } else if (--_running === 0) {
31021
- self.drain();
31022
- }
32186
+ if (queueTail === null) self.empty();
32187
+ } else _running--;
32188
+ } else if (--_running === 0) self.drain();
31023
32189
  }
31024
32190
  function kill() {
31025
32191
  queueHead = null;
@@ -31882,25 +33048,6 @@ $b57e78be4f7a2622$exports = $b57e78be4f7a2622$var$FastGlob;
31882
33048
 
31883
33049
 
31884
33050
 
31885
- const $3dff16cfd200ff25$var$ABSOLUTE_PATH_REGEX = /^([a-zA-Z]:){0,1}[\\/]+/;
31886
- const $3dff16cfd200ff25$var$SEPARATOR_REGEX = /[\\]+/g;
31887
- function $3dff16cfd200ff25$export$e434c7255acda994(filepath) {
31888
- return $3dff16cfd200ff25$var$ABSOLUTE_PATH_REGEX.test(filepath);
31889
- }
31890
- function $3dff16cfd200ff25$export$16778b798ae8e49d(filePath) {
31891
- return filePath.replace($3dff16cfd200ff25$var$SEPARATOR_REGEX, "/");
31892
- }
31893
- function $3dff16cfd200ff25$export$6af368f973c74c5(filePath, leadingDotSlash = true) {
31894
- if (leadingDotSlash && (filePath[0] !== "." || filePath[1] !== "." && filePath[1] !== "/" && filePath[1] !== "\\") && !(0, ($parcel$interopDefault($8C1kk$path))).isAbsolute(filePath)) return $3dff16cfd200ff25$export$16778b798ae8e49d("./" + filePath);
31895
- else return $3dff16cfd200ff25$export$16778b798ae8e49d(filePath);
31896
- }
31897
- function $3dff16cfd200ff25$export$7413eea5ad243d4(from, to, leadingDotSlash = true) {
31898
- // Fast path
31899
- if (to.startsWith(from + "/")) return (leadingDotSlash ? "./" : "") + to.slice(from.length + 1);
31900
- return $3dff16cfd200ff25$export$6af368f973c74c5((0, ($parcel$interopDefault($8C1kk$path))).relative(from, to), leadingDotSlash);
31901
- }
31902
-
31903
-
31904
33051
  function $e8d0e504a4244d84$export$f3a2344a73dbdd42(p) {
31905
33052
  return (0, (/*@__PURE__*/$parcel$interopDefault($5aee5a8e09e874bf$exports)))((0, $3dff16cfd200ff25$export$16778b798ae8e49d)(p));
31906
33053
  }
@@ -32061,7 +33208,6 @@ function $ec068ba9e84f8eea$export$2e2bcd8739ae039(timeInMs) {
32061
33208
 
32062
33209
 
32063
33210
 
32064
-
32065
33211
  var $77226306a1863103$exports = {};
32066
33212
  "use strict";
32067
33213
  var $3124255f7fbe16f0$exports = {};
@@ -32338,8 +33484,8 @@ async function $f02d6a9d30f55938$export$2e2bcd8739ae039(diagnostic, options, ter
32338
33484
  let filePath = codeFrame.filePath;
32339
33485
  if (filePath != null && options && !(0, ($parcel$interopDefault($8C1kk$path))).isAbsolute(filePath)) filePath = (0, ($parcel$interopDefault($8C1kk$path))).join(options.projectRoot, filePath);
32340
33486
  let highlights = codeFrame.codeHighlights;
32341
- var _code;
32342
- let code = (_code = codeFrame.code) !== null && _code !== void 0 ? _code : options && await options.inputFS.readFile((0, (/*@__PURE__*/$parcel$interopDefault($812806c6461f2963$exports)))(filePath), "utf8");
33487
+ let code = codeFrame.code;
33488
+ if (code == null && options && filePath != null) code = await options.inputFS.readFile(filePath, "utf8");
32343
33489
  let formattedCodeFrame = "";
32344
33490
  if (code != null) formattedCodeFrame = (0, ($parcel$interopDefault($8C1kk$parcelcodeframe)))(code, highlights, {
32345
33491
  useColor: true,
@@ -32925,9 +34071,9 @@ function $e499d3e618e93ebd$export$2e2bcd8739ae039(fn, delay) {
32925
34071
 
32926
34072
 
32927
34073
  var $618f8c1de80a427f$exports = {};
32928
- "use strict";
32929
34074
 
32930
34075
  var $618f8c1de80a427f$var$$parcel$__dirname = $8C1kk$path.resolve(__dirname, "../../../../node_modules/open");
34076
+ "use strict";
32931
34077
 
32932
34078
  var $618f8c1de80a427f$require$promisify = $8C1kk$util.promisify;
32933
34079
 
@@ -34194,22 +35340,13 @@ var $5dc3ee1f90b35876$var$stringify = function stringify(value, replacer, space)
34194
35340
  function serializeProperty(key, holder) {
34195
35341
  let value = holder[key];
34196
35342
  if (value != null) {
34197
- if (typeof value.toJSON5 === "function") {
34198
- value = value.toJSON5(key);
34199
- } else if (typeof value.toJSON === "function") {
34200
- value = value.toJSON(key);
34201
- }
34202
- }
34203
- if (replacerFunc) {
34204
- value = replacerFunc.call(holder, key, value);
34205
- }
34206
- if (value instanceof Number) {
34207
- value = Number(value);
34208
- } else if (value instanceof String) {
34209
- value = String(value);
34210
- } else if (value instanceof Boolean) {
34211
- value = value.valueOf();
35343
+ if (typeof value.toJSON5 === "function") value = value.toJSON5(key);
35344
+ else if (typeof value.toJSON === "function") value = value.toJSON(key);
34212
35345
  }
35346
+ if (replacerFunc) value = replacerFunc.call(holder, key, value);
35347
+ if (value instanceof Number) value = Number(value);
35348
+ else if (value instanceof String) value = String(value);
35349
+ else if (value instanceof Boolean) value = value.valueOf();
34213
35350
  switch(value){
34214
35351
  case null:
34215
35352
  return "null";
@@ -34218,15 +35355,9 @@ var $5dc3ee1f90b35876$var$stringify = function stringify(value, replacer, space)
34218
35355
  case false:
34219
35356
  return "false";
34220
35357
  }
34221
- if (typeof value === "string") {
34222
- return quoteString(value, false);
34223
- }
34224
- if (typeof value === "number") {
34225
- return String(value);
34226
- }
34227
- if (typeof value === "object") {
34228
- return Array.isArray(value) ? serializeArray(value) : serializeObject(value);
34229
- }
35358
+ if (typeof value === "string") return quoteString(value, false);
35359
+ if (typeof value === "number") return String(value);
35360
+ if (typeof value === "object") return Array.isArray(value) ? serializeArray(value) : serializeObject(value);
34230
35361
  return undefined;
34231
35362
  }
34232
35363
  function quoteString(value) {
@@ -34279,9 +35410,7 @@ var $5dc3ee1f90b35876$var$stringify = function stringify(value, replacer, space)
34279
35410
  return quoteChar + product + quoteChar;
34280
35411
  }
34281
35412
  function serializeObject(value) {
34282
- if (stack.indexOf(value) >= 0) {
34283
- throw TypeError("Converting circular structure to JSON5");
34284
- }
35413
+ if (stack.indexOf(value) >= 0) throw TypeError("Converting circular structure to JSON5");
34285
35414
  stack.push(value);
34286
35415
  let stepback = indent;
34287
35416
  indent = indent + gap;
@@ -34291,17 +35420,14 @@ var $5dc3ee1f90b35876$var$stringify = function stringify(value, replacer, space)
34291
35420
  const propertyString = serializeProperty(key, value);
34292
35421
  if (propertyString !== undefined) {
34293
35422
  let member = serializeKey(key) + ":";
34294
- if (gap !== "") {
34295
- member += " ";
34296
- }
35423
+ if (gap !== "") member += " ";
34297
35424
  member += propertyString;
34298
35425
  partial.push(member);
34299
35426
  }
34300
35427
  }
34301
35428
  let final;
34302
- if (partial.length === 0) {
34303
- final = "{}";
34304
- } else {
35429
+ if (partial.length === 0) final = "{}";
35430
+ else {
34305
35431
  let properties;
34306
35432
  if (gap === "") {
34307
35433
  properties = partial.join(",");
@@ -34317,24 +35443,16 @@ var $5dc3ee1f90b35876$var$stringify = function stringify(value, replacer, space)
34317
35443
  return final;
34318
35444
  }
34319
35445
  function serializeKey(key) {
34320
- if (key.length === 0) {
34321
- return quoteString(key, true);
34322
- }
35446
+ if (key.length === 0) return quoteString(key, true);
34323
35447
  const firstChar = String.fromCodePoint(key.codePointAt(0));
34324
- if (!$5dc3ee1f90b35876$var$util.isIdStartChar(firstChar)) {
34325
- return quoteString(key, true);
34326
- }
35448
+ if (!$5dc3ee1f90b35876$var$util.isIdStartChar(firstChar)) return quoteString(key, true);
34327
35449
  for(let i = firstChar.length; i < key.length; i++){
34328
- if (!$5dc3ee1f90b35876$var$util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
34329
- return quoteString(key, true);
34330
- }
35450
+ if (!$5dc3ee1f90b35876$var$util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) return quoteString(key, true);
34331
35451
  }
34332
35452
  return key;
34333
35453
  }
34334
35454
  function serializeArray(value) {
34335
- if (stack.indexOf(value) >= 0) {
34336
- throw TypeError("Converting circular structure to JSON5");
34337
- }
35455
+ if (stack.indexOf(value) >= 0) throw TypeError("Converting circular structure to JSON5");
34338
35456
  stack.push(value);
34339
35457
  let stepback = indent;
34340
35458
  indent = indent + gap;
@@ -34344,17 +35462,14 @@ var $5dc3ee1f90b35876$var$stringify = function stringify(value, replacer, space)
34344
35462
  partial.push(propertyString !== undefined ? propertyString : "null");
34345
35463
  }
34346
35464
  let final;
34347
- if (partial.length === 0) {
34348
- final = "[]";
35465
+ if (partial.length === 0) final = "[]";
35466
+ else if (gap === "") {
35467
+ let properties = partial.join(",");
35468
+ final = "[" + properties + "]";
34349
35469
  } else {
34350
- if (gap === "") {
34351
- let properties = partial.join(",");
34352
- final = "[" + properties + "]";
34353
- } else {
34354
- let separator = ",\n" + indent;
34355
- let properties1 = partial.join(separator);
34356
- final = "[\n" + indent + properties1 + ",\n" + stepback + "]";
34357
- }
35470
+ let separator = ",\n" + indent;
35471
+ let properties1 = partial.join(separator);
35472
+ final = "[\n" + indent + properties1 + ",\n" + stepback + "]";
34358
35473
  }
34359
35474
  stack.pop();
34360
35475
  indent = stepback;
@@ -35203,7 +36318,7 @@ function $4b14026b40817fca$export$42462553d605d8cd(fs, filePath) {
35203
36318
  }
35204
36319
 
35205
36320
 
35206
- let $1c93db5abaa33eaa$export$8b1c306fed4227bf; // $FlowFixMe[prop-missing]
36321
+ /* global MessageChannel:readonly */ let $1c93db5abaa33eaa$export$8b1c306fed4227bf; // $FlowFixMe[prop-missing]
35207
36322
  if (process.browser) {
35208
36323
  $1c93db5abaa33eaa$export$8b1c306fed4227bf = ArrayBuffer; // Safari has removed the constructor
35209
36324
  if (typeof SharedArrayBuffer !== "undefined") {