diff options
| author | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2013-10-07 21:24:43 +0000 |
|---|---|---|
| committer | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2013-10-07 21:24:43 +0000 |
| commit | 56c1e5aacaaec79b24453d406e7c2b218fa0cc9f (patch) | |
| tree | 87b5e478a4d9308837131434342fea357dc17b31 /PICA_client.c | |
| parent | 57d45923fc62be7d11ac20abba8618ca4b90bea4 (diff) | |
| download | pica-pica-56c1e5aacaaec79b24453d406e7c2b218fa0cc9f.tar.gz pica-pica-56c1e5aacaaec79b24453d406e7c2b218fa0cc9f.zip | |
update from database schema 1 to 2 with importing old accounts and converting them to the new id formats; implemented new function PICA_get_id_from_cert_string
git-svn-id: svn://localhost/project_picapica/trunk@276 fb96df88-216d-11de-830c-f3023f12d8ac
Diffstat (limited to 'PICA_client.c')
| -rwxr-xr-x | PICA_client.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/PICA_client.c b/PICA_client.c index c11e244..de4aaf3 100755 --- a/PICA_client.c +++ b/PICA_client.c @@ -124,6 +124,23 @@ if (!x) return PICA_id_from_X509(x, id); } +int PICA_get_id_from_cert_string(const char *cert_pem, unsigned char *id) +{ +X509 *x; +BIO *biomem; + +biomem = BIO_new_mem_buf(cert_pem, -1); + +x = PEM_read_bio_X509(biomem, NULL, 0, NULL); + +if (!x) +{ + return 0; +} + +return PICA_id_from_X509(x, id); +} + static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) { //return 1 for self-signed certificates char buf[256]; |
