projects
/
umurmur.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
898e102
)
added hash calculation
author
Felix Morgner
<felix.morgner@gmail.com>
Sat, 31 Jan 2015 13:30:38 +0000
(14:30 +0100)
committer
Felix Morgner
<felix.morgner@gmail.com>
Sat, 31 Jan 2015 13:30:38 +0000
(14:30 +0100)
src/ssli_gnutls.c
patch
|
blob
|
history
diff --git
a/src/ssli_gnutls.c
b/src/ssli_gnutls.c
index dfe2f2eeb47628fde849950c9d1608ce54b2a0c0..e8b4609a052cf9bc7b5d8357c92557fb6bce21fd 100644
(file)
--- a/
src/ssli_gnutls.c
+++ b/
src/ssli_gnutls.c
@@
-78,10
+78,13
@@
SSL_handle_t * SSLi_newconnection( int * fileDescriptor, bool_t * isSSLReady )
return session;
}
return session;
}
-bool_t SSLi_getSHA1Hash(SSL_handle_t *s
sl
, uint8_t *hash)
+bool_t SSLi_getSHA1Hash(SSL_handle_t *s
ession
, uint8_t *hash)
{
{
- *hash = 0;
- return true;
+ gnutls_datum_t const * certificateData = gnutls_certificate_get_peers(*session, NULL);
+
+ size_t resultSize = 0;
+ int error = gnutls_fingerprint( GNUTLS_DIG_SHA1, certificateData, hash, &resultSize);
+ return error == GNUTLS_E_SUCCESS && resultSize == 20;
}
int SSLi_nonblockaccept( SSL_handle_t *session, bool_t * isSSLReady )
}
int SSLi_nonblockaccept( SSL_handle_t *session, bool_t * isSSLReady )