diff options
author | bodo <bodo> | 2000-01-06 01:19:13 +0000 |
---|---|---|
committer | bodo <bodo> | 2000-01-06 01:19:13 +0000 |
commit | a550dcc0b8dbeb0cb6d53d0ccce5a02831fcbea0 (patch) | |
tree | ea9f5bc6a788e8cca5c641798051e84adf395723 /ssl | |
parent | 7e7b4315dda7d9157104775e07ba37c827eac862 (diff) | |
download | openssl-a550dcc0b8dbeb0cb6d53d0ccce5a02831fcbea0.tar.gz |
New functions SSL_get_finished, SSL_get_peer_finished.
Add short state string for MS SGC.
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/ssl.h | 7 | ||||
-rw-r--r-- | ssl/ssl_lib.c | 32 | ||||
-rw-r--r-- | ssl/ssl_stat.c | 1 |
3 files changed, 40 insertions, 0 deletions
@@ -704,6 +704,13 @@ struct ssl_st #define SSL_ST_READ_BODY 0xF1 #define SSL_ST_READ_DONE 0xF2 +/* Obtain latest Finished message + * -- that we sent (SSL_get_finished) + * -- that we expected from peer (SSL_get_peer_finished). + * Returns length (0 == no Finished so far), copies up to 'count' bytes. */ +size_t SSL_get_finished(SSL *s, void *buf, size_t count); +size_t SSL_get_peer_finished(SSL *s, void *buf, size_t count); + /* use either SSL_VERIFY_NONE or SSL_VERIFY_PEER, the last 2 options * are 'ored' with SSL_VERIFY_PEER if they are desired */ #define SSL_VERIFY_NONE 0x00 diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 88ff03b3a..02f8d1125 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -477,6 +477,38 @@ err: } #endif + +/* return length of latest Finished message we sent, copy to 'buf' */ +size_t SSL_get_finished(SSL *s, void *buf, size_t count) + { + size_t ret = 0; + + if (s->s3 != NULL) + { + ret = s->s3->tmp.finish_md_len; + if (count > ret) + count = ret; + memcpy(buf, s->s3->tmp.finish_md, count); + } + return ret; + } + +/* return length of latest Finished message we expected, copy to 'buf' */ +size_t SSL_get_peer_finished(SSL *s, void *buf, size_t count) + { + size_t ret = 0; + + if (s->s3 != NULL) + { + ret = s->s3->tmp.peer_finish_md_len; + if (count > ret) + count = ret; + memcpy(buf, s->s3->tmp.peer_finish_md, count); + } + return ret; + } + + int SSL_get_verify_mode(SSL *s) { return(s->verify_mode); diff --git a/ssl/ssl_stat.c b/ssl/ssl_stat.c index 4042c4e75..1335764fb 100644 --- a/ssl/ssl_stat.c +++ b/ssl/ssl_stat.c @@ -313,6 +313,7 @@ case SSL3_ST_SW_HELLO_REQ_C: str="3WHR_C"; break; case SSL3_ST_SR_CLNT_HELLO_A: str="3RCH_A"; break; case SSL3_ST_SR_CLNT_HELLO_B: str="3RCH_B"; break; case SSL3_ST_SR_CLNT_HELLO_C: str="3RCH_C"; break; +case SSL3_ST_SR_MS_SGC: str="3RMSSG"; break; case SSL3_ST_SW_SRVR_HELLO_A: str="3WSH_A"; break; case SSL3_ST_SW_SRVR_HELLO_B: str="3WSH_B"; break; case SSL3_ST_SW_CERT_A: str="3WSC_A"; break; |