]> Sergey Matveev's repositories - godlighty.git/blobdiff - handler.go
Streebog hash in .meta4 support
[godlighty.git] / handler.go
index a8a9e31b03835e3fae3078e84f3399b328717b38..e17583c4388f1aa901b89fb237e0eb8b2bb75e88 100644 (file)
@@ -1,6 +1,6 @@
 /*
 godlighty -- highly-customizable HTTP, HTTP/2, HTTPS server
-Copyright (C) 2021-2022 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2021-2023 Sergey Matveev <stargrave@stargrave.org>
 
 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
@@ -119,7 +119,9 @@ func (h Handler) Handle(
                return
        }
 
-       if cfg.TLS != nil && len(cfg.TLS.ClientCAs) > 0 {
+       if (cfg.ECDSATLS != nil && len(cfg.ECDSATLS.ClientCAs) > 0) ||
+               (cfg.EdDSATLS != nil && len(cfg.EdDSATLS.ClientCAs) > 0) ||
+               (cfg.GOSTTLS != nil && len(cfg.GOSTTLS.ClientCAs) > 0) {
                if r.TLS == nil {
                        err = errors.New("TLS client authentication required")
                        printErr(http.StatusForbidden, err)
@@ -276,6 +278,14 @@ IndexLookuped:
                        w.Header().Add("Digest", "SHA-512="+
                                base64.StdEncoding.EncodeToString(forHTTP.SHA512))
                }
+               if forHTTP.Streebog256 != nil {
+                       w.Header().Add("Digest", "Streebog-256="+
+                               base64.StdEncoding.EncodeToString(forHTTP.Streebog256))
+               }
+               if forHTTP.Streebog512 != nil {
+                       w.Header().Add("Digest", "Streebog-512="+
+                               base64.StdEncoding.EncodeToString(forHTTP.Streebog512))
+               }
        }
 SkipMeta4: