internal/outpost: fix incorrect usage of golang SHA API (#14981) Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: Jens L. <jens@goauthentik.io>
This commit is contained in:
		![98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com](/assets/img/avatar_default.png) gcp-cherry-pick-bot[bot]
					gcp-cherry-pick-bot[bot]
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							7a4518be26
						
					
				
				
					commit
					43637b8a75
				
			| @ -5,6 +5,7 @@ import ( | |||||||
| 	"crypto/sha256" | 	"crypto/sha256" | ||||||
| 	"crypto/tls" | 	"crypto/tls" | ||||||
| 	"encoding/gob" | 	"encoding/gob" | ||||||
|  | 	"encoding/hex" | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"html/template" | 	"html/template" | ||||||
| 	"net/http" | 	"net/http" | ||||||
| @ -118,8 +119,8 @@ func NewApplication(p api.ProxyOutpostConfig, c *http.Client, server Server, old | |||||||
| 	mux := mux.NewRouter() | 	mux := mux.NewRouter() | ||||||
|  |  | ||||||
| 	// Save cookie name, based on hashed client ID | 	// Save cookie name, based on hashed client ID | ||||||
| 	h := sha256.New() | 	hs := sha256.Sum256([]byte(*p.ClientId)) | ||||||
| 	bs := string(h.Sum([]byte(*p.ClientId))) | 	bs := hex.EncodeToString(hs[:]) | ||||||
| 	sessionName := fmt.Sprintf("authentik_proxy_%s", bs[:8]) | 	sessionName := fmt.Sprintf("authentik_proxy_%s", bs[:8]) | ||||||
|  |  | ||||||
| 	// When HOST_BROWSER is set, use that as Host header for token requests to make the issuer match | 	// When HOST_BROWSER is set, use that as Host header for token requests to make the issuer match | ||||||
|  | |||||||
| @ -2,6 +2,7 @@ package radius | |||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"crypto/sha512" | 	"crypto/sha512" | ||||||
|  | 	"encoding/hex" | ||||||
| 	"time" | 	"time" | ||||||
|  |  | ||||||
| 	"github.com/getsentry/sentry-go" | 	"github.com/getsentry/sentry-go" | ||||||
| @ -68,7 +69,9 @@ func (rs *RadiusServer) ServeRADIUS(w radius.ResponseWriter, r *radius.Request) | |||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 	if pi == nil { | 	if pi == nil { | ||||||
| 		nr.Log().WithField("hashed_secret", string(sha512.New().Sum(r.Secret))).Warning("No provider found") | 		hs := sha512.Sum512([]byte(r.Secret)) | ||||||
|  | 		bs := hex.EncodeToString(hs[:]) | ||||||
|  | 		nr.Log().WithField("hashed_secret", bs).Warning("No provider found") | ||||||
| 		_ = w.Write(r.Response(radius.CodeAccessReject)) | 		_ = w.Write(r.Response(radius.CodeAccessReject)) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user