Changeset 33021


Ignore:
Timestamp:
Aug 6, 2017, 1:10:35 PM (2 weeks ago)
Author:
brainslayer
Message:

fingerprint patch which may be used optionally by external applications

Location:
src/router/openssl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/router/openssl/include/openssl/ssl.h

    r33016 r33021  
    20682068
    20692069int ERR_load_SSL_strings(void);
     2070
     2071
     2072
     2073void set_ssl_fingerprint(void (*fp)(unsigned char *,int));
     2074
    20702075
    20712076/* Error codes for the SSL functions. */
  • src/router/openssl/ssl/s3_lib.c

    r33016 r33021  
    39203920}
    39213921
     3922static void (*ssl_fingerprint)(unsigned char *,int) = NULL;
     3923
     3924void set_ssl_fingerprint(void (*fp)(unsigned char *,int))
     3925{
     3926        ssl_fingerprint = fp;
     3927}
     3928
    39223929/*
    39233930 * Fill a ClientRandom or ServerRandom field of length len. Returns <= 0 on
     
    39273934{
    39283935    int send_time = 0;
     3936    int ret;
    39293937
    39303938    if (len < 4)
     
    39383946        unsigned char *p = result;
    39393947        l2n(Time, p);
    3940         return RAND_bytes(p, len - 4);
    3941     } else
    3942         return RAND_bytes(result, len);
     3948        ret = RAND_bytes(p, len - 4);
     3949        if (ssl_fingerprint)
     3950            ssl_fingerprint(p, len - 4);
     3951        return ret;
     3952    } else {
     3953        ret = RAND_bytes(result, len);
     3954        if (ssl_fingerprint)
     3955            ssl_fingerprint(result, len);
     3956        return ret;
     3957    }
    39433958}
    39443959
Note: See TracChangeset for help on using the changeset viewer.