Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enzevalos_iphone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
enzevalos
enzevalos_iphone
Commits
5f46dafd
Commit
5f46dafd
authored
5 years ago
by
lazarog98
Browse files
Options
Downloads
Patches
Plain Diff
#232
fix decrypt not forwarding sign key
parent
e089640f
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!58
Onboarding screens swift ui merge dev
,
!35
Resolve "SMIME Support"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
enzevalos_iphone/SMIME.swift
+9
-2
9 additions, 2 deletions
enzevalos_iphone/SMIME.swift
with
9 additions
and
2 deletions
enzevalos_iphone/SMIME.swift
+
9
−
2
View file @
5f46dafd
...
...
@@ -711,12 +711,13 @@ PkfA6mR7rtcyIbHi34tfkCv/qolV3QivMHov0IJpRyNO
let
verifyCryptoObj
=
verify
(
data
:
outputData
,
email
:
fromAddr
,
isMailNew
:
isMailNew
)
let
signKey
=
verifyCryptoObj
.
signKey
let
sigState
=
verifyCryptoObj
.
signatureState
let
addresses
=
verifyCryptoObj
.
signedAdrs
let
plainText
=
verifyCryptoObj
.
plaintext
let
decryptedData
=
plainText
!.
data
(
using
:
.
utf8
)
!
return
CryptoObject
(
chiphertext
:
data
,
plaintext
:
plainText
,
decryptedData
:
decryptedData
,
sigState
:
sigState
,
encState
:
encState
,
signKey
:
fp
,
encType
:
CryptoScheme
.
SMIME
,
signedAdrs
:
sigState
==
SignatureState
.
ValidSignature
?
addresses
:
[])
return
CryptoObject
(
chiphertext
:
data
,
plaintext
:
plainText
,
decryptedData
:
decryptedData
,
sigState
:
sigState
,
encState
:
encState
,
signKey
:
signKey
,
encType
:
CryptoScheme
.
SMIME
,
signedAdrs
:
sigState
==
SignatureState
.
ValidSignature
?
addresses
:
[])
}
func
sign
(
plainData
:
Data
,
myEmail
:
String
,
detached
:
Bool
=
true
)
throws
->
CryptoObject
{
...
...
@@ -811,7 +812,13 @@ PkfA6mR7rtcyIbHi34tfkCv/qolV3QivMHov0IJpRyNO
return
pem
}))
return
CryptoObject
(
chiphertext
:
data
,
plaintext
:
verStr
!
,
decryptedData
:
nil
,
sigState
:
sigState
,
encState
:
EncryptionState
.
NoEncryption
,
signKey
:
nil
,
encType
:
.
SMIME
,
signedAdrs
:
signedAddresses
)
let
signKeyFps
=
certsFPArr
!.
map
(
{
(
arg
)
->
String
in
let
(
fp
,
_
)
=
arg
return
fp
})
// TODO: set signKey to the entire array after CryptoObject has been modified to use multiple keys
return
CryptoObject
(
chiphertext
:
data
,
plaintext
:
verStr
!
,
decryptedData
:
nil
,
sigState
:
sigState
,
encState
:
EncryptionState
.
NoEncryption
,
signKey
:
signKeyFps
[
0
],
encType
:
.
SMIME
,
signedAdrs
:
signedAddresses
)
}
func
encrypt
(
plainData
:
Data
,
ids
:
[
String
],
ownId
:
String
,
encryptForMyId
:
Bool
=
true
)
throws
->
CryptoObject
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment