cordova-plugin-mserviceinterface-2.0 1.0.22 → 1.0.26

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.
Files changed (59) hide show
  1. package/package.json +28 -28
  2. package/plugin.xml +153 -153
  3. package/src/android/CallbackProgressDialog.java +53 -53
  4. package/src/android/FileProvider.java +7 -7
  5. package/src/android/backgroundNotification.java +120 -120
  6. package/src/android/doubleogradle.gradle +5 -5
  7. package/src/android/mInterface.java +2087 -2065
  8. package/src/android/mInterfaceReceiver.java +59 -59
  9. package/src/android/mInterfaceService.java +749 -749
  10. package/src/android/mInterfaceUtil.java +1686 -1686
  11. package/src/android/res/xml/network_security_config.xml +8 -8
  12. package/src/android/res/xml/opener_paths.xml +16 -16
  13. package/src/ios/InternetConnection.h +64 -64
  14. package/src/ios/InternetConnection.m +242 -242
  15. package/src/ios/SSZipArchive.h +146 -146
  16. package/src/ios/SSZipArchive.m +1180 -1180
  17. package/src/ios/SSZipCommon.h +66 -66
  18. package/src/ios/UICKeyChainStore.h +64 -64
  19. package/src/ios/UICKeyChainStore.m +434 -434
  20. package/src/ios/XMLConverter.h +61 -61
  21. package/src/ios/XMLConverter.m +243 -243
  22. package/src/ios/ZipArchive.h +19 -19
  23. package/src/ios/aes/aes.h +270 -270
  24. package/src/ios/aes/aes_ni.c +687 -687
  25. package/src/ios/aes/aes_ni.h +59 -59
  26. package/src/ios/aes/aescrypt.c +301 -301
  27. package/src/ios/aes/aeskey.c +554 -554
  28. package/src/ios/aes/aesopt.h +776 -776
  29. package/src/ios/aes/aestab.c +418 -418
  30. package/src/ios/aes/aestab.h +173 -173
  31. package/src/ios/aes/brg_endian.h +127 -127
  32. package/src/ios/aes/brg_types.h +191 -191
  33. package/src/ios/aes/fileenc.c +145 -145
  34. package/src/ios/aes/fileenc.h +121 -121
  35. package/src/ios/aes/hmac.c +209 -209
  36. package/src/ios/aes/hmac.h +119 -119
  37. package/src/ios/aes/prng.c +155 -155
  38. package/src/ios/aes/prng.h +82 -82
  39. package/src/ios/aes/pwd2key.c +181 -181
  40. package/src/ios/aes/pwd2key.h +45 -45
  41. package/src/ios/aes/sha1.c +283 -283
  42. package/src/ios/aes/sha1.h +72 -72
  43. package/src/ios/mInterface.h +2 -0
  44. package/src/ios/mInterface.m +21 -1
  45. package/src/ios/minizip/crypt.c +146 -146
  46. package/src/ios/minizip/crypt.h +66 -66
  47. package/src/ios/minizip/ioapi.c +353 -353
  48. package/src/ios/minizip/ioapi.h +154 -154
  49. package/src/ios/minizip/ioapi_buf.c +452 -452
  50. package/src/ios/minizip/ioapi_buf.h +52 -52
  51. package/src/ios/minizip/ioapi_mem.c +167 -167
  52. package/src/ios/minizip/ioapi_mem.h +52 -52
  53. package/src/ios/minizip/minishared.c +292 -292
  54. package/src/ios/minizip/minishared.h +50 -50
  55. package/src/ios/minizip/unzip.c +2007 -2007
  56. package/src/ios/minizip/unzip.h +254 -254
  57. package/src/ios/minizip/zip.c +2007 -2007
  58. package/src/ios/minizip/zip.h +215 -215
  59. package/www/mInterface.js +3 -3
@@ -1,181 +1,181 @@
1
- /*
2
- ---------------------------------------------------------------------------
3
- Copyright (c) 1998-2010, Brian Gladman, Worcester, UK. All rights reserved.
4
-
5
- The redistribution and use of this software (with or without changes)
6
- is allowed without the payment of fees or royalties provided that:
7
-
8
- source code distributions include the above copyright notice, this
9
- list of conditions and the following disclaimer;
10
-
11
- binary distributions include the above copyright notice, this list
12
- of conditions and the following disclaimer in their documentation.
13
-
14
- This software is provided 'as is' with no explicit or implied warranties
15
- in respect of its operation, including, but not limited to, correctness
16
- and fitness for purpose.
17
- ---------------------------------------------------------------------------
18
- Issue Date: 20/12/2007
19
-
20
- This is an implementation of RFC2898, which specifies key derivation from
21
- a password and a salt value.
22
- */
23
-
24
- #include <string.h>
25
- #include "hmac.h"
26
-
27
- #if defined(__cplusplus)
28
- extern "C"
29
- {
30
- #endif
31
-
32
- void derive_key(const unsigned char pwd[], /* the PASSWORD */
33
- unsigned int pwd_len, /* and its length */
34
- const unsigned char salt[], /* the SALT and its */
35
- unsigned int salt_len, /* length */
36
- unsigned int iter, /* the number of iterations */
37
- unsigned char key[], /* space for the output key */
38
- unsigned int key_len)/* and its required length */
39
- {
40
- unsigned int i, j, k, n_blk, h_size;
41
- unsigned char uu[HMAC_MAX_OUTPUT_SIZE], ux[HMAC_MAX_OUTPUT_SIZE];
42
- hmac_ctx c1[1], c2[1], c3[1];
43
-
44
- /* set HMAC context (c1) for password */
45
- h_size = hmac_sha_begin(HMAC_SHA1, c1);
46
- hmac_sha_key(pwd, pwd_len, c1);
47
-
48
- /* set HMAC context (c2) for password and salt */
49
- memcpy(c2, c1, sizeof(hmac_ctx));
50
- hmac_sha_data(salt, salt_len, c2);
51
-
52
- /* find the number of SHA blocks in the key */
53
- n_blk = 1 + (key_len - 1) / h_size;
54
-
55
- for(i = 0; i < n_blk; ++i) /* for each block in key */
56
- {
57
- /* ux[] holds the running xor value */
58
- memset(ux, 0, h_size);
59
-
60
- /* set HMAC context (c3) for password and salt */
61
- memcpy(c3, c2, sizeof(hmac_ctx));
62
-
63
- /* enter additional data for 1st block into uu */
64
- uu[0] = (unsigned char)((i + 1) >> 24);
65
- uu[1] = (unsigned char)((i + 1) >> 16);
66
- uu[2] = (unsigned char)((i + 1) >> 8);
67
- uu[3] = (unsigned char)(i + 1);
68
-
69
- /* this is the key mixing iteration */
70
- for(j = 0, k = 4; j < iter; ++j)
71
- {
72
- /* add previous round data to HMAC */
73
- hmac_sha_data(uu, k, c3);
74
-
75
- /* obtain HMAC for uu[] */
76
- hmac_sha_end(uu, h_size, c3);
77
-
78
- /* xor into the running xor block */
79
- for(k = 0; k < h_size; ++k)
80
- ux[k] ^= uu[k];
81
-
82
- /* set HMAC context (c3) for password */
83
- memcpy(c3, c1, sizeof(hmac_ctx));
84
- }
85
-
86
- /* compile key blocks into the key output */
87
- j = 0; k = i * h_size;
88
- while(j < h_size && k < key_len)
89
- key[k++] = ux[j++];
90
- }
91
- }
92
-
93
- #ifdef TEST
94
-
95
- #include <stdio.h>
96
-
97
- struct
98
- { unsigned int pwd_len;
99
- unsigned int salt_len;
100
- unsigned int it_count;
101
- unsigned char *pwd;
102
- unsigned char salt[32];
103
- unsigned char key[32];
104
- } tests[] =
105
- {
106
- { 8, 4, 5, (unsigned char*)"password",
107
- {
108
- 0x12, 0x34, 0x56, 0x78
109
- },
110
- {
111
- 0x5c, 0x75, 0xce, 0xf0, 0x1a, 0x96, 0x0d, 0xf7,
112
- 0x4c, 0xb6, 0xb4, 0x9b, 0x9e, 0x38, 0xe6, 0xb5
113
- }
114
- },
115
- { 8, 8, 5, (unsigned char*)"password",
116
- {
117
- 0x12, 0x34, 0x56, 0x78, 0x78, 0x56, 0x34, 0x12
118
- },
119
- {
120
- 0xd1, 0xda, 0xa7, 0x86, 0x15, 0xf2, 0x87, 0xe6,
121
- 0xa1, 0xc8, 0xb1, 0x20, 0xd7, 0x06, 0x2a, 0x49
122
- }
123
- },
124
- { 8, 21, 1, (unsigned char*)"password",
125
- {
126
- "ATHENA.MIT.EDUraeburn"
127
- },
128
- {
129
- 0xcd, 0xed, 0xb5, 0x28, 0x1b, 0xb2, 0xf8, 0x01,
130
- 0x56, 0x5a, 0x11, 0x22, 0xb2, 0x56, 0x35, 0x15
131
- }
132
- },
133
- { 8, 21, 2, (unsigned char*)"password",
134
- {
135
- "ATHENA.MIT.EDUraeburn"
136
- },
137
- {
138
- 0x01, 0xdb, 0xee, 0x7f, 0x4a, 0x9e, 0x24, 0x3e,
139
- 0x98, 0x8b, 0x62, 0xc7, 0x3c, 0xda, 0x93, 0x5d
140
- }
141
- },
142
- { 8, 21, 1200, (unsigned char*)"password",
143
- {
144
- "ATHENA.MIT.EDUraeburn"
145
- },
146
- {
147
- 0x5c, 0x08, 0xeb, 0x61, 0xfd, 0xf7, 0x1e, 0x4e,
148
- 0x4e, 0xc3, 0xcf, 0x6b, 0xa1, 0xf5, 0x51, 0x2b
149
- }
150
- }
151
- };
152
-
153
- int main()
154
- { unsigned int i, j, key_len = 256;
155
- unsigned char key[256];
156
-
157
- printf("\nTest of RFC2898 Password Based Key Derivation");
158
- for(i = 0; i < 5; ++i)
159
- {
160
- derive_key(tests[i].pwd, tests[i].pwd_len, tests[i].salt,
161
- tests[i].salt_len, tests[i].it_count, key, key_len);
162
-
163
- printf("\ntest %i: ", i + 1);
164
- printf("key %s", memcmp(tests[i].key, key, 16) ? "is bad" : "is good");
165
- for(j = 0; j < key_len && j < 64; j += 4)
166
- {
167
- if(j % 16 == 0)
168
- printf("\n");
169
- printf("0x%02x%02x%02x%02x ", key[j], key[j + 1], key[j + 2], key[j + 3]);
170
- }
171
- printf(j < key_len ? " ... \n" : "\n");
172
- }
173
- printf("\n");
174
- return 0;
175
- }
176
-
177
- #if defined(__cplusplus)
178
- }
179
- #endif
180
-
181
- #endif
1
+ /*
2
+ ---------------------------------------------------------------------------
3
+ Copyright (c) 1998-2010, Brian Gladman, Worcester, UK. All rights reserved.
4
+
5
+ The redistribution and use of this software (with or without changes)
6
+ is allowed without the payment of fees or royalties provided that:
7
+
8
+ source code distributions include the above copyright notice, this
9
+ list of conditions and the following disclaimer;
10
+
11
+ binary distributions include the above copyright notice, this list
12
+ of conditions and the following disclaimer in their documentation.
13
+
14
+ This software is provided 'as is' with no explicit or implied warranties
15
+ in respect of its operation, including, but not limited to, correctness
16
+ and fitness for purpose.
17
+ ---------------------------------------------------------------------------
18
+ Issue Date: 20/12/2007
19
+
20
+ This is an implementation of RFC2898, which specifies key derivation from
21
+ a password and a salt value.
22
+ */
23
+
24
+ #include <string.h>
25
+ #include "hmac.h"
26
+
27
+ #if defined(__cplusplus)
28
+ extern "C"
29
+ {
30
+ #endif
31
+
32
+ void derive_key(const unsigned char pwd[], /* the PASSWORD */
33
+ unsigned int pwd_len, /* and its length */
34
+ const unsigned char salt[], /* the SALT and its */
35
+ unsigned int salt_len, /* length */
36
+ unsigned int iter, /* the number of iterations */
37
+ unsigned char key[], /* space for the output key */
38
+ unsigned int key_len)/* and its required length */
39
+ {
40
+ unsigned int i, j, k, n_blk, h_size;
41
+ unsigned char uu[HMAC_MAX_OUTPUT_SIZE], ux[HMAC_MAX_OUTPUT_SIZE];
42
+ hmac_ctx c1[1], c2[1], c3[1];
43
+
44
+ /* set HMAC context (c1) for password */
45
+ h_size = hmac_sha_begin(HMAC_SHA1, c1);
46
+ hmac_sha_key(pwd, pwd_len, c1);
47
+
48
+ /* set HMAC context (c2) for password and salt */
49
+ memcpy(c2, c1, sizeof(hmac_ctx));
50
+ hmac_sha_data(salt, salt_len, c2);
51
+
52
+ /* find the number of SHA blocks in the key */
53
+ n_blk = 1 + (key_len - 1) / h_size;
54
+
55
+ for(i = 0; i < n_blk; ++i) /* for each block in key */
56
+ {
57
+ /* ux[] holds the running xor value */
58
+ memset(ux, 0, h_size);
59
+
60
+ /* set HMAC context (c3) for password and salt */
61
+ memcpy(c3, c2, sizeof(hmac_ctx));
62
+
63
+ /* enter additional data for 1st block into uu */
64
+ uu[0] = (unsigned char)((i + 1) >> 24);
65
+ uu[1] = (unsigned char)((i + 1) >> 16);
66
+ uu[2] = (unsigned char)((i + 1) >> 8);
67
+ uu[3] = (unsigned char)(i + 1);
68
+
69
+ /* this is the key mixing iteration */
70
+ for(j = 0, k = 4; j < iter; ++j)
71
+ {
72
+ /* add previous round data to HMAC */
73
+ hmac_sha_data(uu, k, c3);
74
+
75
+ /* obtain HMAC for uu[] */
76
+ hmac_sha_end(uu, h_size, c3);
77
+
78
+ /* xor into the running xor block */
79
+ for(k = 0; k < h_size; ++k)
80
+ ux[k] ^= uu[k];
81
+
82
+ /* set HMAC context (c3) for password */
83
+ memcpy(c3, c1, sizeof(hmac_ctx));
84
+ }
85
+
86
+ /* compile key blocks into the key output */
87
+ j = 0; k = i * h_size;
88
+ while(j < h_size && k < key_len)
89
+ key[k++] = ux[j++];
90
+ }
91
+ }
92
+
93
+ #ifdef TEST
94
+
95
+ #include <stdio.h>
96
+
97
+ struct
98
+ { unsigned int pwd_len;
99
+ unsigned int salt_len;
100
+ unsigned int it_count;
101
+ unsigned char *pwd;
102
+ unsigned char salt[32];
103
+ unsigned char key[32];
104
+ } tests[] =
105
+ {
106
+ { 8, 4, 5, (unsigned char*)"password",
107
+ {
108
+ 0x12, 0x34, 0x56, 0x78
109
+ },
110
+ {
111
+ 0x5c, 0x75, 0xce, 0xf0, 0x1a, 0x96, 0x0d, 0xf7,
112
+ 0x4c, 0xb6, 0xb4, 0x9b, 0x9e, 0x38, 0xe6, 0xb5
113
+ }
114
+ },
115
+ { 8, 8, 5, (unsigned char*)"password",
116
+ {
117
+ 0x12, 0x34, 0x56, 0x78, 0x78, 0x56, 0x34, 0x12
118
+ },
119
+ {
120
+ 0xd1, 0xda, 0xa7, 0x86, 0x15, 0xf2, 0x87, 0xe6,
121
+ 0xa1, 0xc8, 0xb1, 0x20, 0xd7, 0x06, 0x2a, 0x49
122
+ }
123
+ },
124
+ { 8, 21, 1, (unsigned char*)"password",
125
+ {
126
+ "ATHENA.MIT.EDUraeburn"
127
+ },
128
+ {
129
+ 0xcd, 0xed, 0xb5, 0x28, 0x1b, 0xb2, 0xf8, 0x01,
130
+ 0x56, 0x5a, 0x11, 0x22, 0xb2, 0x56, 0x35, 0x15
131
+ }
132
+ },
133
+ { 8, 21, 2, (unsigned char*)"password",
134
+ {
135
+ "ATHENA.MIT.EDUraeburn"
136
+ },
137
+ {
138
+ 0x01, 0xdb, 0xee, 0x7f, 0x4a, 0x9e, 0x24, 0x3e,
139
+ 0x98, 0x8b, 0x62, 0xc7, 0x3c, 0xda, 0x93, 0x5d
140
+ }
141
+ },
142
+ { 8, 21, 1200, (unsigned char*)"password",
143
+ {
144
+ "ATHENA.MIT.EDUraeburn"
145
+ },
146
+ {
147
+ 0x5c, 0x08, 0xeb, 0x61, 0xfd, 0xf7, 0x1e, 0x4e,
148
+ 0x4e, 0xc3, 0xcf, 0x6b, 0xa1, 0xf5, 0x51, 0x2b
149
+ }
150
+ }
151
+ };
152
+
153
+ int main()
154
+ { unsigned int i, j, key_len = 256;
155
+ unsigned char key[256];
156
+
157
+ printf("\nTest of RFC2898 Password Based Key Derivation");
158
+ for(i = 0; i < 5; ++i)
159
+ {
160
+ derive_key(tests[i].pwd, tests[i].pwd_len, tests[i].salt,
161
+ tests[i].salt_len, tests[i].it_count, key, key_len);
162
+
163
+ printf("\ntest %i: ", i + 1);
164
+ printf("key %s", memcmp(tests[i].key, key, 16) ? "is bad" : "is good");
165
+ for(j = 0; j < key_len && j < 64; j += 4)
166
+ {
167
+ if(j % 16 == 0)
168
+ printf("\n");
169
+ printf("0x%02x%02x%02x%02x ", key[j], key[j + 1], key[j + 2], key[j + 3]);
170
+ }
171
+ printf(j < key_len ? " ... \n" : "\n");
172
+ }
173
+ printf("\n");
174
+ return 0;
175
+ }
176
+
177
+ #if defined(__cplusplus)
178
+ }
179
+ #endif
180
+
181
+ #endif
@@ -1,45 +1,45 @@
1
- /*
2
- ---------------------------------------------------------------------------
3
- Copyright (c) 1998-2010, Brian Gladman, Worcester, UK. All rights reserved.
4
-
5
- The redistribution and use of this software (with or without changes)
6
- is allowed without the payment of fees or royalties provided that:
7
-
8
- source code distributions include the above copyright notice, this
9
- list of conditions and the following disclaimer;
10
-
11
- binary distributions include the above copyright notice, this list
12
- of conditions and the following disclaimer in their documentation.
13
-
14
- This software is provided 'as is' with no explicit or implied warranties
15
- in respect of its operation, including, but not limited to, correctness
16
- and fitness for purpose.
17
- ---------------------------------------------------------------------------
18
- Issue Date: 20/12/2007
19
-
20
- This is an implementation of RFC2898, which specifies key derivation from
21
- a password and a salt value.
22
- */
23
-
24
- #ifndef PWD2KEY_H
25
- #define PWD2KEY_H
26
-
27
- #if defined(__cplusplus)
28
- extern "C"
29
- {
30
- #endif
31
-
32
- void derive_key(
33
- const unsigned char pwd[], /* the PASSWORD, and */
34
- unsigned int pwd_len, /* its length */
35
- const unsigned char salt[], /* the SALT and its */
36
- unsigned int salt_len, /* length */
37
- unsigned int iter, /* the number of iterations */
38
- unsigned char key[], /* space for the output key */
39
- unsigned int key_len); /* and its required length */
40
-
41
- #if defined(__cplusplus)
42
- }
43
- #endif
44
-
45
- #endif
1
+ /*
2
+ ---------------------------------------------------------------------------
3
+ Copyright (c) 1998-2010, Brian Gladman, Worcester, UK. All rights reserved.
4
+
5
+ The redistribution and use of this software (with or without changes)
6
+ is allowed without the payment of fees or royalties provided that:
7
+
8
+ source code distributions include the above copyright notice, this
9
+ list of conditions and the following disclaimer;
10
+
11
+ binary distributions include the above copyright notice, this list
12
+ of conditions and the following disclaimer in their documentation.
13
+
14
+ This software is provided 'as is' with no explicit or implied warranties
15
+ in respect of its operation, including, but not limited to, correctness
16
+ and fitness for purpose.
17
+ ---------------------------------------------------------------------------
18
+ Issue Date: 20/12/2007
19
+
20
+ This is an implementation of RFC2898, which specifies key derivation from
21
+ a password and a salt value.
22
+ */
23
+
24
+ #ifndef PWD2KEY_H
25
+ #define PWD2KEY_H
26
+
27
+ #if defined(__cplusplus)
28
+ extern "C"
29
+ {
30
+ #endif
31
+
32
+ void derive_key(
33
+ const unsigned char pwd[], /* the PASSWORD, and */
34
+ unsigned int pwd_len, /* its length */
35
+ const unsigned char salt[], /* the SALT and its */
36
+ unsigned int salt_len, /* length */
37
+ unsigned int iter, /* the number of iterations */
38
+ unsigned char key[], /* space for the output key */
39
+ unsigned int key_len); /* and its required length */
40
+
41
+ #if defined(__cplusplus)
42
+ }
43
+ #endif
44
+
45
+ #endif