1
1
'use strict' ;
2
2
3
- Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
4
-
5
3
var tldts = require ( 'tldts' ) ;
6
4
var punycode = require ( 'punycode' ) ;
7
5
var jose = require ( 'jose' ) ;
@@ -12,10 +10,7 @@ var base64 = require('@hexagon/base64');
12
10
var platformCrypto = require ( 'crypto' ) ;
13
11
var peculiarCrypto = require ( '@peculiar/webcrypto' ) ;
14
12
15
- function _interopDefaultLegacy ( e ) { return e && typeof e === 'object' && 'default' in e ? e : { 'default' : e } ; }
16
-
17
- function _interopNamespace ( e ) {
18
- if ( e && e . __esModule ) return e ;
13
+ function _interopNamespaceDefault ( e ) {
19
14
var n = Object . create ( null ) ;
20
15
if ( e ) {
21
16
Object . keys ( e ) . forEach ( function ( k ) {
@@ -28,15 +23,13 @@ function _interopNamespace(e) {
28
23
}
29
24
} ) ;
30
25
}
31
- n [ " default" ] = e ;
26
+ n . default = e ;
32
27
return Object . freeze ( n ) ;
33
28
}
34
29
35
- var punycode__default = /*#__PURE__*/ _interopDefaultLegacy ( punycode ) ;
36
- var cborX__namespace = /*#__PURE__*/ _interopNamespace ( cborX ) ;
37
- var base64__default = /*#__PURE__*/ _interopDefaultLegacy ( base64 ) ;
38
- var platformCrypto__namespace = /*#__PURE__*/ _interopNamespace ( platformCrypto ) ;
39
- var peculiarCrypto__namespace = /*#__PURE__*/ _interopNamespace ( peculiarCrypto ) ;
30
+ var cborX__namespace = /*#__PURE__*/ _interopNamespaceDefault ( cborX ) ;
31
+ var platformCrypto__namespace = /*#__PURE__*/ _interopNamespaceDefault ( platformCrypto ) ;
32
+ var peculiarCrypto__namespace = /*#__PURE__*/ _interopNamespaceDefault ( peculiarCrypto ) ;
40
33
41
34
class Certificate {
42
35
constructor ( cert ) {
@@ -1436,7 +1429,7 @@ function validEtldPlusOne(value) {
1436
1429
1437
1430
function validDomainName ( value ) {
1438
1431
// Before we can validate we need to take care of IDNs with unicode chars.
1439
- const ascii = punycode__default [ "default" ] . toASCII ( value ) ;
1432
+ const ascii = punycode . toASCII ( value ) ;
1440
1433
1441
1434
if ( ascii . length < 1 ) {
1442
1435
// return 'DOMAIN_TOO_SHORT';
@@ -1601,7 +1594,7 @@ async function getEmbeddedJwk(jwsHeader, alg) {
1601
1594
1602
1595
var toolbox = /*#__PURE__*/ Object . freeze ( {
1603
1596
__proto__ : null ,
1604
- base64 : base64__default [ "default" ] ,
1597
+ base64 : base64 ,
1605
1598
cbor : cborX__namespace ,
1606
1599
checkDomainOrUrl : checkDomainOrUrl ,
1607
1600
checkOrigin : checkOrigin ,
@@ -1711,7 +1704,7 @@ function coerceToArrayBuffer$1(buf, name) {
1711
1704
// base64 to base64url
1712
1705
buf = buf . replace ( / \+ / g, "-" ) . replace ( / \/ / g, "_" ) . replace ( "=" , "" ) ;
1713
1706
// base64 to Buffer
1714
- buf = base64__default [ "default" ] . toArrayBuffer ( buf , true ) ;
1707
+ buf = base64 . toArrayBuffer ( buf , true ) ;
1715
1708
}
1716
1709
1717
1710
// Extract typed array from Array
@@ -1745,7 +1738,7 @@ function coerceToBase64(thing, name) {
1745
1738
1746
1739
if ( typeof thing !== "string" ) {
1747
1740
try {
1748
- thing = base64__default [ "default" ] . fromArrayBuffer (
1741
+ thing = base64 . fromArrayBuffer (
1749
1742
coerceToArrayBuffer$1 ( thing , name ) ,
1750
1743
) ;
1751
1744
} catch ( _err ) {
@@ -1777,7 +1770,7 @@ function coerceToBase64Url(thing, name) {
1777
1770
1778
1771
if ( typeof thing !== "string" ) {
1779
1772
try {
1780
- thing = base64__default [ "default" ] . fromArrayBuffer (
1773
+ thing = base64 . fromArrayBuffer (
1781
1774
coerceToArrayBuffer$1 ( thing , name ) ,
1782
1775
true ,
1783
1776
) ;
@@ -1826,7 +1819,7 @@ function b64ToJsObject(b64, desc) {
1826
1819
}
1827
1820
1828
1821
function jsObjectToB64 ( obj ) {
1829
- return base64__default [ "default" ] . fromString (
1822
+ return base64 . fromString (
1830
1823
JSON . stringify ( obj ) . replace ( / [ \u{0080} - \u{FFFF} ] / gu, "" ) ,
1831
1824
) ;
1832
1825
}
@@ -1855,13 +1848,13 @@ function pemToBase64(pem) {
1855
1848
1856
1849
var utils = /*#__PURE__*/ Object . freeze ( {
1857
1850
__proto__ : null ,
1858
- arrayBufferEquals : arrayBufferEquals ,
1851
+ ab2str : ab2str ,
1859
1852
abToBuf : abToBuf$1 ,
1860
1853
abToHex : abToHex ,
1861
1854
abToInt : abToInt ,
1862
1855
abToPem : abToPem ,
1863
- ab2str : ab2str ,
1864
1856
appendBuffer : appendBuffer$1 ,
1857
+ arrayBufferEquals : arrayBufferEquals ,
1865
1858
b64ToJsObject : b64ToJsObject ,
1866
1859
coerceToArrayBuffer : coerceToArrayBuffer$1 ,
1867
1860
coerceToBase64 : coerceToBase64 ,
@@ -3686,7 +3679,7 @@ class MdsCollection {
3686
3679
3687
3680
return this . entryList . get ( id . replace ( / - / g, "" ) ) ||
3688
3681
this . entryList . get (
3689
- abToHex ( base64__default [ "default" ] . toArrayBuffer ( id , true ) ) . replace ( / - / g, "" ) ,
3682
+ abToHex ( base64 . toArrayBuffer ( id , true ) ) . replace ( / - / g, "" ) ,
3690
3683
) || null ;
3691
3684
}
3692
3685
}
@@ -4274,7 +4267,7 @@ async function androidSafetyNetValidateFn() {
4274
4267
// create hash of the concatenation
4275
4268
const hash = await hashDigest ( concatenated ) ;
4276
4269
4277
- const nonce = base64__default [ "default" ] . fromArrayBuffer ( hash ) ;
4270
+ const nonce = base64 . fromArrayBuffer ( hash ) ;
4278
4271
4279
4272
// check result
4280
4273
if ( nonce !== parsedJws . payload . nonce ) {
0 commit comments