-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3287dd
commit 020e802
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved. | ||
// See the file LICENSE for licensing terms. | ||
|
||
package staking | ||
|
||
import ( | ||
"testing" | ||
|
||
_ "embed" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
var ( | ||
//go:embed large_rsa_key.cert | ||
largeRSAKeyCert []byte | ||
//go:embed large_rsa_key.sig | ||
largeRSAKeySig []byte | ||
) | ||
|
||
func TestCheckSignatureLargePublicKey(t *testing.T) { | ||
require := require.New(t) | ||
|
||
cert, err := ParseCertificate(largeRSAKeyCert) | ||
require.NoError(err) | ||
|
||
msg := []byte("TODO: put something clever") | ||
err = CheckSignature(cert, msg, largeRSAKeySig) | ||
require.ErrorIs(err, ErrInvalidRSAPublicKey) | ||
} |