57 |
|
|
58 |
|
|
59 |
gpgme_error_t |
gpgme_error_t |
60 |
gpgme_clip_parse_pgpid( const char * data, gpgme_cliptype_t * r_type ) |
gpgme_clip_parse_pgpid (const char * data, gpgme_pgptype_t * r_type) |
61 |
{ |
{ |
62 |
gpgme_cliptype_t type; |
gpgme_pgptype_t type; |
63 |
|
|
64 |
if( !data ) |
if( !data ) |
65 |
return mk_error( Invalid_Value ); |
return mk_error( Invalid_Value ); |
69 |
} |
} |
70 |
type = 0; |
type = 0; |
71 |
if( strstr( data, "BEGIN PGP MESSAGE") ) |
if( strstr( data, "BEGIN PGP MESSAGE") ) |
72 |
type |= GPGME_CLIP_MESSAGE; |
type |= GPGME_PGP_MESSAGE; |
73 |
if( strstr( data, "BEGIN PGP SIGNED MESSAGE" ) ) |
if( strstr( data, "BEGIN PGP SIGNED MESSAGE" ) ) |
74 |
type |= GPGME_CLIP_CLEARSIG; |
type |= GPGME_PGP_CLEARSIG; |
75 |
if( strstr( data, "BEGIN PGP SIGNATURE" ) ) |
if( strstr( data, "BEGIN PGP SIGNATURE" ) ) |
76 |
type |= GPGME_CLIP_SIG; |
type |= GPGME_PGP_SIG; |
77 |
if( strstr( data, "BEGIN PGP PUBLIC KEY BLOCK" ) ) |
if( strstr( data, "BEGIN PGP PUBLIC KEY BLOCK" ) ) |
78 |
type |= GPGME_CLIP_PUBKEY; |
type |= GPGME_PGP_PUBKEY; |
79 |
if( strstr( data, "BEGIN PGP PRIVATE KEY BLOCK" ) |
if( strstr( data, "BEGIN PGP PRIVATE KEY BLOCK" ) |
80 |
|| strstr( data, "BEGIN PGP SECRET KEY BLOCK" ) ) |
|| strstr( data, "BEGIN PGP SECRET KEY BLOCK" ) ) |
81 |
type |= GPGME_CLIP_SECKEY; |
type |= GPGME_PGP_SECKEY; |
82 |
if( strstr( data, "- -----BEGIN" ) ) |
if( strstr( data, "- -----BEGIN" ) ) |
83 |
type |= GPGME_CLIP_DASH_ESCAPED; |
type |= GPGME_PGP_DASH_ESCAPED; |
84 |
*r_type = type; |
*r_type = type; |
85 |
return 0; |
return 0; |
86 |
} /* gpgme_clip_parse_pgpid */ |
} /* gpgme_clip_parse_pgpid */ |
87 |
|
|
88 |
|
|
89 |
gpgme_error_t |
gpgme_error_t |
90 |
gpgme_clip_is_secured( gpgme_cliptype_t * r_type, int * r_rc ) |
gpgme_clip_is_secured (gpgme_pgptype_t * r_type, int * r_rc) |
91 |
{ |
{ |
92 |
int rc = 0; |
int rc = 0; |
93 |
HANDLE clipmem; |
HANDLE clipmem; |
135 |
|
|
136 |
|
|
137 |
gpgme_error_t |
gpgme_error_t |
138 |
gpgme_clip_get_pgptype( gpgme_cliptype_t * r_type ) |
gpgme_clip_get_pgptype (gpgme_pgptype_t * r_type) |
139 |
{ |
{ |
140 |
gpgme_error_t rc = 0; |
gpgme_error_t rc = 0; |
141 |
HANDLE clipmem; |
HANDLE clipmem; |