~ubuntu-branches/ubuntu/raring/ipxe/raring

« back to all changes in this revision

Viewing changes to src/include/ipxe/clientcert.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-11-14 15:47:31 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20121114154731-jhuy5d1h2jw75qe9
Tags: 1.0.0+git-4.d6b0b76-0ubuntu1
* New upstream snapshot:
  - d/p/iscsi*.patch: Dropped - included in snapshot.
  - Refreshed all other patches.
* d/p/enable-https.patch: Enable HTTPS support (LP: #1025239).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _IPXE_CLIENTCERT_H
 
2
#define _IPXE_CLIENTCERT_H
 
3
 
 
4
/** @file
 
5
 *
 
6
 * Client certificate store
 
7
 *
 
8
 */
 
9
 
 
10
FILE_LICENCE ( GPL2_OR_LATER );
 
11
 
 
12
#include <stdint.h>
 
13
 
 
14
/** A client certificate */
 
15
struct client_certificate {
 
16
        /** Data */
 
17
        const void *data;
 
18
        /** Length */
 
19
        size_t len;
 
20
};
 
21
 
 
22
/** A client private key */
 
23
struct client_private_key {
 
24
        /** Data */
 
25
        const void *data;
 
26
        /** Length */
 
27
        size_t len;
 
28
};
 
29
 
 
30
extern struct client_certificate client_certificate;
 
31
extern struct client_private_key client_private_key;
 
32
 
 
33
/**
 
34
 * Check for presence of a client certificate
 
35
 *
 
36
 * @ret have_cert       We have a client certificate and private key
 
37
 */
 
38
static inline int have_client_certificate ( void ) {
 
39
        return ( ( client_certificate.len > 0 ) &&
 
40
                 ( client_private_key.len > 0 ) );
 
41
}
 
42
 
 
43
#endif /* _IPXE_CLIENTCERT_H */