From b202941b79fd22081df25dfa3662635de26af194 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Wed, 15 May 2024 00:21:52 +0300 Subject: [PATCH] fix tsa settings --- app/controllers/timestamp_server_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/timestamp_server_controller.rb b/app/controllers/timestamp_server_controller.rb index d7bbdfb4..814331a3 100644 --- a/app/controllers/timestamp_server_controller.rb +++ b/app/controllers/timestamp_server_controller.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class TimestampServerController < ApplicationController + HASH_ALGORITHM = 'SHA256' + before_action :build_encrypted_config authorize_resource :encrypted_config @@ -24,8 +26,8 @@ class TimestampServerController < ApplicationController def test_timeserver_url(url) req = OpenSSL::Timestamp::Request.new - req.algorithm = 'SHA512' - req.message_imprint = 'test' + req.algorithm = HASH_ALGORITHM + req.message_imprint = OpenSSL::Digest.digest(HASH_ALGORITHM, 'test') uri = Addressable::URI.parse(url)