forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrypto-interface.h
More file actions
80 lines (72 loc) · 1.61 KB
/
crypto-interface.h
File metadata and controls
80 lines (72 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/**
* File: crypto-interface.h
* Created by: Team Rogue (University of Portland)
* - Vince Clasgens
* - Dustin Dalen
* - David Garcia
* - Sam Chase
* Last Modified: April 2, 2013
*
* Functions defined to sign and verify using 'git crypto'
* command using CMS library within OpenSSL
*
*
**/
#ifndef CYPTO_INTERFACE_H
#define CYPTO_INTERFACE_H
//VERIFYING RETURN CODES
#define VERIFY_PASS 0
#define VERIFY_FAIL_NO_NOTE 1
#define VERIFY_FAIL_BAD_SIG 2
#define VERIFY_FAIL_NOT_TRUSTED 4
#define VERIFY_FAIL_COMPARE 8
/**
* get_commit_list()
*
* Parameters: none
*
* Retrieves an array of char* which are the SHA's of the refs of each commit
* - with the last item being NULL
*
**/
extern char ** get_commit_list();
/**
* free_cmt_list()
*
* Parameters: char** list
* - Array of char* which are SHA's of the refs of each commit
* - Represents the commit list
*
* Free's each char* in the commit list
*
*
**/
extern void free_cmt_list(char**);
/**
* get_pem_path()
*
* returns a char* to the path of the public key private key pair
**/
extern char * get_pem_path();
/**
* verify_commit()
*
* Paramaters: char * sha1
* - SHA1 ref of commit to be verified
*
* Verifies the given SHA1 Ref of a commit and the note if one is present
*
**/
extern int verify_commit(char * sha1);
/**
* sign_commit_sha()
*
* Parameters: char * sha
* - SHA1 ref of commit to be signed
*
* Signs a commit given a SHA1 ref of a commit
*
*
**/
extern int sign_commit_sha(char * sha);
#endif