Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
03d9b930
Commit
03d9b930
authored
Jul 09, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Indent with tabs
parent
5813bc21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
src/transports/cred.c
+15
-15
No files found.
src/transports/cred.c
View file @
03d9b930
...
@@ -67,12 +67,12 @@ static void ssh_keyfile_passphrase_free(struct git_cred *cred)
...
@@ -67,12 +67,12 @@ static void ssh_keyfile_passphrase_free(struct git_cred *cred)
git__free
(
c
->
publickey
);
git__free
(
c
->
publickey
);
git__free
(
c
->
privatekey
);
git__free
(
c
->
privatekey
);
if
(
c
->
passphrase
)
{
if
(
c
->
passphrase
)
{
/* Zero the memory which previously held the passphrase */
/* Zero the memory which previously held the passphrase */
size_t
pass_len
=
strlen
(
c
->
passphrase
);
size_t
pass_len
=
strlen
(
c
->
passphrase
);
git__memzero
(
c
->
passphrase
,
pass_len
);
git__memzero
(
c
->
passphrase
,
pass_len
);
git__free
(
c
->
passphrase
);
git__free
(
c
->
passphrase
);
}
}
memset
(
c
,
0
,
sizeof
(
*
c
));
memset
(
c
,
0
,
sizeof
(
*
c
));
...
@@ -83,10 +83,10 @@ static void ssh_publickey_free(struct git_cred *cred)
...
@@ -83,10 +83,10 @@ static void ssh_publickey_free(struct git_cred *cred)
{
{
git_cred_ssh_publickey
*
c
=
(
git_cred_ssh_publickey
*
)
cred
;
git_cred_ssh_publickey
*
c
=
(
git_cred_ssh_publickey
*
)
cred
;
git__free
(
c
->
publickey
);
git__free
(
c
->
publickey
);
c
->
sign_callback
=
NULL
;
c
->
sign_callback
=
NULL
;
c
->
sign_data
=
NULL
;
c
->
sign_data
=
NULL
;
memset
(
c
,
0
,
sizeof
(
*
c
));
memset
(
c
,
0
,
sizeof
(
*
c
));
...
@@ -109,10 +109,10 @@ int git_cred_ssh_keyfile_passphrase_new(
...
@@ -109,10 +109,10 @@ int git_cred_ssh_keyfile_passphrase_new(
c
->
parent
.
credtype
=
GIT_CREDTYPE_SSH_KEYFILE_PASSPHRASE
;
c
->
parent
.
credtype
=
GIT_CREDTYPE_SSH_KEYFILE_PASSPHRASE
;
c
->
parent
.
free
=
ssh_keyfile_passphrase_free
;
c
->
parent
.
free
=
ssh_keyfile_passphrase_free
;
c
->
privatekey
=
git__strdup
(
privatekey
);
c
->
privatekey
=
git__strdup
(
privatekey
);
GITERR_CHECK_ALLOC
(
c
->
privatekey
);
GITERR_CHECK_ALLOC
(
c
->
privatekey
);
if
(
publickey
)
{
if
(
publickey
)
{
c
->
publickey
=
git__strdup
(
publickey
);
c
->
publickey
=
git__strdup
(
publickey
);
GITERR_CHECK_ALLOC
(
c
->
publickey
);
GITERR_CHECK_ALLOC
(
c
->
publickey
);
}
}
...
@@ -129,9 +129,9 @@ int git_cred_ssh_keyfile_passphrase_new(
...
@@ -129,9 +129,9 @@ int git_cred_ssh_keyfile_passphrase_new(
int
git_cred_ssh_publickey_new
(
int
git_cred_ssh_publickey_new
(
git_cred
**
cred
,
git_cred
**
cred
,
const
char
*
publickey
,
const
char
*
publickey
,
size_t
publickey_len
,
size_t
publickey_len
,
git_cred_sign_callback
sign_callback
,
git_cred_sign_callback
sign_callback
,
void
*
sign_data
)
void
*
sign_data
)
{
{
git_cred_ssh_publickey
*
c
;
git_cred_ssh_publickey
*
c
;
...
@@ -150,9 +150,9 @@ int git_cred_ssh_publickey_new(
...
@@ -150,9 +150,9 @@ int git_cred_ssh_publickey_new(
memcpy
(
c
->
publickey
,
publickey
,
publickey_len
);
memcpy
(
c
->
publickey
,
publickey
,
publickey_len
);
}
}
c
->
publickey_len
=
publickey_len
;
c
->
publickey_len
=
publickey_len
;
c
->
sign_callback
=
sign_callback
;
c
->
sign_callback
=
sign_callback
;
c
->
sign_data
=
sign_data
;
c
->
sign_data
=
sign_data
;
*
cred
=
&
c
->
parent
;
*
cred
=
&
c
->
parent
;
return
0
;
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment