mirror of
				https://github.com/containers/podman.git
				synced 2025-10-31 10:00:01 +08:00 
			
		
		
		
	 d3f59bedb3
			
		
	
	d3f59bedb3
	
	
	
		
			
			This requires updating all import paths throughout, and a matching buildah update to interoperate. I can't figure out the reason for go.mod tracking github.com/containers/image v3.0.2+incompatible // indirect ((go mod graph) lists it as a direct dependency of libpod, but (go list -json -m all) lists it as an indirect dependency), but at least looking at the vendor subdirectory, it doesn't seem to be actually used in the built binaries. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
		
			
				
	
	
		
			25 lines
		
	
	
		
			471 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			471 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // +build libtrust_openssl
 | |
| 
 | |
| package libtrust
 | |
| 
 | |
| import (
 | |
| 	"bytes"
 | |
| 	"crypto"
 | |
| 	"crypto/ecdsa"
 | |
| 	"crypto/rand"
 | |
| 	"fmt"
 | |
| 	"io"
 | |
| 	"math/big"
 | |
| )
 | |
| 
 | |
| func (k *ecPrivateKey) sign(data io.Reader, hashID crypto.Hash) (r, s *big.Int, err error) {
 | |
| 	hId := k.signatureAlgorithm.HashID()
 | |
| 	buf := new(bytes.Buffer)
 | |
| 	_, err = buf.ReadFrom(data)
 | |
| 	if err != nil {
 | |
| 		return nil, nil, fmt.Errorf("error reading data: %s", err)
 | |
| 	}
 | |
| 
 | |
| 	return ecdsa.HashSign(rand.Reader, k.PrivateKey, buf.Bytes(), hId)
 | |
| }
 |