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
e057e411
Commit
e057e411
authored
May 15, 2013
by
Brad Morgan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reworked git_cred_ssh_keyfile_passphrase_new method
parent
b54ed3ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
33 deletions
+11
-33
src/transports/cred.c
+11
-33
No files found.
src/transports/cred.c
View file @
e057e411
...
...
@@ -90,48 +90,26 @@ int git_cred_ssh_keyfile_passphrase_new(
{
git_cred_ssh_keyfile_passphrase
*
c
;
if
(
!
cred
)
return
-
1
;
assert
(
cred
&&
privatekey
);
c
=
git__
malloc
(
sizeof
(
git_cred_ssh_keyfile_passphrase
));
c
=
git__
calloc
(
1
,
sizeof
(
git_cred_ssh_keyfile_passphrase
));
GITERR_CHECK_ALLOC
(
c
);
c
->
parent
.
credtype
=
GIT_CREDTYPE_SSH_KEYFILE_PASSPHRASE
;
c
->
parent
.
free
=
ssh_keyfile_passphrase_free
;
c
->
privatekey
=
git__strdup
(
privatekey
);
if
(
!
c
->
privatekey
)
{
git__free
(
c
);
return
-
1
;
}
GITERR_CHECK_ALLOC
(
c
->
privatekey
);
if
(
publickey
)
{
c
->
publickey
=
git__strdup
(
publickey
);
if
(
!
c
->
publickey
)
{
git__free
(
c
->
privatekey
);
git__free
(
c
);
return
-
1
;
}
}
else
{
c
->
publickey
=
NULL
;
}
if
(
passphrase
)
{
c
->
passphrase
=
git__strdup
(
passphrase
);
if
(
!
c
->
passphrase
)
{
git__free
(
c
->
privatekey
);
if
(
c
->
publickey
)
{
git__free
(
c
->
publickey
);
}
git__free
(
c
);
return
-
1
;
}
}
else
{
c
->
passphrase
=
NULL
;
}
c
->
publickey
=
git__strdup
(
publickey
);
GITERR_CHECK_ALLOC
(
c
->
publickey
);
}
if
(
passphrase
)
{
c
->
passphrase
=
git__strdup
(
passphrase
);
GITERR_CHECK_ALLOC
(
c
->
passphrase
);
}
*
cred
=
&
c
->
parent
;
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