@ -32,7 +32,6 @@ import (
"flag"
"flag"
"fmt"
"fmt"
"io"
"io"
"io/ioutil"
"math/big"
"math/big"
"net"
"net"
"os"
"os"
@ -234,7 +233,7 @@ func initCertificates() {
* testCerts [ i ] . cert = cert
* testCerts [ i ] . cert = cert
}
}
channelIDPEMBlock , err := ioutil . ReadFile ( path . Join ( * resourceDir , channelIDKeyFile ) )
channelIDPEMBlock , err := os . ReadFile ( path . Join ( * resourceDir , channelIDKeyFile ) )
if err != nil {
if err != nil {
panic ( err )
panic ( err )
}
}
@ -294,7 +293,7 @@ type delegatedCredentialConfig struct {
func loadRSAPrivateKey ( filename string ) ( priv * rsa . PrivateKey , privPKCS8 [ ] byte , err error ) {
func loadRSAPrivateKey ( filename string ) ( priv * rsa . PrivateKey , privPKCS8 [ ] byte , err error ) {
pemPath := path . Join ( * resourceDir , filename )
pemPath := path . Join ( * resourceDir , filename )
pemBytes , err := ioutil . ReadFile ( pemPath )
pemBytes , err := os . ReadFile ( pemPath )
if err != nil {
if err != nil {
return nil , nil , err
return nil , nil , err
}
}
@ -712,7 +711,7 @@ func appendTranscript(path string, data []byte) error {
return nil
return nil
}
}
settings , err := ioutil . ReadFile ( path )
settings , err := os . ReadFile ( path )
if err != nil {
if err != nil {
if ! os . IsNotExist ( err ) {
if ! os . IsNotExist ( err ) {
return err
return err
@ -723,7 +722,7 @@ func appendTranscript(path string, data []byte) error {
}
}
settings = append ( settings , data ... )
settings = append ( settings , data ... )
return ioutil . WriteFile ( path , settings , 0644 )
return os . WriteFile ( path , settings , 0644 )
}
}
// A timeoutConn implements an idle timeout on each Read and Write operation.
// A timeoutConn implements an idle timeout on each Read and Write operation.
@ -822,7 +821,7 @@ func doExchange(test *testCase, config *Config, conn net.Conn, isResume bool, tr
bb := newByteBuilder ( )
bb := newByteBuilder ( )
bb . addU24LengthPrefixed ( ) . addBytes ( encodedInner )
bb . addU24LengthPrefixed ( ) . addBytes ( encodedInner )
bb . addBytes ( outer )
bb . addBytes ( outer )
return ioutil . WriteFile ( filepath . Join ( dir , name ) , bb . finish ( ) , 0644 )
return os . WriteFile ( filepath . Join ( dir , name ) , bb . finish ( ) , 0644 )
}
}
}
}
@ -1091,7 +1090,7 @@ func doExchange(test *testCase, config *Config, conn net.Conn, isResume bool, tr
return fmt . Errorf ( "messageLen < 0 not supported for DTLS tests" )
return fmt . Errorf ( "messageLen < 0 not supported for DTLS tests" )
}
}
// Read until EOF.
// Read until EOF.
_ , err := io . Copy ( ioutil . Discard , tlsConn )
_ , err := io . Copy ( io . Discard , tlsConn )
return err
return err
}
}
if messageLen == 0 {
if messageLen == 0 {
@ -16389,7 +16388,7 @@ func addJDK11WorkaroundTests() {
func addDelegatedCredentialTests ( ) {
func addDelegatedCredentialTests ( ) {
certPath := path . Join ( * resourceDir , rsaCertificateFile )
certPath := path . Join ( * resourceDir , rsaCertificateFile )
pemBytes , err := ioutil . ReadFile ( certPath )
pemBytes , err := os . ReadFile ( certPath )
if err != nil {
if err != nil {
panic ( err )
panic ( err )
}
}
@ -19553,7 +19552,7 @@ func main() {
initCertificates ( )
initCertificates ( )
if len ( * shimConfigFile ) != 0 {
if len ( * shimConfigFile ) != 0 {
encoded , err := ioutil . ReadFile ( * shimConfigFile )
encoded , err := os . ReadFile ( * shimConfigFile )
if err != nil {
if err != nil {
fmt . Fprintf ( os . Stderr , "Couldn't read config file %q: %s\n" , * shimConfigFile , err )
fmt . Fprintf ( os . Stderr , "Couldn't read config file %q: %s\n" , * shimConfigFile , err )
os . Exit ( 1 )
os . Exit ( 1 )