• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / mender / 1022753986

02 Oct 2023 10:37AM UTC coverage: 78.168% (-2.0%) from 80.127%
1022753986

push

gitlab-ci

oleorhagen
feat: Run the authentication loop once upon bootstrap

Ticket: MEN-6658
Changelog: None

Signed-off-by: Ole Petter <ole.orhagen@northern.tech>

32 of 32 new or added lines in 1 file covered. (100.0%)

6996 of 8950 relevant lines covered (78.17%)

10353.4 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

37.5
/common/crypto/crypto.cpp
1
// Copyright 2023 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14

15
#include <common/crypto.hpp>
16

17
#include <string>
18

19
namespace mender {
20
namespace common {
21
namespace crypto {
22

23

24
const CryptoErrorCategoryClass CryptoErrorCategory;
25

26
const char *CryptoErrorCategoryClass::name() const noexcept {
×
27
        return "CryptoErrorCategory";
×
28
}
29

30
string CryptoErrorCategoryClass::message(int code) const {
3✔
31
        switch (code) {
3✔
32
        case NoError:
×
33
                return "Success";
×
34
        case SetupError:
3✔
35
                return "Error during crypto library setup";
3✔
36
        case Base64Error:
×
37
                return "Base64 encoding error";
×
38
        case VerificationError:
×
39
                return "Signature verification error";
×
40
        default:
×
41
                return "Unknown";
×
42
        }
43
}
44

45
error::Error MakeError(CryptoErrorCode code, const string &msg) {
16✔
46
        return error::Error(error_condition(code, CryptoErrorCategory), msg);
32✔
47
}
48

49
} // namespace crypto
50
} // namespace common
51
} // namespace mender
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc