Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
ee8f325b
Commit
ee8f325b
authored
Feb 26, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add timing info for flx creation
parent
0c05666e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
9 deletions
+18
-9
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+1
-1
flx.dart
packages/flutter_tools/lib/src/flx.dart
+6
-2
bundle.dart
packages/flx/lib/bundle.dart
+1
-1
signing.dart
packages/flx/lib/signing.dart
+9
-4
signing_test.dart
packages/flx/test/signing_test.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/commands/run.dart
View file @
ee8f325b
...
...
@@ -123,7 +123,7 @@ class RunCommand extends RunCommandBase {
debugPort:
debugPort
);
printTrace
(
'Finished
start
command.'
);
printTrace
(
'Finished
$name
command.'
);
return
result
;
}
}
...
...
packages/flutter_tools/lib/src/flx.dart
View file @
ee8f325b
...
...
@@ -256,7 +256,7 @@ Future<int> build(
Future
<
int
>
assemble
({
Map
manifestDescriptor:
const
{},
ArchiveFile
snapshotFile
:
null
,
ArchiveFile
snapshotFile
,
String
assetBasePath:
defaultAssetBasePath
,
String
materialAssetBasePath:
defaultMaterialAssetBasePath
,
String
outputPath:
defaultFlxOutputPath
,
...
...
@@ -287,11 +287,15 @@ Future<int> assemble({
if
(
fontManifest
!=
null
)
archive
.
addFile
(
fontManifest
);
await
CipherParameters
.
get
().
seedRandom
();
printTrace
(
'Calling CipherParameters.seedRandom().'
);
CipherParameters
.
get
().
seedRandom
();
AsymmetricKeyPair
keyPair
=
keyPairFromPrivateKeyFileSync
(
privateKeyPath
);
printTrace
(
'KeyPair from
$privateKeyPath
:
$keyPair
.'
);
printTrace
(
'Encoding zip file.'
);
Uint8List
zipBytes
=
new
Uint8List
.
fromList
(
new
ZipEncoder
().
encode
(
archive
));
ensureDirectoryExists
(
outputPath
);
printTrace
(
'Creating flx at
${outputPath}
.'
);
Bundle
bundle
=
new
Bundle
.
fromContent
(
path:
outputPath
,
manifest:
manifestDescriptor
,
...
...
packages/flx/lib/bundle.dart
View file @
ee8f325b
...
...
@@ -72,7 +72,7 @@ class Bundle {
this
.
path
,
this
.
manifest
,
contentBytes
,
AsymmetricKeyPair
keyPair
:
null
AsymmetricKeyPair
keyPair
})
:
_contentBytes
=
contentBytes
{
assert
(
path
!=
null
);
assert
(
manifest
!=
null
);
...
...
packages/flx/lib/signing.dart
View file @
ee8f325b
...
...
@@ -20,6 +20,7 @@ class CipherParameters {
final
String
signerAlgorithm
=
'SHA-256/ECDSA'
;
final
String
hashAlgorithm
=
'SHA-256'
;
final
ECDomainParameters
domain
=
new
ECDomainParameters
(
'prime256v1'
);
SecureRandom
get
random
{
if
(
_random
==
null
)
_initRandom
(
new
Uint8List
(
16
),
new
Uint8List
(
16
));
...
...
@@ -29,12 +30,16 @@ class CipherParameters {
// Seeds our secure random number generator using data from /dev/urandom.
// Disclaimer: I don't really understand why we need 2 parameters for
// pointycastle's API.
Future
seedRandom
()
async
{
void
seedRandom
()
{
if
(
_random
!=
null
)
return
;
try
{
RandomAccessFile
file
=
await
new
File
(
"/dev/urandom"
).
open
();
Uint8List
key
=
new
Uint8List
.
fromList
(
await
file
.
read
(
16
));
Uint8List
iv
=
new
Uint8List
.
fromList
(
await
file
.
read
(
16
));
RandomAccessFile
file
=
new
File
(
"/dev/urandom"
).
openSync
();
Uint8List
key
=
new
Uint8List
.
fromList
(
file
.
readSync
(
16
));
Uint8List
iv
=
new
Uint8List
.
fromList
(
file
.
readSync
(
16
));
_initRandom
(
key
,
iv
);
file
.
closeSync
();
}
on
FileSystemException
{
// TODO(mpcomplete): need an entropy source on Windows. We might get this
// for free from Dart itself soon.
...
...
packages/flx/test/signing_test.dart
View file @
ee8f325b
...
...
@@ -34,7 +34,7 @@ main() async {
// Set up a key generator.
CipherParameters
cipher
=
CipherParameters
.
get
();
await
cipher
.
seedRandom
();
cipher
.
seedRandom
();
ECKeyGeneratorParameters
ecParams
=
new
ECKeyGeneratorParameters
(
cipher
.
domain
);
ParametersWithRandom
<
ECKeyGeneratorParameters
>
keyGeneratorParams
=
new
ParametersWithRandom
<
ECKeyGeneratorParameters
>(
ecParams
,
cipher
.
random
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment