List:Commits« Previous MessageNext Message »
From:msvensson Date:April 26 2006 1:29pm
Subject:bk commit into 5.0 tree (msvensson:1.2174)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2174 06/04/26 15:29:52 msvensson@shellback.(none) +6 -0
  Import from upstream yassl

  extra/yassl/testsuite/test.hpp
    1.2 06/04/24 23:55:04 msvensson@shellback.(none)[msvensson] +2 -2
    Import patch yassl.diff

  extra/yassl/taocrypt/src/template_instnt.cpp
    1.10 06/04/24 21:55:44 msvensson@shellback.(none)[msvensson] +0 -1
    Import patch yassl.diff

  extra/yassl/taocrypt/src/make.bat
    1.2 06/04/24 21:55:44 msvensson@shellback.(none)[msvensson] +1 -1
    Import patch yassl.diff

  extra/yassl/taocrypt/src/asn.cpp
    1.6 06/04/24 23:55:04 msvensson@shellback.(none)[msvensson] +52 -12
    Import patch yassl.diff

  extra/yassl/taocrypt/include/asn.hpp
    1.5 06/04/24 23:55:04 msvensson@shellback.(none)[msvensson] +13 -6
    Import patch yassl.diff

  extra/yassl/mySTL/helpers.hpp
    1.10 06/04/24 21:55:44 msvensson@shellback.(none)[msvensson] +5 -0
    Import patch yassl.diff

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	shellback.(none)
# Root:	/home/msvensson/mysql/my50-maint-yassl

--- 1.1/extra/yassl/taocrypt/src/make.bat	2006-03-29 01:56:38 +02:00
+++ 1.2/extra/yassl/taocrypt/src/make.bat	2006-04-24 21:55:44 +02:00
@@ -1,4 +1,4 @@
-# quick and dirty build file for testing different MSDEVs
+REM quick and dirty build file for testing different MSDEVs
 setlocal 
 
 set myFLAGS= /I../include /I../../mySTL /c /W3 /G6 /O2 

--- 1.1/extra/yassl/testsuite/test.hpp	2006-03-29 01:56:42 +02:00
+++ 1.2/extra/yassl/testsuite/test.hpp	2006-04-24 23:55:04 +02:00
@@ -305,8 +305,8 @@
         char* subject = X509_NAME_oneline(X509_get_subject_name(peer), 0, 0);
 
         printf("peer's cert info:\n");
-        printf("issuer  is: %s\n", issuer);
-        printf("subject is: %s\n", subject);
+        printf("issuer : %s\n", issuer);
+        printf("subject: %s\n", subject);
 
         free(subject);
         free(issuer);

--- 1.9/extra/yassl/mySTL/helpers.hpp	2006-04-11 22:53:08 +02:00
+++ 1.10/extra/yassl/mySTL/helpers.hpp	2006-04-24 21:55:44 +02:00
@@ -44,6 +44,11 @@
         return static_cast<void*>(d);
     }
 
+    // for compilers that want matching delete
+    inline void operator delete(void* ptr, Dummy* d) 
+    { 
+    }
+
     typedef Dummy* yassl_pointer;
 
 namespace mySTL {

--- 1.4/extra/yassl/taocrypt/include/asn.hpp	2006-03-29 01:56:35 +02:00
+++ 1.5/extra/yassl/taocrypt/include/asn.hpp	2006-04-24 23:55:04 +02:00
@@ -79,7 +79,13 @@
 
 enum DNTags
 {
-    COMMON_NAME         = 0x03
+    COMMON_NAME         = 0x03,  // CN
+    SUR_NAME            = 0x04,  // SN
+    COUNTRY_NAME        = 0x06,  // C
+    LOCALITY_NAME       = 0x07,  // L
+    STATE_NAME          = 0x08,  // ST
+    ORG_NAME            = 0x0a,  // O
+    ORGUNIT_NAME        = 0x0b   // OU
 };
 
 
@@ -92,7 +98,8 @@
     MAX_SEQ_SZ    =  5,    // enum(seq|con) + length(4)
     MAX_ALGO_SIZE =  9,
     MAX_DIGEST_SZ = 25,    // SHA + enum(Bit or Octet) + length(4)
-    DSA_SIG_SZ    = 40
+    DSA_SIG_SZ    = 40,
+    NAME_MAX      = 512    // max total of all included names
 };
 
 
@@ -205,14 +212,14 @@
 // A Signing Authority
 class Signer {
     PublicKey key_;
-    char*     name_;
+    char      name_[NAME_MAX];
     byte      hash_[SHA_SIZE];
 public:
     Signer(const byte* k, word32 kSz, const char* n, const byte* h);
     ~Signer();
 
     const PublicKey& GetPublicKey()  const { return key_; }
-    const char*      GetCommonName() const { return name_; }
+    const char*      GetName()       const { return name_; }
     const byte*      GetHash()       const { return hash_; }
 
 private:
@@ -257,8 +264,8 @@
     byte      subjectHash_[SHA_SIZE];   // hash of all Names
     byte      issuerHash_[SHA_SIZE];    // hash of all Names
     byte*     signature_;
-    char*     issuer_;                  // CommonName
-    char*     subject_;                 // CommonName
+    char      issuer_[NAME_MAX];        // Names
+    char      subject_[NAME_MAX];       // Names
     bool      verify_;                  // Default to yes, but could be off
 
     void   ReadHeader();

--- 1.5/extra/yassl/taocrypt/src/asn.cpp	2006-03-29 01:56:36 +02:00
+++ 1.6/extra/yassl/taocrypt/src/asn.cpp	2006-04-24 23:55:04 +02:00
@@ -213,21 +213,17 @@
 
 
 Signer::Signer(const byte* k, word32 kSz, const char* n, const byte* h)
-    : key_(k, kSz), name_(0)
+    : key_(k, kSz)
 {
-    if (n) {
         int sz = strlen(n);
-        name_ = NEW_TC char[sz + 1];
         memcpy(name_, n, sz);
         name_[sz] = 0;
-    }
 
     memcpy(hash_, h, SHA::DIGEST_SIZE);
 }
 
 Signer::~Signer()
 {
-    tcArrayDelete(name_);
 }
 
 
@@ -424,17 +420,19 @@
 CertDecoder::CertDecoder(Source& s, bool decode, SignerList* signers,
                          bool noVerify, CertType ct)
     : BER_Decoder(s), certBegin_(0), sigIndex_(0), sigLength_(0),
-      signature_(0), issuer_(0), subject_(0), verify_(!noVerify)
+      signature_(0), verify_(!noVerify)
 { 
+    issuer_[0] = 0;
+    subject_[0] = 0;
+
     if (decode)
         Decode(signers, ct); 
+
 }
 
 
 CertDecoder::~CertDecoder()
 {
-    tcArrayDelete(subject_);
-    tcArrayDelete(issuer_);
     tcArrayDelete(signature_);
 }
 
@@ -672,8 +670,12 @@
 
     SHA    sha;
     word32 length = GetSequence();  // length of all distinguished names
+    assert (length < NAME_MAX);
     length += source_.get_index();
 
+    char*  ptr = (nt == ISSUER) ? issuer_ : subject_;
+    word32 idx = 0;
+
     while (source_.get_index() < length) {
         GetSet();
         GetSequence();
@@ -694,13 +696,49 @@
             byte   id      = source_.next();  
             b              = source_.next();    // strType
             word32 strLen  = GetLength(source_);
+            bool   copy    = false;
 
             if (id == COMMON_NAME) {
-                char*& ptr = (nt == ISSUER) ? issuer_ : subject_;
-                ptr = NEW_TC char[strLen + 1];
-                memcpy(ptr, source_.get_current(), strLen);
-                ptr[strLen] = 0;
+                memcpy(&ptr[idx], "/CN=", 4);
+                idx += 4;
+                copy = true;
+            }
+            else if (id == SUR_NAME) {
+                memcpy(&ptr[idx], "/SN=", 4);
+                idx += 4;
+                copy = true;
+            }
+            else if (id == COUNTRY_NAME) {
+                memcpy(&ptr[idx], "/C=", 3);
+                idx += 3;
+                copy = true;
+            }
+            else if (id == LOCALITY_NAME) {
+                memcpy(&ptr[idx], "/L=", 3);
+                idx += 3;
+                copy = true;
             }
+            else if (id == STATE_NAME) {
+                memcpy(&ptr[idx], "/ST=", 4);
+                idx += 4;
+                copy = true;
+            }
+            else if (id == ORG_NAME) {
+                memcpy(&ptr[idx], "/O=", 3);
+                idx += 3;
+                copy = true;
+            }
+            else if (id == ORGUNIT_NAME) {
+                memcpy(&ptr[idx], "/OU=", 4);
+                idx += 4;
+                copy = true;
+            }
+
+            if (copy) {
+                memcpy(&ptr[idx], source_.get_current(), strLen);
+                idx += strLen;
+            }
+
             sha.Update(source_.get_current(), strLen);
             source_.advance(strLen);
         }
@@ -711,6 +749,8 @@
             source_.advance(length);
         }
     }
+    ptr[idx++] = 0;
+
     if (nt == ISSUER)
         sha.Final(issuerHash_);
     else

--- 1.9/extra/yassl/taocrypt/src/template_instnt.cpp	2006-04-21 18:19:46 +02:00
+++ 1.10/extra/yassl/taocrypt/src/template_instnt.cpp	2006-04-24 21:55:44 +02:00
@@ -30,7 +30,6 @@
 #include "sha.hpp"
 #include "md5.hpp"
 #include "hmac.hpp"
-#include "ripemd.hpp"
 #include "pwdbased.hpp"
 #include "algebra.hpp"
 #include "vector.hpp"
Thread
bk commit into 5.0 tree (msvensson:1.2174)msvensson26 Apr