mirror of
https://github.com/actions/runner.git
synced 2025-12-10 12:36:23 +00:00
Set JWT.alg to PS256 with PssPadding. (#3789)
This commit is contained in:
@@ -25,7 +25,10 @@ namespace GitHub.Services.WebApi.Jwt
|
||||
HS256,
|
||||
|
||||
[EnumMember]
|
||||
RS256
|
||||
RS256,
|
||||
|
||||
[EnumMember]
|
||||
PS256,
|
||||
}
|
||||
|
||||
//JsonWebToken is marked as DataContract so
|
||||
@@ -286,6 +289,7 @@ namespace GitHub.Services.WebApi.Jwt
|
||||
{
|
||||
case JWTAlgorithm.HS256:
|
||||
case JWTAlgorithm.RS256:
|
||||
case JWTAlgorithm.PS256:
|
||||
return signingCredentials.SignData(bytes);
|
||||
|
||||
default:
|
||||
|
||||
@@ -166,6 +166,21 @@ namespace GitHub.Services.WebApi
|
||||
}
|
||||
}
|
||||
|
||||
public override JWTAlgorithm SignatureAlgorithm
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_signaturePadding == RSASignaturePadding.Pss)
|
||||
{
|
||||
return JWTAlgorithm.PS256;
|
||||
}
|
||||
else
|
||||
{
|
||||
return base.SignatureAlgorithm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override Byte[] GetSignature(Byte[] input)
|
||||
{
|
||||
using (var rsa = m_factory())
|
||||
|
||||
Reference in New Issue
Block a user