fix: 修复未赋予keypair scheme值问题

This commit is contained in:
Qu Xuan
2020-01-17 14:11:08 +08:00
parent b896ae5ca7
commit 75c22ea603
+3 -3
View File
@@ -170,9 +170,9 @@ func (manager *SKeypairManager) ValidateCreateData(ctx context.Context, userCred
}
// 只允许上传RSA格式密钥。PS: AWS只支持RSA格式。
scheme := seclib2.GetPublicKeyScheme(pubKey)
if scheme != api.KEYPAIRE_SCHEME_RSA {
return nil, httperrors.NewInputParameterError("Unsupported scheme %s", scheme)
input.Scheme = seclib2.GetPublicKeyScheme(pubKey)
if input.Scheme != api.KEYPAIRE_SCHEME_RSA {
return nil, httperrors.NewInputParameterError("Unsupported scheme %s", input.Scheme)
}
input.Fingerprint = ssh.FingerprintLegacyMD5(pubKey)