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
39a04dcd
Unverified
Commit
39a04dcd
authored
Aug 07, 2019
by
Christopher Fujino
Committed by
GitHub
Aug 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support macOS Catalina-style signing certificate names (#37733)
parent
69248258
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
1 deletion
+68
-1
code_signing.dart
packages/flutter_tools/lib/src/ios/code_signing.dart
+1
-1
code_signing_test.dart
...utter_tools/test/general.shard/ios/code_signing_test.dart
+67
-0
No files found.
packages/flutter_tools/lib/src/ios/code_signing.dart
View file @
39a04dcd
...
@@ -79,7 +79,7 @@ const String fixWithDevelopmentTeamInstruction = '''
...
@@ -79,7 +79,7 @@ const String fixWithDevelopmentTeamInstruction = '''
final RegExp _securityFindIdentityDeveloperIdentityExtractionPattern =
final RegExp _securityFindIdentityDeveloperIdentityExtractionPattern =
RegExp(r'
^
\
s
*
\
d
+
\
).+
"(.+Develop
er
.+)"
$
');
RegExp(r'
^
\
s
*
\
d
+
\
).+
"(.+Develop
(ment|er)
.+)"
$
');
final RegExp _securityFindIdentityCertificateCnExtractionPattern = RegExp(r'
.*
\
(([
a
-
zA
-
Z0
-
9
]+)
\
)
');
final RegExp _securityFindIdentityCertificateCnExtractionPattern = RegExp(r'
.*
\
(([
a
-
zA
-
Z0
-
9
]+)
\
)
');
final RegExp _certificateOrganizationalUnitExtractionPattern = RegExp(r'
OU
=([
a
-
zA
-
Z0
-
9
]+)
');
final RegExp _certificateOrganizationalUnitExtractionPattern = RegExp(r'
OU
=([
a
-
zA
-
Z0
-
9
]+)
');
...
...
packages/flutter_tools/test/general.shard/ios/code_signing_test.dart
View file @
39a04dcd
...
@@ -153,6 +153,73 @@ void main() {
...
@@ -153,6 +153,73 @@ void main() {
OutputPreferences:
()
=>
OutputPreferences
(
wrapText:
false
),
OutputPreferences:
()
=>
OutputPreferences
(
wrapText:
false
),
});
});
testUsingContext
(
'Test single identity (Catalina format) and certificate organization works'
,
()
async
{
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'security'
]))
.
thenReturn
(
exitsHappy
);
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
.
thenReturn
(
exitsHappy
);
when
(
mockProcessManager
.
runSync
(
argThat
(
contains
(
'find-identity'
)),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenReturn
(
ProcessResult
(
1
,
// pid
0
,
// exitCode
'''
1) 86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 "Apple Development: Profile 1 (1111AAAA11)"
1 valid identities found'''
,
''
,
));
when
(
mockProcessManager
.
runSync
(
<
String
>[
'security'
,
'find-certificate'
,
'-c'
,
'1111AAAA11'
,
'-p'
],
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenReturn
(
ProcessResult
(
1
,
// pid
0
,
// exitCode
'This is a mock certificate'
,
''
,
));
final
MockProcess
mockProcess
=
MockProcess
();
final
MockStdIn
mockStdIn
=
MockStdIn
();
final
MockStream
mockStdErr
=
MockStream
();
when
(
mockProcessManager
.
start
(
argThat
(
contains
(
'openssl'
)),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenAnswer
((
Invocation
invocation
)
=>
Future
<
Process
>.
value
(
mockProcess
));
when
(
mockProcess
.
stdin
).
thenReturn
(
mockStdIn
);
when
(
mockProcess
.
stdout
)
.
thenAnswer
((
Invocation
invocation
)
=>
Stream
<
List
<
int
>>.
fromFuture
(
Future
<
List
<
int
>>.
value
(
utf8
.
encode
(
'subject= /CN=iPhone Developer: Profile 1 (1111AAAA11)/OU=3333CCCC33/O=My Team/C=US'
))
));
when
(
mockProcess
.
stderr
).
thenAnswer
((
Invocation
invocation
)
=>
mockStdErr
);
when
(
mockProcess
.
exitCode
).
thenAnswer
((
_
)
async
=>
0
);
Map
<
String
,
String
>
signingConfigs
;
try
{
signingConfigs
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
);
}
catch
(
e
)
{
// This should not throw
expect
(
true
,
false
);
}
expect
(
testLogger
.
statusText
,
contains
(
'Apple Development: Profile 1 (1111AAAA11)'
));
expect
(
testLogger
.
errorText
,
isEmpty
);
verify
(
mockStdIn
.
write
(
'This is a mock certificate'
));
expect
(
signingConfigs
,
<
String
,
String
>{
'DEVELOPMENT_TEAM'
:
'3333CCCC33'
});
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
OutputPreferences:
()
=>
OutputPreferences
(
wrapText:
false
),
});
testUsingContext
(
'Test multiple identity and certificate organization works'
,
()
async
{
testUsingContext
(
'Test multiple identity and certificate organization works'
,
()
async
{
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'security'
]))
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'security'
]))
.
thenReturn
(
exitsHappy
);
.
thenReturn
(
exitsHappy
);
...
...
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