-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Support mbedTLS #3935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Support mbedTLS #3935
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
04a2b1d
mbedtls cmake config
wildart cfc27a3
define mbedtls global configuration
wildart d44d020
added certificate location setup
wildart a5958d0
introduced GIT_MBEDTLS symbol
wildart ad2b2e2
added git_mbedtls_stream_new
wildart 101ab46
proper certificate verification & cleanup of `git_mbedtls_stream_new`
wildart 46db15f
use libmbedcrypto for SHA1
wildart 369d23a
added new CI configuration for mbedtls
wildart 4f8968b
add mbedtls stream initialization
wildart cc156e4
update to 0.24.1
wildart f814681
turned on https feature for mbedtls
wildart 6b556a6
better search for CA certificates: using EVs and build-time macros
wildart a47a6bc
Merge branch 'mbedtls' of https://github.com/wildart/libgit2
joshtriplett 05ca19a
Update for current libgit2 API with struct git_proxy_options
joshtriplett 77cdc58
Cleanups for mbedTLS changes
joshtriplett dab8d43
mbedtls: Fix travis build
joshtriplett 81555f5
Move USE_MBEDTLS option under not-Darwin condition
joshtriplett File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
use libmbedcrypto for SHA1
- Loading branch information
commit 46db15f45bb8c3e36ceb4c48da9b2e54016282c0
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (C) the libgit2 contributors. All rights reserved. | ||
* | ||
* This file is part of libgit2, distributed under the GNU GPL v2 with | ||
* a Linking Exception. For full terms see the included COPYING file. | ||
*/ | ||
|
||
#include "common.h" | ||
#include "hash.h" | ||
#include "hash/hash_mbedtls.h" | ||
|
||
void git_hash_ctx_cleanup(git_hash_ctx *ctx) | ||
{ | ||
assert(ctx); | ||
mbedtls_sha1_free(&ctx->c); | ||
} | ||
|
||
int git_hash_init(git_hash_ctx *ctx) | ||
{ | ||
assert(ctx); | ||
mbedtls_sha1_init(&ctx->c); | ||
mbedtls_sha1_starts(&ctx->c); | ||
return 0; | ||
} | ||
|
||
int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len) | ||
{ | ||
assert(ctx); | ||
mbedtls_sha1_update(&ctx->c, data, len); | ||
return 0; | ||
} | ||
|
||
int git_hash_final(git_oid *out, git_hash_ctx *ctx) | ||
{ | ||
assert(ctx); | ||
mbedtls_sha1_finish(&ctx->c, out->id); | ||
return 0; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright (C) the libgit2 contributors. All rights reserved. | ||
* | ||
* This file is part of libgit2, distributed under the GNU GPL v2 with | ||
* a Linking Exception. For full terms see the included COPYING file. | ||
*/ | ||
|
||
#ifndef INCLUDE_hash_mbedtld_h__ | ||
#define INCLUDE_hash_mbedtld_h__ | ||
|
||
#include <mbedtls/sha1.h> | ||
|
||
struct git_hash_ctx { | ||
mbedtls_sha1_context c; | ||
}; | ||
|
||
#define git_hash_global_init() 0 | ||
#define git_hash_ctx_init(ctx) git_hash_init(ctx) | ||
|
||
#endif /* INCLUDE_hash_mbedtld_h__ */ | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line ending is missing.