source: swig/perl/SSL_keyid.c @ f7040d8

abac0-leakabac0-meicompt_changesgec13mei-idmei-rt0-nmei_rt0mei_rt2mei_rt2_fix_1meiyap-rt1meiyap1rt2tvf-new-xml
Last change on this file since f7040d8 was f7040d8, checked in by Mike Ryan <mikeryan@…>, 14 years ago

perl preprover

SSL key id differs from our (libabac) keyid

SSL: sha1(whole cert)
us: sha1(pub key)

  • Property mode set to 100644
File size: 284 bytes
Line 
1#include <stdio.h>
2
3#include <openssl/x509.h>
4
5char *SSL_keyid(int ptr) {
6    int i;
7
8    X509 *x = (X509 *)ptr;
9
10    char *hash = malloc(SHA_DIGEST_LENGTH * 2 + 1);
11    for (i = 0; i < SHA_DIGEST_LENGTH; ++i)
12        sprintf(&hash[2*i], "%02x", x->sha1_hash[i]);
13
14    return hash;
15}
Note: See TracBrowser for help on using the repository browser.