/*
GoCheese -- Python private package repository and caching proxy
-Copyright (C) 2019-2021 Sergey Matveev <stargrave@stargrave.org>
- 2019-2021 Elena Balakhonova <balakhonova_e@riseup.net>
+Copyright (C) 2019-2023 Sergey Matveev <stargrave@stargrave.org>
+ 2019-2023 Elena Balakhonova <balakhonova_e@riseup.net>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
)
const (
- Version = "3.4.0"
+ Version = "3.7.0"
UserAgent = "GoCheese/" + Version
)
log.Fatalln("Both -tls-cert and -tls-key are required")
}
+ UmaskCur = syscall.Umask(0)
+ syscall.Umask(UmaskCur)
+
var err error
PyPIURLParsed, err = url.Parse(*PyPIURL)
if err != nil {
tlsConfig.VerifyConnection = func(s tls.ConnectionState) error {
spki := s.VerifiedChains[0][0].RawSubjectPublicKeyInfo
theirDgst := sha256.Sum256(spki)
- if bytes.Compare(ourDgst, theirDgst[:]) != 0 {
+ if !bytes.Equal(ourDgst, theirDgst[:]) {
return errors.New("certificate's SPKI digest mismatch")
}
return nil