File tree Expand file tree Collapse file tree 3 files changed +47
-3
lines changed
AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings Expand file tree Collapse file tree 3 files changed +47
-3
lines changed Original file line number Diff line number Diff line change
1
+ # This workflow checks if you are checking in dafny code
2
+ # with the keyword {:only}, it adds a message to the pull
3
+ # request to remind you to remove it.
4
+ name : Check {:only} decorator presence
5
+
6
+ on :
7
+ pull_request :
8
+
9
+ jobs :
10
+ grep-only-verification-keyword :
11
+ runs-on : ubuntu-latest
12
+ permissions :
13
+ issues : write
14
+ pull-requests : write
15
+ steps :
16
+ - uses : actions/checkout@v3
17
+ with :
18
+ fetch-depth : 0
19
+
20
+ - name : Check only keyword
21
+ id : only-keyword
22
+ shell : bash
23
+ run :
24
+ # checking in code with the dafny decorator {:only}
25
+ # will not verify the entire file or maybe the entire project depending on its configuration
26
+ # This action checks if you are either adding or removing the {:only} decorator and posting on the pr if you are.
27
+ echo "ONLY_KEYWORD=$(git diff origin/main origin/${GITHUB_HEAD_REF} **/*.dfy | grep -i {:only})" >> "$GITHUB_OUTPUT"
28
+
29
+ - name : Check if ONLY_KEYWORD is not empty
30
+ id : comment
31
+ env :
32
+ PR_NUMBER : ${{ github.event.number }}
33
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34
+ ONLY_KEYWORD : ${{ steps.only-keyword.outputs.ONLY_KEYWORD }}
35
+ if : ${{env.ONLY_KEYWORD != ''}}
36
+ run : |
37
+ COMMENT="It looks like you are adding or removing the dafny keyword {:only}.\nIs this intended?"
38
+ COMMENT_URL="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
39
+ curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST $COMMENT_URL -d "{\"body\":\"$COMMENT\"}"
40
+ exit 1
Original file line number Diff line number Diff line change @@ -439,7 +439,6 @@ module {:options "/functionSyntax:4" } AwsKmsEcdhKeyring {
439
439
{
440
440
const materials: Materials. DecryptionMaterialsPendingPlaintextDataKey
441
441
const cryptoPrimitives: Primitives. AtomicPrimitivesClient
442
- const senderPublicKey: seq < uint8>
443
442
const recipientPublicKey: seq < uint8>
444
443
const client: KMS. IKMSClient
445
444
const grantTokens: KMS. GrantTokenList
@@ -582,6 +581,11 @@ module {:options "/functionSyntax:4" } AwsKmsEcdhKeyring {
582
581
}
583
582
}
584
583
584
+ :- Need (
585
+ KMS.IsValid_PublicKeyType(sharedSecretPublicKey),
586
+ E ("Received Recipient Public Key of incorrect expected length")
587
+ );
588
+
585
589
// = aws-encryption-sdk-specification/framework/aws-kms/aws-kms-ecdh-keyring.md#ondecrypt
586
590
// # The keyring MUST derive the shared secret
587
591
// # by calling [AWS KMS DeriveSharedSecret]()
Original file line number Diff line number Diff line change @@ -541,7 +541,7 @@ module {:options "/functionSyntax:4" } RawECDHKeyring {
541
541
&& Materials. DecryptionMaterialsTransitionIsValid (materials, res.value)
542
542
543
543
}
544
- method {:vcs_split_on_every_assert} {:only} Invoke (
544
+ method {:vcs_split_on_every_assert} Invoke (
545
545
edk: Types .EncryptedDataKey,
546
546
ghost attemptsState: seq <ActionInvoke <Types.EncryptedDataKey, Result<Materials.SealedDecryptionMaterials, Types.Error>>>
547
547
) returns (res: Result< Materials. SealedDecryptionMaterials, Types. Error> )
@@ -851,4 +851,4 @@ module {:options "/functionSyntax:4" } RawECDHKeyring {
851
851
function E (s : string ) : Types. Error {
852
852
Types. AwsCryptographicMaterialProvidersException (message := s)
853
853
}
854
- }
854
+ }
You can’t perform that action at this time.
0 commit comments