Skip to content
This repository has been archived by the owner on Oct 2, 2022. It is now read-only.

Commit

Permalink
Removed weak crypto in test code
Browse files Browse the repository at this point in the history
  • Loading branch information
Janos Pasztor committed Mar 16, 2021
1 parent 759f8a8 commit 7b3a2df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package sshserver

import (
"bytes"
cryptoRand "crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
Expand Down Expand Up @@ -78,8 +79,7 @@ func (u *TestUser) RandomPassword() {

// GenerateKey generates a public and private key pair that can be used to authenticate with this user.
func (u *TestUser) GenerateKey() (privateKeyPEM string, publicKeyAuthorizedKeys string) {
random := rand.New(rand.NewSource(time.Now().UnixNano()))
privateKey, err := rsa.GenerateKey(random, 4096)
privateKey, err := rsa.GenerateKey(cryptoRand.Reader, 4096)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 7b3a2df

Please sign in to comment.