~ubuntu-branches/ubuntu/natty/mysql-5.1/natty

« back to all changes in this revision

Viewing changes to extra/yassl/src/yassl_imp.cpp

Tags: 5.1.54-1ubuntu1
* Synchronize from Debian Experimental:
* Merge from debian unstable:
  + debian/control:
     * Update maintainer according to spec.
     * Move section from "misc" to "database".
     * Added libmysqlclient16-dev an empty transitional package. 
     * Added mysql-client-core-5.1 package.
     * Suggest mailx for mysql-server-5.1
     * Add mysql-testsuite package so you can run the testsuite seperately.
  + debian/additions/my.cnf:
    * Remove language options. Error message files are located in a different directory in Mysql
      5.0. Setting the language option to use /usr/share/mysql/english breaks Mysql 5.0. Both 5.0
      and 5.1 use a different value that works. (LP: #316974)
  + Add apparmor profile:
    + debian/apparmor-profile: apparmor-profile
    + debian/rules, debian/mysql-server-5.1.files: install apparmor profile
    + debian/mysql-server-5.1.dirs: add etc/apparmor.d/fore-complain
    + debian/mysql-server-5.1.postrm: remove symlink in force-complain/ on purge.
    + debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    + debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    + debian/mysql-server-5.1.postinst: reload apparmor profiles
  * Convert the package from sysvinit to upstart:
    + debian/mysql-server-5.1.mysql.upstart: Add upstart script.
    + debian/mysql-server-5.1.mysql.init: Dropped, unused now with upstart.
    + debian/additions/mysqld_safe_syslog.cnf: Dropped, unused now with upstart.
    + debian/additons/my.cnf: Remove pid declaration and setup error logging to /var/log/mysql since
      we're not piping anything around logger anymore.
    + debian/rules, debian/mysql-server-5.1.logcheck.ignore.{paranoid,worstation},
      debian/mysql-server-5.1.logcheck.ignore.server: : Remove references to mysqld_safe
    + debian/patches/38_scripts_mysqld_safe.sh_signals.dpatch: Dropped
  * Added -fno-strict-aliasing to CFLAGS to get around mysql testsuite build failures.
  * Add Apport hook (LP: #354188):
    + debian/mysql-server-5.1.py: apport package hook
    + debian/rules: Make it installable
  * debian/mysql-server-5.1.mysql-server.logrotate: Check to see if mysql is running before
    running logrotate. (LP: #513135)
  * Make the testsuite installable. (LP: #530752)
    + debian/mysql-server-5.1.files, debian/rules: install apport package hook
  * debian/mysql-server-5.1.preinst: Set mysql user's home directory
    to /nonexistent to protect against having the /var/lib/mysql
    user-writeable. If an attacker can trick mysqld into creating
    dot files in the home directory, he could do .rhost-like attacks
    on the system. (LP: #293258)
  * debian/control: mysql-client-5.1 should depend on mysql-core-client-5.1.
    (LP: #590952)
  * debian/mysql-server.5.1.postinst: Specify the mysql user when installing 
    the mysql databases. (LP: #591875)
  * Installing mysql_config_pic in /usr/bin so users of libmysqld-pic
    can extract the appropriate compile flags. (LP: #605021) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
884
884
        else
885
885
            hmac(ssl, verify, data, aSz, alert, true);
886
886
 
887
 
        // read mac and fill
 
887
        // read mac and skip fill
888
888
        int    digestSz = ssl.getCrypto().get_digest().get_digestSize();
889
889
        opaque mac[SHA_LEN];
890
890
        input.read(mac, digestSz);
891
891
 
892
892
        if (ssl.getSecurity().get_parms().cipher_type_ == block) {
893
893
            int    ivExtra = 0;
894
 
        opaque fill;
895
894
 
896
895
            if (ssl.isTLSv1_1())
897
896
                ivExtra = ssl.getCrypto().get_cipher().get_blockSize();
898
897
            int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra -
899
898
                        aSz - digestSz;
900
 
        for (int i = 0; i < padSz; i++) 
901
 
            fill = input[AUTO];
 
899
            input.set_current(input.get_current() + padSz);
902
900
        }
903
901
 
904
902
        // verify
981
979
void Data::Process(input_buffer& input, SSL& ssl)
982
980
{
983
981
    int msgSz = ssl.getSecurity().get_parms().encrypt_size_;
984
 
    int pad   = 0, padByte = 0;
 
982
    int pad   = 0, padSz = 0;
985
983
    int ivExtra = 0;
986
984
 
987
985
    if (ssl.getSecurity().get_parms().cipher_type_ == block) {
988
986
        if (ssl.isTLSv1_1())  // IV
989
987
            ivExtra = ssl.getCrypto().get_cipher().get_blockSize();
990
988
        pad = *(input.get_buffer() + input.get_current() + msgSz -ivExtra - 1);
991
 
        padByte = 1;
 
989
        padSz = 1;
992
990
    }
993
991
    int digestSz = ssl.getCrypto().get_digest().get_digestSize();
994
 
    int dataSz = msgSz - ivExtra - digestSz - pad - padByte;   
 
992
    int dataSz = msgSz - ivExtra - digestSz - pad - padSz;
995
993
    opaque verify[SHA_LEN];
996
994
 
997
995
    const byte* rawData = input.get_buffer() + input.get_current();
1020
1018
            hmac(ssl, verify, rawData, dataSz, application_data, true);
1021
1019
    }
1022
1020
 
1023
 
    // read mac and fill
 
1021
    // read mac and skip fill
1024
1022
    opaque mac[SHA_LEN];
1025
 
    opaque fill;
1026
1023
    input.read(mac, digestSz);
1027
 
    for (int i = 0; i < pad; i++) 
1028
 
        fill = input[AUTO];
1029
 
    if (padByte)
1030
 
        fill = input[AUTO];    
 
1024
    input.set_current(input.get_current() + pad + padSz);
1031
1025
 
1032
1026
    // verify
1033
1027
    if (dataSz) {
2073
2067
        if (ssl.isTLSv1_1())
2074
2068
            ivExtra = ssl.getCrypto().get_cipher().get_blockSize();
2075
2069
 
2076
 
    opaque fill;
2077
2070
    int    padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra -
2078
2071
                     HANDSHAKE_HEADER - finishedSz - digestSz;
2079
 
    for (int i = 0; i < padSz; i++) 
2080
 
        fill = input[AUTO];
 
2072
    input.set_current(input.get_current() + padSz);
2081
2073
 
2082
2074
    // verify mac
2083
2075
    if (memcmp(mac, verifyMAC, digestSz)) {